[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/filesystem/src/ -> Stream.php (summary)

Part of the Joomla Framework Filesystem Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 1790 lines (38 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Stream:: (31 methods):
  __construct()
  __destruct()
  getStream()
  open()
  close()
  eof()
  filesize()
  gets()
  read()
  seek()
  tell()
  write()
  chmod()
  get_meta_data()
  _buildContext()
  setContextOptions()
  addContextEntry()
  deleteContextEntry()
  applyContextToStream()
  appendFilter()
  prependFilter()
  removeFilter()
  copy()
  move()
  delete()
  upload()
  writeFile()
  _getFilename()
  getFileHandle()
  set()
  get()


Class: Stream  - X-Ref

Joomla! Stream Interface

The Joomla! stream interface is designed to handle files as streams
where as the legacy JFile static class treated files in a rather
atomic manner.

This class adheres to the stream wrapper operations:

__construct($writeprefix = '', $readprefix = '', $context = [])   X-Ref
Constructor

param: string  $writeprefix  Prefix of the stream (optional). Unlike the JPATH_*, this has a final path separator!
param: string  $readprefix   The read prefix (optional).
param: array   $context      The context options (optional).

__destruct()   X-Ref
Destructor


getStream($usePrefix = true, $ua = null, $uamask = false)   X-Ref
Creates a new stream object with appropriate prefix

param: boolean  $usePrefix  Prefix the connections for writing
param: string   $ua         UA User agent to use
param: boolean  $uamask     User agent masking (prefix Mozilla)
return: Stream

open($filename, $mode = 'r', $useIncludePath = false, $context = null, $usePrefix = false, $relative = false,$detectprocessingmode = false)   X-Ref
Generic File Operations

Open a stream with some lazy loading smarts

param: string    $filename              Filename
param: string    $mode                  Mode string to use
param: boolean   $useIncludePath        Use the PHP include path
param: resource  $context               Context to use when opening
param: boolean   $usePrefix             Use a prefix to open the file
param: boolean   $relative              Filename is a relative path (if false, strips JPATH_ROOT to make it relative)
param: boolean   $detectprocessingmode  Detect the processing method for the file and use the appropriate function
return: boolean

close()   X-Ref
No description

eof()   X-Ref
No description

filesize()   X-Ref
No description

gets($length = 0)   X-Ref
No description

read($length = 0)   X-Ref
No description

seek($offset, $whence = \SEEK_SET)   X-Ref
No description

tell()   X-Ref
No description

write(&$string, $length = 0, $chunk = 0)   X-Ref
No description

chmod($filename = '', $mode = 0)   X-Ref
No description

get_meta_data()   X-Ref
No description

_buildContext()   X-Ref
Stream contexts
Builds the context from the array

return: void

setContextOptions($context)   X-Ref
Updates the context to the array

Format is the same as the options for stream_context_create

param: array  $context  Options to create the context with
return: void

addContextEntry($wrapper, $name, $value)   X-Ref
Adds a particular options to the context

param: string  $wrapper  The wrapper to use
param: string  $name     The option to set
param: string  $value    The value of the option
return: void

deleteContextEntry($wrapper, $name)   X-Ref
Deletes a particular setting from a context

param: string  $wrapper  The wrapper to use
param: string  $name     The option to unset
return: void

applyContextToStream()   X-Ref
Applies the current context to the stream

Use this to change the values of the context after you've opened a stream

return: boolean

appendFilter($filtername, $readWrite = \STREAM_FILTER_READ, $params = [])   X-Ref
No description

prependFilter($filtername, $readWrite = \STREAM_FILTER_READ, $params = [])   X-Ref
No description

removeFilter(&$resource, $byindex = false)   X-Ref
No description

copy($src, $dest, $context = null, $usePrefix = true, $relative = false)   X-Ref
No description

move($src, $dest, $context = null, $usePrefix = true, $relative = false)   X-Ref
No description

delete($filename, $context = null, $usePrefix = true, $relative = false)   X-Ref
No description

upload($src, $dest, $context = null, $usePrefix = true, $relative = false)   X-Ref
No description

writeFile($filename, &$buffer, $appendToFile = false)   X-Ref
Writes a chunk of data to a file.

param: string   $filename      The file name.
param: string   $buffer        The data to write to the file.
param: boolean  $appendToFile  Append to the file and not overwrite it.
return: boolean

_getFilename($filename, $mode, $usePrefix, $relative)   X-Ref
Determine the appropriate 'filename' of a file

param: string   $filename   Original filename of the file
param: string   $mode       Mode string to retrieve the filename
param: boolean  $usePrefix  Controls the use of a prefix
param: boolean  $relative   Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped.
return: string

getFileHandle()   X-Ref
Return the internal file handle

return: File handler

set($property, $value = null)   X-Ref
Modifies a property of the object, creating it if it does not already exist.

param: string  $property  The name of the property.
param: mixed   $value     The value of the property to set.
return: mixed  Previous value of the property.

get($property, $default = null)   X-Ref
Returns a property of the object or the default value if the property is not set.

param: string  $property  The name of the property.
param: mixed   $default   The default value.
return: mixed    The value of the property.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer