Open Journal Systems  2.4.3
 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)
 
wrapper ($source)
 

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 26 of file FileWrapper.inc.php.

Member Function Documentation

FileWrapper::close ( )

Close the file.

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

Referenced by contents().

FileWrapper::contents ( )

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

Returns
string

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

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

FileWrapper::eof ( )

Check for end-of-file.

Returns
boolean

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

Referenced by contents().

FileWrapper::FileWrapper (   $url,
$info 
)

Constructor.

Parameters
$urlstring
$infoarray

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

Referenced by wrapper().

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

Open the file.

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

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

Referenced by contents().

FileWrapper::read (   $len = 8192)

Read from the file.

Parameters
$lenint
Returns
string

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

Referenced by contents().

& FileWrapper::wrapper (   $source)

Return instance of a class for reading the specified URL.

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

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

References FileWrapper(), and Config\getVar().

Referenced by LanguageAction\downloadLocale(), XMLParser\parse(), and XMLParser\parseStruct().


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