Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
FileWrapper Class Reference
Inheritance diagram for FileWrapper:
ResourceWrapper

Public Member Functions

 close ()
 
 contents ()
 
 eof ()
 
 FileWrapper ($url, &$info)
 
 open ($mode= 'r')
 
 read ($len=8192)
 

Static Public Member Functions

static & wrapper ($source)
 

Public Attributes

 $fp
 
 $info
 
 $url
 

Detailed Description

Class abstracting operations for reading remote files using various protocols. (for when allow_url_fopen is disabled).

TODO:

  • Other protocols?
  • Write mode (where possible)

Definition at line 25 of file FileWrapper.inc.php.

Member Function Documentation

FileWrapper::close ( )

Close the file.

Definition at line 86 of file FileWrapper.inc.php.

Referenced by FileWrapper().

FileWrapper::contents ( )

Read and return the contents of the file (like file_get_contents()).

Returns
string

Definition at line 59 of file FileWrapper.inc.php.

FileWrapper::eof ( )

Check for end-of-file.

Returns
boolean

Definition at line 104 of file FileWrapper.inc.php.

Referenced by FileWrapper().

FileWrapper::FileWrapper (   $url,
$info 
)

Constructor.

Parameters
$urlstring
$infoarray

Definition at line 50 of file FileWrapper.inc.php.

References close(), eof(), open(), and read().

FileWrapper::open (   $mode = 'r')

Open the file.

Parameters
$modestring only 'r' (read-only) is currently supported
Returns
boolean

Definition at line 77 of file FileWrapper.inc.php.

Referenced by FileWrapper().

FileWrapper::read (   $len = 8192)

Read from the file.

Parameters
$lenint
Returns
string

Definition at line 96 of file FileWrapper.inc.php.

Referenced by FileWrapper().

static& FileWrapper::wrapper (   $source)
static

Return instance of a class for reading the specified URL.

Parameters
$sourcemixed; URL, filename, or resources
Returns
FileWrapper

Definition at line 118 of file FileWrapper.inc.php.

Referenced by PKPLanguageAction\downloadLocale().

Member Data Documentation

int FileWrapper::$fp

the file descriptor

Definition at line 43 of file FileWrapper.inc.php.

Referenced by ResourceWrapper\ResourceWrapper().

array FileWrapper::$info

parsed URL info

Definition at line 37 of file FileWrapper.inc.php.

string FileWrapper::$url

URL to the file

Definition at line 31 of file FileWrapper.inc.php.


The documentation for this class was generated from the following file: