Chris@0: handle, $operation); Chris@0: } Chris@0: Chris@0: return TRUE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for fwrite(), file_put_contents() etc. Chris@0: * Chris@0: * Data will not be written as this is a read-only stream wrapper. Chris@0: * Chris@0: * @param string $data Chris@0: * The string to be written. Chris@0: * Chris@0: * @return bool Chris@0: * FALSE as data will not be written. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.stream-write.php Chris@0: */ Chris@0: public function stream_write($data) { Chris@0: trigger_error('stream_write() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for fflush(). Chris@0: * Chris@0: * Nothing will be output to the file, as this is a read-only stream wrapper. Chris@0: * However as stream_flush is called during stream_close we should not trigger Chris@0: * an error. Chris@0: * Chris@0: * @return bool Chris@0: * FALSE, as no data will be stored. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.stream-flush.php Chris@0: */ Chris@0: public function stream_flush() { Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: * Chris@0: * Does not change meta data as this is a read-only stream wrapper. Chris@0: */ Chris@0: public function stream_metadata($uri, $option, $value) { Chris@0: trigger_error('stream_metadata() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function stream_truncate($new_size) { Chris@0: trigger_error('stream_truncate() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for unlink(). Chris@0: * Chris@0: * The file will not be deleted from the stream as this is a read-only stream Chris@0: * wrapper. Chris@0: * Chris@0: * @param string $uri Chris@0: * A string containing the uri to the resource to delete. Chris@0: * Chris@0: * @return bool Chris@0: * TRUE so that file_delete() will remove db reference to file. File is not Chris@0: * actually deleted. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.unlink.php Chris@0: */ Chris@0: public function unlink($uri) { Chris@0: trigger_error('unlink() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return TRUE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for rename(). Chris@0: * Chris@0: * The file will not be renamed as this is a read-only stream wrapper. Chris@0: * Chris@0: * @param string $from_uri Chris@0: * The uri to the file to rename. Chris@0: * @param string $to_uri Chris@0: * The new uri for file. Chris@0: * Chris@0: * @return bool Chris@0: * FALSE as file will never be renamed. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.rename.php Chris@0: */ Chris@0: public function rename($from_uri, $to_uri) { Chris@0: trigger_error('rename() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for mkdir(). Chris@0: * Chris@0: * Directory will never be created as this is a read-only stream wrapper. Chris@0: * Chris@0: * @param string $uri Chris@0: * A string containing the URI to the directory to create. Chris@0: * @param int $mode Chris@0: * Permission flags - see mkdir(). Chris@0: * @param int $options Chris@0: * A bit mask of STREAM_REPORT_ERRORS and STREAM_MKDIR_RECURSIVE. Chris@0: * Chris@0: * @return bool Chris@0: * FALSE as directory will never be created. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.mkdir.php Chris@0: */ Chris@0: public function mkdir($uri, $mode, $options) { Chris@0: trigger_error('mkdir() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Support for rmdir(). Chris@0: * Chris@0: * Directory will never be deleted as this is a read-only stream wrapper. Chris@0: * Chris@0: * @param string $uri Chris@0: * A string containing the URI to the directory to delete. Chris@0: * @param int $options Chris@0: * A bit mask of STREAM_REPORT_ERRORS. Chris@0: * Chris@0: * @return bool Chris@0: * FALSE as directory will never be deleted. Chris@0: * Chris@0: * @see http://php.net/manual/streamwrapper.rmdir.php Chris@0: */ Chris@0: public function rmdir($uri, $options) { Chris@0: trigger_error('rmdir() not supported for read-only stream wrappers', E_USER_WARNING); Chris@0: return FALSE; Chris@0: } Chris@0: Chris@0: }