"Sara Golemon" <[EMAIL PROTECTED]> wrote: > http:// wrapper: > is_writable() would always return false. > is_readable() would return true *IF* a HEAD request returned 2xx or 3xx > is_executable() would always return false. > file_exists() would return true if a HEAD request returned 2xx, 3xx, or > 4xx (not including 404) > sb values such as mtime, size, etc... would be parsable from the > http-response headers, while ctime, atime, inode, uid, gid would be > unknown and default to 0 (or maybe -1)
Just for a proposal, I made a table of the expected return values of is_*able() family. But this will be under a drastically change if we provide native WebDAV support. 200 OK 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content "r--" (in "rwx" format) 300 Multiple Choices Depending on the status of the resource referred to by a URI given in the "Location" header of the previous session. (false if "Location" is not proposed by the server) 301 Moved Permanently 302 Found 303 See Other Depending on the status of the resource redirected to 304 Not Modified "r--" 305 Use Proxy Depending on the status of a subsequent HTTP session which will take place between the agent and the proxy server. This seems irrelevant though. 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 408 Request Timeout 410 Gone 412 Precondition Failed 414 Request-URI Too Long 415 Unsupported Media Type "---" 406 Not Acceptable "r--"; is_readable() should return true because the resource must exist as this status implys. 409 Conflict "---"; however it may return true if this is a result of temporary rw-locking failure. 411 Length Required 416 Requested Range Not Satisfiable "r--" because the resource is actually readable. Following read operations is likely to fail. 500 Internal Server Error 501 Not Implemented 503 Service Unavailable 505 HTTP Version Not Supported "---" I'm under the impression it'd be even better if we can other kinds of metadata such as MIME type with the single stat interface. > ftp:// wrapper: > is_executable() would always return false Since is_executable() can be applied on directories, we have to first check if the given path name specifies a directory or a normal file by a "SIZE" request. > file_exists() would return true if SIZE <file> returned 2xx > sb_size would be fetchable from SIZE <file>, however all other values > are not reliable on all platforms and would have to return 0. As "SIZE" cannot be used on directories (which should result in 550), a single "RNFR" (rename file from) request could make more sense here. Moriyoshi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php