API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsFileHandler Class Reference

Public Member Functions

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

Data Fields

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

Constructor & Destructor Documentation

◆ __construct()

__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 @access private
Here is the call graph for this function:

◆ __destruct()

__destruct ( )

Closes the current file if it is opened

@access private

Here is the call graph for this function:

Member Function Documentation

◆ append()

append (   $data,
  $force = false 
)

Append given data string to this File.

Parameters
string$dataData to write
bool | string$forceforce the file to open
Returns
boolean Success @access public

◆ close()

close ( )

Closes the current file if it is opened.

Returns
boolean True if closing was successful or file was already closed, otherwise false @access public
Here is the caller graph for this function:

◆ create()

create ( )

Creates the File.

Returns
boolean Success @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete()

delete ( )

Deletes the File.

Returns
boolean Success @access public
Here is the call graph for this function:

◆ executable()

executable ( )

Returns true if the File is executable.

Returns
boolean true if its executable, false otherwise @access public
Here is the call graph for this function:

◆ exists()

exists ( )

Returns true if the File exists.

Returns
boolean true if it exists, false otherwise @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ext()

ext ( )

Returns the File extension.

Returns
string|false The File extension @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ folder()

& folder ( )

Returns the current folder.

Returns
Folder Current folder @access public
Here is the caller graph for this function:

◆ group()

group ( )

Returns the File group.

Returns
integer|false the Filegroup @access public
Here is the call graph for this function:

◆ info()

info ( )

Returns the File extension.

Returns
string The File extension @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lastAccess()

lastAccess ( )

Returns last access time.

Returns
integer|false timestamp Timestamp of last access time @access public
Here is the call graph for this function:

◆ lastChange()

lastChange ( )

Returns last modified time.

Returns
integer|false timestamp Timestamp of last modification @access public
Here is the call graph for this function:

◆ md5()

md5 (   $maxsize = 5)

Get md5 Checksum of file with previous check of Filesize

Parameters
mixed$maxsizein MB or true to force
Returns
string|false md5 Checksum See md5_file() @access public
Here is the call graph for this function:

◆ name()

name ( )

Returns the File name without extension.

Returns
string|false The File name without extension. @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ offset()

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) @access public
Here is the call graph for this function:

◆ open()

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 @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ owner()

owner ( )

Returns the File's owner.

Returns
integer|false the Fileowner
Here is the call graph for this function:

◆ perms()

perms ( )

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

Returns
string|false Permissions for the file @access public
Here is the call graph for this function:

◆ prepare()

prepare (   $data)

Prepares a ascii string for writing fixes line endings

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

◆ pwd()

pwd ( )

Returns the full path of the File.

Returns
string Full path to file @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

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

Return the contents of this File as a string.

Parameters
bool | string | int$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 @access public
Here is the call graph for this function:

◆ readable()

readable ( )

Returns true if the File is readable.

Returns
boolean true if file is readable, false otherwise @access public
Here is the call graph for this function:

◆ safe()

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
null | string$ext
Returns
string $ext the extension of the file @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

size ( )

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

Returns
string|false |int filesize as int or as a human-readable string @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writable()

writable ( )

Returns true if the File is writable.

Returns
boolean true if its writable, false otherwise @access public
Here is the call graph for this function:

◆ write()

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().
bool | string$forceforce the file to open
Returns
boolean Success @access public

Field Documentation

◆ $folder

◆ $handle

$handle

◆ $info

$info = array()

◆ $lock

$lock

◆ $name

$name

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