=') && version_compare(PHP_VERSION,'5.1','<')) * { * $eof = !$eof; * } * * @return boolean true if the read/write position is at the end of the stream and no more data availible, false otherwise */ function stream_eof ( ); /** * This method is called in response to ftell() calls on the stream. * * @return integer current read/write position of the stream */ function stream_tell ( ); /** * This method is called in response to fseek() calls on the stream. * * You should update the read/write position of the stream according to offset and whence. * See fseek() for more information about these parameters. * * @param integer $offset * @param integer $whence SEEK_SET - Set position equal to offset bytes * SEEK_CUR - Set position to current location plus offset. * SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) * @return boolean TRUE if the position was updated, FALSE otherwise. */ function stream_seek ( $offset, $whence ); /** * This method is called in response to fflush() calls on the stream. * * If you have cached data in your stream but not yet stored it into the underlying storage, you should do so now. * * @return booelan 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. */ function stream_flush ( ); /** * This method is called in response to fstat() calls on the stream. * * If you plan to use your wrapper in a require_once you need to define stream_stat(). * If you plan to allow any other tests like is_file()/is_dir(), you have to define url_stat(). * stream_stat() must define the size of the file, or it will never be included. * url_stat() must define mode, or is_file()/is_dir()/is_executable(), and any of those functions affected by clearstatcache() simply won't work. * It's not documented, but directories must be a mode like 040777 (octal), and files a mode like 0100666. * If you wish the file to be executable, use 7s instead of 6s. * The last 3 digits are exactly the same thing as what you pass to chmod. * 040000 defines a directory, and 0100000 defines a file. * * @return array containing the same values as appropriate for the stream. */ function stream_stat ( ); /** * This method is called in response to unlink() calls on URL paths associated with the wrapper. * * It should attempt to delete the item specified by path. * In order for the appropriate error message to be returned, do not define this method if your wrapper does not support unlinking! * * @param string $path * @return boolean TRUE on success or FALSE on failure */ static function unlink ( $path ); /** * This method is called in response to rename() calls on URL paths associated with the wrapper. * * It should attempt to rename the item specified by path_from to the specification given by path_to. * In order for the appropriate error message to be returned, do not define this method if your wrapper does not support renaming. * * @param string $path_from * @param string $path_to * @return boolean TRUE on success or FALSE on failure */ function rename ( $path_from, $path_to ); /** * This method is called in response to mkdir() calls on URL paths associated with the wrapper. * * It should attempt to create the directory specified by path. * In order for the appropriate error message to be returned, do not define this method if your wrapper does not support creating directories. * * @param string $path * @param int $mode * @param int $options Posible values include STREAM_REPORT_ERRORS and STREAM_MKDIR_RECURSIVE * @return boolean TRUE on success or FALSE on failure */ function mkdir ( $path, $mode, $options ); /** * This method is called in response to rmdir() calls on URL paths associated with the wrapper. * * It should attempt to remove the directory specified by path. * In order for the appropriate error message to be returned, do not define this method if your wrapper does not support removing directories. * * @param string $path * @param int $options Possible values include STREAM_REPORT_ERRORS. * @return boolean TRUE on success or FALSE on failure. */ function rmdir ( $path, $options ); /** * This method is called immediately when your stream object is created for examining directory contents with opendir(). * * @param string $path URL that was passed to opendir() and that this object is expected to explore. * @return booelan */ function dir_opendir ( $path, $options ); /** * This method is called in response to stat() calls on the URL paths associated with the wrapper. * * It should return as many elements in common with the system function as possible. * Unknown or unavailable values should be set to a rational value (usually 0). * * If you plan to use your wrapper in a require_once you need to define stream_stat(). * If you plan to allow any other tests like is_file()/is_dir(), you have to define url_stat(). * stream_stat() must define the size of the file, or it will never be included. * url_stat() must define mode, or is_file()/is_dir()/is_executable(), and any of those functions affected by clearstatcache() simply won't work. * It's not documented, but directories must be a mode like 040777 (octal), and files a mode like 0100666. * If you wish the file to be executable, use 7s instead of 6s. * The last 3 digits are exactly the same thing as what you pass to chmod. * 040000 defines a directory, and 0100000 defines a file. * * @param string $path * @param int $flags holds additional flags set by the streams API. It can hold one or more of the following values OR'd together: * - STREAM_URL_STAT_LINK For resources with the ability to link to other resource (such as an HTTP Location: forward, * or a filesystem symlink). This flag specified that only information about the link itself should be returned, * not the resource pointed to by the link. * This flag is set in response to calls to lstat(), is_link(), or filetype(). * - STREAM_URL_STAT_QUIET If this flag is set, your wrapper should not raise any errors. If this flag is not set, * you are responsible for reporting errors using the trigger_error() function during stating of the path. * @return array */ function url_stat ( $path, $flags ); /** * This method is called in response to readdir(). * * It should return a string representing the next filename in the location opened by dir_opendir(). * * @return string */ function dir_readdir ( ); /** * This method is called in response to rewinddir(). * * It should reset the output generated by dir_readdir(). i.e.: * The next call to dir_readdir() should return the first entry in the location returned by dir_opendir(). * * @return boolean */ function dir_rewinddir ( ); /** * This method is called in response to closedir(). * * You should release any resources which were locked or allocated during the opening and use of the directory stream. * * @return boolean */ function dir_closedir ( ); }