XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsFileHandler Class Reference

Public Member Functions

 __construct ($path, $create=false, $mode=0755)
 
 __destruct ()
 
 append ($data, $force=false)
 
 close ()
 
 create ()
 
 delete ()
 
 executable ()
 
 exists ()
 
 ext ()
 
folder ()
 
 group ()
 
 info ()
 
 lastAccess ()
 
 lastChange ()
 
 md5 ($maxsize=5)
 
 name ()
 
 offset ($offset=false, $seek=SEEK_SET)
 
 open ($mode= 'r', $force=false)
 
 owner ()
 
 perms ()
 
 prepare ($data)
 
 pwd ()
 
 read ($bytes=false, $mode= 'rb', $force=false)
 
 readable ()
 
 safe ($name=null, $ext=null)
 
 size ()
 
 writable ()
 
 write ($data, $mode= 'w', $force=false)
 
 XoopsFileHandler ($path, $create=false, $mode=0755)
 

Public Attributes

 $folder = null
 
 $handle = null
 
 $info = array()
 
 $lock = null
 
 $name = null
 

Detailed Description

Definition at line 53 of file file.php.

Constructor & Destructor Documentation

XoopsFileHandler::__construct (   $path,
  $create = false,
  $mode = 0755 
)

Constructor

Parameters
string$pathPath to file
boolean$createCreate file if it does not exist (if true)
integer$modeMode to apply to the folder holding the file private

Definition at line 103 of file file.php.

References $path, XoopsFile\getHandler(), and XoopsLoad\load().

Here is the call graph for this function:

XoopsFileHandler::__destruct ( )

Closes the current file if it is opened

private

Definition at line 138 of file file.php.

Member Function Documentation

XoopsFileHandler::append (   $data,
  $force = false 
)

Append given data string to this File.

Parameters
string$dataData to write
string$forceforce the file to open
Returns
boolean Success public

Definition at line 297 of file file.php.

XoopsFileHandler::close ( )

Closes the current file if it is opened.

Returns
boolean True if closing was successful or file was already closed, otherwise false public

Definition at line 308 of file file.php.

XoopsFileHandler::create ( )

Creates the File.

Returns
boolean Success public

Definition at line 149 of file file.php.

References $dir.

XoopsFileHandler::delete ( )

Deletes the File.

Returns
boolean Success public

Definition at line 322 of file file.php.

XoopsFileHandler::executable ( )

Returns true if the File is executable.

Returns
boolean true if its executable, false otherwise public

Definition at line 490 of file file.php.

XoopsFileHandler::exists ( )

Returns true if the File exists.

Returns
boolean true if it exists, false otherwise public

Definition at line 438 of file file.php.

XoopsFileHandler::ext ( )

Returns the File extension.

Returns
string The File extension public

Definition at line 353 of file file.php.

& XoopsFileHandler::folder ( )

Returns the current folder.

Returns
Folder Current folder public

Definition at line 567 of file file.php.

XoopsFileHandler::group ( )

Returns the File group.

Returns
integer the Filegroup public

Definition at line 525 of file file.php.

XoopsFileHandler::info ( )

Returns the File extension.

Returns
string The File extension public

Definition at line 336 of file file.php.

XoopsFileHandler::lastAccess ( )

Returns last access time.

Returns
integer timestamp Timestamp of last access time public

Definition at line 539 of file file.php.

XoopsFileHandler::lastChange ( )

Returns last modified time.

Returns
integer timestamp Timestamp of last modification public

Definition at line 553 of file file.php.

XoopsFileHandler::md5 (   $maxsize = 5)

Get md5 Checksum of file with previous check of Filesize

Parameters
mixed$maxsizein MB or true to force
Returns
string md5 Checksum See md5_file() public

Definition at line 408 of file file.php.

XoopsFileHandler::name ( )

Returns the File name without extension.

Returns
string The File name without extension. public

Definition at line 370 of file file.php.

XoopsFileHandler::offset (   $offset = false,
  $seek = SEEK_SET 
)

Sets or gets the offset for the currently opened file.

Parameters
mixed$offsetThe $offset in bytes to seek. If set to false then the current offset is returned.
integer$seekPHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to
Returns
mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) public

Definition at line 229 of file file.php.

XoopsFileHandler::open (   $mode = 'r',
  $force = false 
)

Opens the current file with a given $mode

Parameters
string$modeA valid 'fopen' mode string (r|w|a ...)
boolean$forceIf true then the file will be re-opened even if its already opened, otherwise it won't
Returns
boolean True on success, false on failure public

Definition at line 168 of file file.php.

XoopsFileHandler::owner ( )

Returns the File's owner.

Returns
integer the Fileowner

Definition at line 511 of file file.php.

XoopsFileHandler::perms ( )

Returns the "chmod" (permissions) of the File.

Returns
string Permissions for the file public

Definition at line 450 of file file.php.

XoopsFileHandler::prepare (   $data)

Prepares a ascii string for writing fixes line endings

Parameters
string$dataData to prepare for writing.
Returns
string public

Definition at line 249 of file file.php.

XoopsFileHandler::pwd ( )

Returns the full path of the File.

Returns
string Full path to file public

Definition at line 427 of file file.php.

XoopsFileHandler::read (   $bytes = false,
  $mode = 'rb',
  $force = false 
)

Return the contents of this File as a string.

Parameters
string$byteswhere to start
string$mode
boolean$forceIf true then the file will be re-opened even if its already opened, otherwise it won't
Returns
mixed string on success, false on failure public

Definition at line 194 of file file.php.

XoopsFileHandler::readable ( )

Returns true if the File is readable.

Returns
boolean true if file is readable, false otherwise public

Definition at line 501 of file file.php.

XoopsFileHandler::safe (   $name = null,
  $ext = null 
)

makes filename safe for saving

Parameters
string$namethe name of the file to make safe if different from $this->name
Returns
string $ext the extension of the file public

Definition at line 390 of file file.php.

References $ext.

XoopsFileHandler::size ( )

Returns the Filesize, either in bytes or in human-readable format.

Parameters
boolean$humanReadebleData to write to this File.
Returns
string |int filesize as int or as a human-readable string public

Definition at line 465 of file file.php.

XoopsFileHandler::writable ( )

Returns true if the File is writable.

Returns
boolean true if its writable, false otherwise public

Definition at line 479 of file file.php.

XoopsFileHandler::write (   $data,
  $mode = 'w',
  $force = false 
)

Write given data to this File.

Parameters
string$dataData to write to this File.
string$modeMode of writing. See fwrite().
string$forceforce the file to open
Returns
boolean Success public

Definition at line 270 of file file.php.

XoopsFileHandler::XoopsFileHandler (   $path,
  $create = false,
  $mode = 0755 
)

XoopsFileHandler::XoopsFileHandler()

Parameters
mixed$path
mixed$create
mixed$mode

Definition at line 128 of file file.php.

References $path.

Member Data Documentation

XoopsFileHandler::$folder = null

Definition at line 61 of file file.php.

XoopsFileHandler::$handle = null

Definition at line 85 of file file.php.

XoopsFileHandler::$info = array()

Definition at line 77 of file file.php.

XoopsFileHandler::$lock = null

Definition at line 93 of file file.php.

XoopsFileHandler::$name = null

Definition at line 69 of file file.php.


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