File Class Reference

Inheritance diagram for File:

Object

List of all members.


Public Member Functions

 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, $forceWindows=false)
 pwd ()
 read ($bytes=false, $mode= 'rb', $force=false)
 readable ()
 safe ($name=null, $ext=null)
 size ()
 writable ()
 write ($data, $mode= 'w', $force=false)

Public Attributes

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

Detailed Description

Definition at line 44 of file file.php.


Member Function Documentation

File::append ( data,
force = false 
)

Append given data string to this File.

Parameters:
string $data Data to write
string $force force the file to open
Returns:
boolean Success public

Definition at line 255 of file file.php.

References write().

File::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 264 of file file.php.

File::create (  ) 

Creates the File.

Returns:
boolean Success public

Definition at line 119 of file file.php.

References exists(), and pwd().

Referenced by open().

File::delete (  ) 

Deletes the File.

Returns:
boolean Success public

Definition at line 276 of file file.php.

References exists(), and pwd().

File::executable (  ) 

Returns true if the File is executable.

Returns:
boolean true if its executable, false otherwise public

Definition at line 422 of file file.php.

References pwd().

File::exists (  ) 

Returns true if the File exists.

Returns:
boolean true if it exists, false otherwise public

Definition at line 378 of file file.php.

References pwd().

Referenced by create(), delete(), group(), lastAccess(), lastChange(), open(), owner(), perms(), and size().

File::ext (  ) 

Returns the File extension.

Returns:
string The File extension public

Definition at line 303 of file file.php.

References info().

Referenced by safe().

& File::Folder (  ) 

Returns the current folder.

Returns:
Folder Current folder public

Definition at line 487 of file file.php.

File::group (  ) 

Returns the File group.

Returns:
integer the Filegroup public

Definition at line 451 of file file.php.

References exists(), and pwd().

File::info (  ) 

Returns the File extension.

Returns:
string The File extension public

Definition at line 288 of file file.php.

References name(), and pwd().

Referenced by ext(), and name().

File::lastAccess (  ) 

Returns last access time.

Returns:
integer timestamp Timestamp of last access time public

Definition at line 463 of file file.php.

References exists(), and pwd().

File::lastChange (  ) 

Returns last modified time.

Returns:
integer timestamp Timestamp of last modification public

Definition at line 475 of file file.php.

References exists(), and pwd().

File::md5 ( maxsize = 5  ) 

Get md5 Checksum of file with previous check of Filesize

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

Definition at line 352 of file file.php.

References pwd(), and size().

File::name (  ) 

Returns the File name without extension.

Returns:
string The File name without extension. public

Definition at line 318 of file file.php.

References info().

Referenced by info(), pwd(), and safe().

File::offset ( offset = false,
seek = SEEK_SET 
)

Sets or gets the offset for the currently opened file.

Parameters:
mixed $offset The $offset in bytes to seek. If set to false then the current offset is returned.
integer $seek PHP 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 194 of file file.php.

References open().

File::open ( mode = 'r',
force = false 
)

Opens the current file with a given $mode

Parameters:
string $mode A valid 'fopen' mode string (r|w|a ...)
boolean $force If 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 136 of file file.php.

References create(), exists(), and pwd().

Referenced by offset(), read(), and write().

File::owner (  ) 

Returns the File's owner.

Returns:
integer the Fileowner

Definition at line 439 of file file.php.

References exists(), and pwd().

File::perms (  ) 

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

Returns:
string Permissions for the file public

Definition at line 388 of file file.php.

References exists(), and pwd().

File::prepare ( data,
forceWindows = false 
)

Prepares a ascii string for writing fixes line endings

Parameters:
string $data Data to prepare for writing.
Returns:
string public

Definition at line 212 of file file.php.

File::pwd (  ) 

Returns the full path of the File.

Returns:
string Full path to file public

Definition at line 369 of file file.php.

References name().

Referenced by create(), delete(), executable(), exists(), group(), info(), lastAccess(), lastChange(), md5(), open(), owner(), perms(), read(), readable(), size(), and writable().

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

Return the contents of this File as a string.

Parameters:
string $bytes where to start
string $mode
boolean $force If 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 161 of file file.php.

References open(), and pwd().

File::readable (  ) 

Returns true if the File is readable.

Returns:
boolean true if file is readable, false otherwise public

Definition at line 431 of file file.php.

References pwd().

File::safe ( name = null,
ext = null 
)

makes filename safe for saving

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

Definition at line 336 of file file.php.

References $name, ext(), and name().

File::size (  ) 

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

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

Definition at line 401 of file file.php.

References exists(), and pwd().

Referenced by md5().

File::writable (  ) 

Returns true if the File is writable.

Returns:
boolean true if its writable, false otherwise public

Definition at line 413 of file file.php.

References pwd().

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

Write given data to this File.

Parameters:
string $data Data to write to this File.
string $mode Mode of writing. See fwrite().
string $force force the file to open
Returns:
boolean Success public

Definition at line 229 of file file.php.

References open().

Referenced by append().


Member Data Documentation

File::$Folder = null

Definition at line 51 of file file.php.

File::$handle = null

Definition at line 72 of file file.php.

File::$info = array()

Definition at line 65 of file file.php.

File::$lock = null

Definition at line 79 of file file.php.

File::$name = null

Definition at line 58 of file file.php.

Referenced by safe().


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