FINAL
A user space stream wrapper for reading and writing to Google Cloud Storage.
See: http://www.php.net/manual/en/class.streamwrapper.php
Allowed stream_context options. "anonymous": Boolean, if set then OAuth tokens will not be generated. "acl": The ACL to apply when creating an object. "Content-Type": The content type of the object being written.
Constants
STREAM_OPEN_FOR_INCLUDE
Properties
$context
$context :
Type
Methods
__construct
__construct()
Constructs a new stream wrapper.
__destruct
__destruct()
Destructs an existing stream wrapper.
dir_closedir
dir_closedir()
Close an open directory handle.
dir_opendir
dir_opendir( $path, $options)
Open a directory handle.
Parameters
Name | Description |
---|---|
|
|
|
dir_readdir
dir_readdir() : string
Read entry from the directory handle.
Returns
string
representing the next filename, of false if there is no next file.
dir_rewinddir
dir_rewinddir() : boolean
Reset the output returned from dir_readdir.
Returns
boolean
true if the stream can be rewound, false otherwise.
mkdir
mkdir( $path, $mode, $options)
Parameters
Name | Description |
---|---|
|
|
|
|
|
rmdir
rmdir( $path, $options)
Parameters
Name | Description |
---|---|
|
|
|
rename
rename( $from, $to) : TRUE
Rename a cloud storage object.
Parameters
Name | Description |
---|---|
|
|
|
Returns
TRUE
if the object was renamed, FALSE otherwise
stream_cast
stream_cast()
Retrieve the underlaying resource of the stream, called in response to stream_select().
As GS streams have no underlying resource, we can only return false
stream_close
stream_close()
All resources that were locked, or allocated, by the wrapper should be released.
No value is returned.
stream_eof
stream_eof() : TRUE
Tests for end-of-file on a file pointer.
Returns
TRUE
if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise
stream_flush
stream_flush() : TRUE
Flushes the output.
Returns
TRUE
if the cached data was successfully stored (or if there was no data to store), or FALSE if the data could not be stored.
stream_metadata
stream_metadata( $path, $option, $value)
Parameters
Name | Description |
---|---|
|
|
|
|
|
stream_lock
stream_lock( $operation)
Parameters
Name | Description |
---|---|
|
stream_open
stream_open( $path, $mode, $options, $opened_path)
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
|
stream_read
stream_read( $count)
Read from a stream, return string of bytes.
Parameters
Name | Description |
---|---|
|
stream_seek
stream_seek( $offset, $whence)
Parameters
Name | Description |
---|---|
|
|
|
stream_set_option
stream_set_option( $option, $arg1, $arg2)
Parameters
Name | Description |
---|---|
|
|
|
|
|
stream_stat
stream_stat()
stream_tell
stream_tell()
stream_write
stream_write( $data)
Return the number of bytes written.
Parameters
Name | Description |
---|---|
|
unlink
unlink( $path)
Deletes a file. Called in response to unlink($filename).
Parameters
Name | Description |
---|---|
|
url_stat
url_stat( $path, $flags)
Parameters
Name | Description |
---|---|
|
|
|
getMetaData
getMetaData()
getContentType
getContentType()