Back to StreamString class

Method stream_open

public bool
stream_open
(mixed $path, mixed $mode, mixed $options, mixed &$openedPath)
Method to open a file or URL.
Parameters
  • string $path The stream path.
  • string $mode Not used.
  • int $options Not used.
  • string $openedPath Not used.
Returns
  • bool
Since
  • 1.7.0
Class: StreamString
Project: Joomla

Method stream_open - Source code

/**
 * Method to open a file or URL.
 *
 * @param   string   $path        The stream path.
 * @param   string   $mode        Not used.
 * @param   integer  $options     Not used.
 * @param   string   $openedPath  Not used.
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function stream_open($path, $mode, $options, &$openedPath)
{
    $this->currentString =& StringController::getRef(str_replace('string://', '', $path));
    if ($this->currentString) {
        $this->len = \strlen($this->currentString);
        $this->pos = 0;
        $this->stat = $this->url_stat($path, 0);
        return true;
    } else {
        return false;
    }
}