Joomla CMS
2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
__construct ($writeprefix= '', $readprefix= '', $context=array()) | |
__destruct () | |
open ($filename, $mode= 'r', $use_include_path=false, $context=null, $use_prefix=false, $relative=false, $detectprocessingmode=false) | |
close () | |
eof () | |
filesize () | |
gets ($length=0) | |
read ($length=0) | |
seek ($offset, $whence=SEEK_SET) | |
tell () | |
write (&$string, $length=0, $chunk=0) | |
chmod ($filename= '', $mode=0) | |
get_meta_data () | |
_buildContext () | |
setContextOptions ($context) | |
addContextEntry ($wrapper, $name, $value) | |
deleteContextEntry ($wrapper, $name) | |
applyContextToStream () | |
appendFilter ($filtername, $read_write=STREAM_FILTER_READ, $params=array()) | |
prependFilter ($filtername, $read_write=STREAM_FILTER_READ, $params=array()) | |
removeFilter (&$resource, $byindex=false) | |
copy ($src, $dest, $context=null, $use_prefix=true, $relative=false) | |
move ($src, $dest, $context=null, $use_prefix=true, $relative=false) | |
delete ($filename, $context=null, $use_prefix=true, $relative=false) | |
upload ($src, $dest, $context=null, $use_prefix=true, $relative=false) | |
writeFile ($filename, &$buffer) | |
_getFilename ($filename, $mode, $use_prefix, $relative) | |
getFileHandle () | |
Fonctions membres publiques inherited from JObject | |
__construct ($properties=null) | |
__toString () | |
def ($property, $default=null) | |
get ($property, $default=null) | |
getProperties ($public=true) | |
getError ($i=null, $toString=true) | |
getErrors () | |
set ($property, $value=null) | |
setProperties ($properties) | |
setError ($error) | |
toString () |
Attributs protégés | |
$filemode = 0644 | |
$dirmode = 0755 | |
$chunksize = 8192 | |
$filename | |
$writeprefix | |
$readprefix | |
$processingmethod = 'f' | |
$filters = array() | |
$_fh | |
$_filesize | |
$_context = null | |
$_contextOptions | |
$_openmode | |
Attributs protégés inherited from JObject | |
$_errors = array() |
JStream::__construct | ( | $writeprefix = '' , |
|
$readprefix = '' , |
|||
$context = array() |
|||
) |
Constructor
string | $writeprefix | Prefix of the stream (optional). Unlike the JPATH_*, this has a final path separator! |
string | $readprefix | The read prefix (optional). |
array | $context | The context options (optional). |
JStream::__destruct | ( | ) |
Destructor
JStream::_buildContext | ( | ) |
JStream::_getFilename | ( | $filename, | |
$mode, | |||
$use_prefix, | |||
$relative | |||
) |
Determine the appropriate 'filename' of a file
string | $filename | Original filename of the file |
string | $mode | Mode string to retrieve the filename |
boolean | $use_prefix | Controls the use of a prefix |
boolean | $relative | Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. |
Références $mode, JFilesystemHelper\getWriteModes(), et JPATH_ROOT.
JStream::addContextEntry | ( | $wrapper, | |
$name, | |||
$value | |||
) |
Adds a particular options to the context
string | $wrapper | The wrapper to use |
string | $name | The option to set |
string | $value | The value of the option |
Références $name.
JStream::appendFilter | ( | $filtername, | |
$read_write = STREAM_FILTER_READ , |
|||
$params = array() |
|||
) |
Stream filters Append a filter to the chain
string | $filtername | The key name of the filter. |
integer | $read_write | Optional. Defaults to STREAM_FILTER_READ. |
array | $params | An array of params for the stream_filter_append call. |
Références $params.
JStream::applyContextToStream | ( | ) |
Applies the current context to the stream
Use this to change the values of the context after you've opened a stream
JStream::chmod | ( | $filename = '' , |
|
$mode = 0 |
|||
) |
Chmod wrapper
string | $filename | File name. |
mixed | $mode | Mode to use. |
Références $mode, JText\_(), et JFilesystemHelper\ftpChmod().
JStream::close | ( | ) |
Copy a file from src to dest
string | $src | The file path to copy from. |
string | $dest | The file path to copy to. |
resource | $context | A valid context resource (optional) created with stream_context_create. |
boolean | $use_prefix | Controls the use of a prefix (optional). |
boolean | $relative | Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. |
Références elseif, et JText\sprintf().
Delete a file
string | $filename | The file path to delete. |
resource | $context | A valid context resource (optional) created with stream_context_create. |
boolean | $use_prefix | Controls the use of a prefix (optional). |
boolean | $relative | Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. |
Références elseif.
JStream::deleteContextEntry | ( | $wrapper, | |
$name | |||
) |
Deletes a particular setting from a context
string | $wrapper | The wrapper to use |
string | $name | The option to unset |
Références $name.
JStream::eof | ( | ) |
Work out if we're at the end of the file for a stream
Références JText\_().
JStream::filesize | ( | ) |
Retrieve the file size of the path
Références JText\_(), et JFilesystemHelper\remotefsize().
JStream::get_meta_data | ( | ) |
Get the stream metadata
Références JText\_().
JStream::getFileHandle | ( | ) |
Return the internal file handle
JStream::gets | ( | $length = 0 | ) |
Get a line from the stream source.
integer | $length | The number of bytes (optional) to read. |
Références JText\_().
Moves a file
string | $src | The file path to move from. |
string | $dest | The file path to move to. |
resource | $context | A valid context resource (optional) created with stream_context_create. |
boolean | $use_prefix | Controls the use of a prefix (optional). |
boolean | $relative | Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. |
Références elseif.
JStream::open | ( | $filename, | |
$mode = 'r' , |
|||
$use_include_path = false , |
|||
$context = null , |
|||
$use_prefix = false , |
|||
$relative = false , |
|||
$detectprocessingmode = false |
|||
) |
Generic File Operations
Open a stream with some lazy loading smarts
string | $filename | Filename |
string | $mode | Mode string to use |
boolean | $use_include_path | Use the PHP include path |
resource | $context | Context to use when opening |
boolean | $use_prefix | Use a prefix to open the file |
boolean | $relative | Filename is a relative path (if false, strips JPATH_ROOT to make it relative) |
boolean | $detectprocessingmode | Detect the processing method for the file and use the appropriate function to handle output automatically |
Références $mode, $url, JText\_(), elseif, JFile\getExt(), et JFilesystemHelper\isJoomlaStream().
Référencé par JLanguage\parse().
JStream::prependFilter | ( | $filtername, | |
$read_write = STREAM_FILTER_READ , |
|||
$params = array() |
|||
) |
Prepend a filter to the chain
string | $filtername | The key name of the filter. |
integer | $read_write | Optional. Defaults to STREAM_FILTER_READ. |
array | $params | An array of params for the stream_filter_prepend call. |
Références $params.
JStream::read | ( | $length = 0 | ) |
Read a file
Handles user space streams appropriately otherwise any read will return 8192
integer | $length | Length of data to read |
Références JText\_().
JStream::removeFilter | ( | & | $resource, |
$byindex = false |
|||
) |
Remove a filter, either by resource (handed out from the append or prepend function) or via getting the filter list)
resource | &$resource | The resource. |
boolean | $byindex | The index of the filter. |
JStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek the file
Note: the return value is different to that of fseek
integer | $offset | Offset to use when seeking. |
integer | $whence | Seek mode to use. |
Références JText\_().
JStream::setContextOptions | ( | $context | ) |
Updates the context to the array
Format is the same as the options for stream_context_create
array | $context | Options to create the context with |
JStream::tell | ( | ) |
Returns the current position of the file read/write pointer.
Références JText\_().
Upload a file
string | $src | The file path to copy from (usually a temp folder). |
string | $dest | The file path to copy to. |
resource | $context | A valid context resource (optional) created with stream_context_create. |
boolean | $use_prefix | Controls the use of a prefix (optional). |
boolean | $relative | Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. |
Références JText\_().
JStream::write | ( | & | $string, |
$length = 0 , |
|||
$chunk = 0 |
|||
) |
File write
Whilst this function accepts a reference, the underlying fwrite will do a copy! This will roughly double the memory allocation for any write you do. Specifying chunked will get around this by only writing in specific chunk sizes. This defaults to 8192 which is a sane number to use most of the time (change the default with JStream::set('chunksize', newsize);) Note: This doesn't support gzip/bzip2 writing like reading does
string | &$string | Reference to the string to write. |
integer | $length | Length of the string to write. |
integer | $chunk | Size of chunks to write in. |
Références JText\_(), et elseif.
JStream::writeFile | ( | $filename, | |
& | $buffer | ||
) |
Writes a chunk of data to a file.
string | $filename | The file name. |
string | &$buffer | The data to write to the file. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |