public function open($path, $mode, $options, &$openedPathAndFilename)
{
// w, a or x should try to create the file
// x should fail if file exists - fopen handles that below!
if (strpos($mode, 'w') !== false || strpos($mode, 'a') !== false || strpos($mode, 'x') !== false) {
$resourceUriOrStream = $this->evaluateResourcePath($path, false);
} else {
$resourceUriOrStream = $this->evaluateResourcePath($path);
}
if (is_resource($resourceUriOrStream)) {
$this->handle = $resourceUriOrStream;
return true;
}
$handle = $resourceUriOrStream !== false ? fopen($resourceUriOrStream, $mode) : false;
if ($handle !== false) {
$this->handle = $handle;
$openedPathAndFilename = $resourceUriOrStream;
return true;
}
return false;
}