NAME

PHP::Functions::File - Transplant of file_get_contents/file_put_contentsl function of PHP

SYNOPSIS

#file_get_contents
use PHP::Functions::File qw(file_get_contents);
string file_get_contents ( string $filename [, bool $use_include_path = 0 [, hash $context [, int $offset = -1 [, int $maxlen ]]]] )

filename         : Name of the file to read. Regular file, HTTP, and gzlib are supported.
use_include_path : If ture, search for filename in the include directory.
context          : Not supported now.
offset           : Not supported now.
maxlen           : Not supported now.

#file_put_contents
use PHP::Functions::File qw(file_put_contents);
int file_put_contents ( string $filename , string $data [, int $flags = 0 [, hash $context ]] )

filename: Path to the file where to write the data. Regular file and gzlib are supported.
data    : The data to write.
flags   : Not supported now.
context : Not supported now.

EXAMPLE

use PHP::Functions::File qw(file_get_contents file_put_contents);

$data = file_get_contents("http://www.example.com/");

file_put_contents("test.org.txt", $data);
file_put_contents("zlib://test.txt.gz", $data);

$data = file_get_contents("zlib://test.txt.gz");
file_put_contents("file://test.txt", $data);

DESCRIPTION

This module offers perl function resemble file_get_contents/file_put_contents on PHP. Perl 5.8 or higher is required.

SEE ALSO

http://www.php.net/manual/en/function.file-get-contents.php http://www.php.net/manual/en/function.file-put-contents.php

To Do

- multiprotocol support. (Currently only http,file and zlib protocols are supported.) - context support.

AUTHOR

Tomohide Nagashima <tnaga@cpan.org>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 131:

=cut found outside a pod block. Skipping to next block.

Around line 190:

=cut found outside a pod block. Skipping to next block.