Back to BufferStreamHandler class

Method stream_open

public bool
stream_open
(mixed $path, mixed $mode, mixed $options, mixed &$openedPath)
Function to open file or url
Parameters
  • string $path The URL that was passed
  • string $mode Mode used to open the file @see fopen
  • int $options Flags used by the API, may be STREAM_USE_PATH and STREAM_REPORT_ERRORS
  • string & $openedPath Full path of the resource. Used with STREAM_USE_PATH option
Returns
  • bool
Since
  • 1.7.0
-
  • \Joomla\CMS\Utility\streamWrapper::stream_open

Method stream_open - Source code

/**
 * Function to open file or url
 *
 * @param   string   $path         The URL that was passed
 * @param   string   $mode         Mode used to open the file @see fopen
 * @param   integer  $options      Flags used by the API, may be STREAM_USE_PATH and
 *                                 STREAM_REPORT_ERRORS
 * @param   string   &$openedPath  Full path of the resource. Used with STREAM_USE_PATH option
 *
 * @return  boolean
 *
 * @since   1.7.0
 * @see     streamWrapper::stream_open
 */
public function stream_open($path, $mode, $options, &$openedPath)
{
    $url = parse_url($path);
    $this->name = $url['host'];
    $this->buffers[$this->name] = null;
    $this->position = 0;
    return true;
}