implement SplFileObject
This diff started off with trying to actually build `SplFileObject` since it was just stubbed out. But then I had to implement everything that extended from it since C++ classes can't extend PHP classes. And then it ballooend into what you see here. I actually think this is better in the long run, so that's why I kept going down this road. The only thing that doesn't work in pure PHP is `sscanf`. @mwilliams has a fix for that. We need variable args by reference. I implemented `RecursiveIteratorIterator` in a similar way to our C++ code instead of copying Zend. It translated to PHP a bit nicer. We still don't support the `RecursiveTreeIterator`, but I havn't come accross a need for that yet. I changed the implementation to actually use the `getChildren()` methods instead of peaking inside the `RecursiveDirectoryIterator`.
Esse commit está contido em:
+564
-294
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -584,6 +584,12 @@
|
||||
"type": "String",
|
||||
"value": "\"\\\"\"",
|
||||
"desc": "Set the field enclosure character (one character only)."
|
||||
},
|
||||
{
|
||||
"name": "escape",
|
||||
"type": "String",
|
||||
"value": "\"\\\\\"",
|
||||
"desc": "Set the escape character (one character only)."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2071,4 +2077,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
{
|
||||
"preamble": "",
|
||||
"consts": [
|
||||
],
|
||||
"funcs": [
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator___construct",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Resource"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "iterator",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "mode",
|
||||
"type": "Int64"
|
||||
},
|
||||
{
|
||||
"name": "flags",
|
||||
"type": "Int64"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_getinneriterator",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Resource"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_current",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_key",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_next",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_rewind",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursiveiteratoriterator_valid",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator___construct",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "String"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_key",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_next",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_rewind",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_seek",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "position",
|
||||
"type": "Int64"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_current",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator___tostring",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "String"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_valid",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_directoryiterator_isdot",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator___construct",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "flags",
|
||||
"type": "Int64"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_key",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_next",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_rewind",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_seek",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": null
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
},
|
||||
{
|
||||
"name": "position",
|
||||
"type": "Int64"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_current",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Variant"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator___tostring",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "String"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_valid",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_haschildren",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_getchildren",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "Resource"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_getsubpath",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "String"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hphp_recursivedirectoryiterator_getsubpathname",
|
||||
"flags": [
|
||||
"HasDocComment",
|
||||
"HipHopSpecific"
|
||||
],
|
||||
"return": {
|
||||
"type": "String"
|
||||
},
|
||||
"args": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -570,7 +570,8 @@ static const char *lookup_trailing_spaces(const char *ptr, int len) {
|
||||
}
|
||||
|
||||
Array File::readCSV(int64_t length /* = 0 */, char delimiter_char /* = ',' */,
|
||||
char enclosure_char /* = '"' */) {
|
||||
char enclosure_char /* = '"' */,
|
||||
char escape_char /* = '\\' */) {
|
||||
String line = readLine(length);
|
||||
if (line.empty()) {
|
||||
return Array();
|
||||
@@ -582,7 +583,6 @@ Array File::readCSV(int64_t length /* = 0 */, char delimiter_char /* = ',' */,
|
||||
|
||||
char *temp, *tptr, *line_end, *limit;
|
||||
const char *bptr;
|
||||
const char escape_char = '\\';
|
||||
|
||||
int64_t temp_len, line_end_len;
|
||||
bool first_field = true;
|
||||
|
||||
@@ -151,7 +151,8 @@ public:
|
||||
/**
|
||||
* Read one line of csv record.
|
||||
*/
|
||||
Array readCSV(int64_t length = 0, char delimiter = ',', char enclosure = '"');
|
||||
Array readCSV(int64_t length = 0, char delimiter = ',', char enclosure = '"',
|
||||
char escape = '\\');
|
||||
|
||||
/**
|
||||
* Return the last error we know about
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#include "hphp/runtime/ext/ext_imap.h"
|
||||
#include "hphp/runtime/ext/ext_intl.h"
|
||||
#include "hphp/runtime/ext/ext_ipc.h"
|
||||
#include "hphp/runtime/ext/ext_iterator.h"
|
||||
#include "hphp/runtime/ext/ext_json.h"
|
||||
#include "hphp/runtime/ext/ext_ldap.h"
|
||||
#include "hphp/runtime/ext/ext_magick.h"
|
||||
@@ -78,7 +77,6 @@
|
||||
#include "hphp/runtime/ext/ext_soap.h"
|
||||
#include "hphp/runtime/ext/ext_socket.h"
|
||||
#include "hphp/runtime/ext/ext_spl.h"
|
||||
#include "hphp/runtime/ext/ext_splfile.h"
|
||||
#include "hphp/runtime/ext/ext_sqlite3.h"
|
||||
#include "hphp/runtime/ext/ext_stream.h"
|
||||
#include "hphp/runtime/ext/ext_string.h"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "hphp/runtime/ext/ext_array.h"
|
||||
#include "hphp/runtime/ext/ext_iterator.h"
|
||||
#include "hphp/runtime/ext/ext_function.h"
|
||||
#include "hphp/runtime/ext/ext_continuation.h"
|
||||
#include "hphp/runtime/ext/ext_collections.h"
|
||||
|
||||
@@ -315,9 +315,11 @@ Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */,
|
||||
CStrRef enclosure /* = "\"" */) {
|
||||
if (delimiter.size() != 1) {
|
||||
throw_invalid_argument("delimiter: %s", delimiter.data());
|
||||
return false;
|
||||
}
|
||||
if (enclosure.size() != 1) {
|
||||
throw_invalid_argument("enclosure: %s", enclosure.data());
|
||||
return false;
|
||||
}
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->writeCSV(fields, delimiter.charAt(0), enclosure.charAt(0));
|
||||
@@ -325,15 +327,23 @@ Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */,
|
||||
|
||||
Variant f_fgetcsv(CObjRef handle, int64_t length /* = 0 */,
|
||||
CStrRef delimiter /* = "," */,
|
||||
CStrRef enclosure /* = "\"" */) {
|
||||
CStrRef enclosure /* = "\"" */,
|
||||
CStrRef escape /* = "\\" */) {
|
||||
if (delimiter.size() != 1) {
|
||||
throw_invalid_argument("delimiter: %s", delimiter.data());
|
||||
return false;
|
||||
}
|
||||
if (enclosure.size() != 1) {
|
||||
throw_invalid_argument("enclosure: %s", enclosure.data());
|
||||
return false;
|
||||
}
|
||||
if (escape.size() != 1) {
|
||||
throw_invalid_argument("escape: %s", enclosure.data());
|
||||
return false;
|
||||
}
|
||||
CHECK_HANDLE(handle, f);
|
||||
Array ret = f->readCSV(length, delimiter.charAt(0), enclosure.charAt(0));
|
||||
Array ret = f->readCSV(length, delimiter.charAt(0), enclosure.charAt(0),
|
||||
escape.charAt(0));
|
||||
if (!ret.isNull()) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ bool f_flock(CObjRef handle, int operation, VRefParam wouldblock = uninit_null()
|
||||
Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter = ",",
|
||||
CStrRef enclosure = "\"");
|
||||
Variant f_fgetcsv(CObjRef handle, int64_t length = 0, CStrRef delimiter = ",",
|
||||
CStrRef enclosure = "\"");
|
||||
CStrRef enclosure = "\"", CStrRef escape = "\\");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// file name based file operations
|
||||
|
||||
@@ -1,448 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "hphp/runtime/ext/ext_iterator.h"
|
||||
#include "hphp/runtime/ext/ext_file.h"
|
||||
#include "hphp/runtime/ext/ext_splfile.h"
|
||||
#include "hphp/system/lib/systemlib.h"
|
||||
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IMPLEMENT_OBJECT_ALLOCATION(DirectoryIterator)
|
||||
IMPLEMENT_OBJECT_ALLOCATION(RecursiveDirectoryIterator)
|
||||
IMPLEMENT_OBJECT_ALLOCATION_NO_DEFAULT_SWEEP(RecursiveIteratorIterator)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static strings
|
||||
|
||||
StaticString DirectoryIterator::s_class_name("directoryiterator");
|
||||
StaticString
|
||||
RecursiveDirectoryIterator::s_class_name("recursivedirectoryiterator");
|
||||
StaticString
|
||||
RecursiveIteratorIterator::s_class_name("recursiveiteratoriterator");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// helper
|
||||
|
||||
static RecursiveIteratorIterator *
|
||||
get_recursiveiteratoriterator(CObjRef obj) {
|
||||
if (!obj->instanceof(SystemLib::s_RecursiveIteratorIteratorClass)) {
|
||||
throw InvalidObjectTypeException(obj->o_getClassName().c_str());
|
||||
}
|
||||
CObjRef rsrc = obj->o_get("rsrc", true, "RecursiveIteratorIterator");
|
||||
return rsrc.getTyped<RecursiveIteratorIterator>();
|
||||
}
|
||||
|
||||
static RecursiveDirectoryIterator *
|
||||
get_recursivedirectoryiterator(CObjRef obj) {
|
||||
if (!obj->instanceof(SystemLib::s_RecursiveDirectoryIteratorClass)) {
|
||||
throw InvalidObjectTypeException(obj->o_getClassName().c_str());
|
||||
}
|
||||
// SplFileInfo as context -- rsrc is a private property
|
||||
CObjRef rsrc = obj->o_get("rsrc", true, "SplFileInfo");
|
||||
return rsrc.getTyped<RecursiveDirectoryIterator>();
|
||||
}
|
||||
|
||||
static DirectoryIterator *
|
||||
get_directoryiterator(CObjRef obj) {
|
||||
if (!obj->instanceof(SystemLib::s_DirectoryIteratorClass)) {
|
||||
throw InvalidObjectTypeException(obj->o_getClassName().c_str());
|
||||
}
|
||||
// SplFileInfo as context -- rsrc is a private property
|
||||
CObjRef rsrc = obj->o_get("rsrc", true, "SplFileInfo");
|
||||
return rsrc.getTyped<DirectoryIterator>();
|
||||
}
|
||||
|
||||
DirectoryIterator::DirectoryIterator(CStrRef path) :
|
||||
m_path(path), m_index(0) {
|
||||
Variant dir = f_opendir(m_path);
|
||||
if (!dir.same(false)) {
|
||||
m_dir = dir;
|
||||
m_dirEntry = f_readdir(m_dir);
|
||||
m_fileName = getPathName();
|
||||
}
|
||||
}
|
||||
|
||||
String DirectoryIterator::getPathName() const {
|
||||
if (!m_dirEntry.same(false)) {
|
||||
String path = m_path;
|
||||
if (path.c_str()[path.size()-1] != '/') path += "/";
|
||||
return path + m_dirEntry.toString();
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
void DirectoryIterator::rewind() {
|
||||
if (!m_dir.same(NULL)) {
|
||||
f_rewinddir(m_dir);
|
||||
m_dirEntry = f_readdir(m_dir);
|
||||
m_index = 0;
|
||||
m_fileName = getPathName();
|
||||
}
|
||||
}
|
||||
|
||||
bool DirectoryIterator::valid() {
|
||||
return !m_dirEntry.same(false) && !m_dirEntry.toString().empty();
|
||||
}
|
||||
|
||||
void DirectoryIterator::next() {
|
||||
if (!m_dir.same(NULL)) {
|
||||
m_dirEntry = f_readdir(m_dir);
|
||||
m_index++;
|
||||
m_fileName = getPathName();
|
||||
}
|
||||
}
|
||||
|
||||
bool DirectoryIterator::isdot() {
|
||||
return (m_dirEntry == "." || m_dirEntry == "..");
|
||||
}
|
||||
|
||||
RecursiveDirectoryIterator::RecursiveDirectoryIterator(CStrRef path,
|
||||
int flags) :
|
||||
DirectoryIterator(path), m_flags(flags) {
|
||||
}
|
||||
|
||||
void RecursiveDirectoryIterator::rewind() {
|
||||
DirectoryIterator::rewind();
|
||||
if (isdot()) {
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
void RecursiveDirectoryIterator::next() {
|
||||
do {
|
||||
DirectoryIterator::next();
|
||||
} while (valid() && DirectoryIterator::isdot());
|
||||
}
|
||||
|
||||
RecursiveIteratorIterator::RecursiveIteratorIterator(CObjRef iterator,
|
||||
int mode, int flags) : m_iterator(iterator), m_mode(mode), m_flags(flags) {
|
||||
m_iterators.push_back(std::make_pair(iterator.get(), 0));
|
||||
iterator->incRefCount();
|
||||
}
|
||||
|
||||
void RecursiveIteratorIterator::freeAllIterators() {
|
||||
for (IteratorList::const_iterator it = m_iterators.begin();
|
||||
it != m_iterators.end();
|
||||
++it) {
|
||||
decRefObj(it->first);
|
||||
}
|
||||
m_iterators.clear();
|
||||
}
|
||||
|
||||
void RecursiveIteratorIterator::sweep() {
|
||||
// Don't deref the ObjectData*'s during sweep (they will be
|
||||
// deallocated by the smart allocator, and may already be
|
||||
// deallocated).
|
||||
m_iterators.clear();
|
||||
}
|
||||
|
||||
Object f_hphp_recursiveiteratoriterator___construct(CObjRef obj, CObjRef iterator, int64_t mode, int64_t flags) {
|
||||
if (iterator->instanceof(SystemLib::s_RecursiveDirectoryIteratorClass)) {
|
||||
CVarRef rsrc = iterator->o_get("rsrc", true, "SplFileInfo");
|
||||
obj->o_set("rsrc", NEWOBJ(RecursiveIteratorIterator)(rsrc, mode, flags),
|
||||
"RecursiveIteratorIterator");
|
||||
return obj;
|
||||
}
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
|
||||
Object f_hphp_recursiveiteratoriterator_getinneriterator(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
unsigned int size = rii->m_iterators.size();
|
||||
assert(size > 0);
|
||||
return size == 1 ? Object() : rii->m_iterators[size-1].first;
|
||||
}
|
||||
|
||||
Variant f_hphp_recursiveiteratoriterator_current(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
unsigned int size = rii->m_iterators.size();
|
||||
assert(size > 0);
|
||||
if (rii->m_iterator.is<RecursiveDirectoryIterator>()) {
|
||||
ObjectData* rdi = SystemLib::AllocRecursiveDirectoryIteratorObject();
|
||||
rdi->o_set("rsrc",
|
||||
rii->m_iterators[size-1].first, "SplFileInfo");
|
||||
return f_hphp_recursivedirectoryiterator_current(rdi);
|
||||
}
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
|
||||
Variant f_hphp_recursiveiteratoriterator_key(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
unsigned int size = rii->m_iterators.size();
|
||||
assert(size > 0);
|
||||
if (rii->m_iterator.is<RecursiveDirectoryIterator>()) {
|
||||
ObjectData* rdi = SystemLib::AllocRecursiveDirectoryIteratorObject();
|
||||
rdi->o_set("rsrc",
|
||||
rii->m_iterators[size-1].first, "SplFileInfo");
|
||||
return f_hphp_recursivedirectoryiterator_key(rdi);
|
||||
}
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
|
||||
// TODO Task #2140920: Find a way to avoid hard coding PHP class constants
|
||||
// here and elsewhere in the runtime.
|
||||
|
||||
// Class constants that we use from RecursiveIteratorIterator
|
||||
static const int64_t LEAVES_ONLY = 0L;
|
||||
static const int64_t SELF_FIRST = 1L;
|
||||
static const int64_t CHILD_FIRST = 2L;
|
||||
|
||||
// Class constants that we use from FilesystemIterator
|
||||
static const int64_t CURRENT_AS_PATHNAME = 32L;
|
||||
static const int64_t KEY_AS_FILENAME = 256L;
|
||||
|
||||
void f_hphp_recursiveiteratoriterator_next(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
unsigned int size = rii->m_iterators.size();
|
||||
if (!size) return;
|
||||
Object ci = rii->m_iterators[size-1].first;
|
||||
if (rii->m_mode == SELF_FIRST) {
|
||||
if (!ci.is<RecursiveDirectoryIterator>()) {
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
RecursiveDirectoryIterator *rdi =
|
||||
ci.getTyped<RecursiveDirectoryIterator>();
|
||||
String pathName = rdi->getPathName();
|
||||
if (f_is_dir(pathName) && !rii->m_iterators[size-1].second) {
|
||||
rii->m_iterators[size-1].second = 1;
|
||||
RecursiveDirectoryIterator *ii =
|
||||
NEWOBJ(RecursiveDirectoryIterator)(pathName, rdi->m_flags);
|
||||
rii->m_iterators.push_back(std::make_pair(ii, 0));
|
||||
ii->incRefCount();
|
||||
if (ii->isdot()) ii->next();
|
||||
} else {
|
||||
rdi->next();
|
||||
rii->m_iterators[size-1].second = 0;
|
||||
}
|
||||
if (f_hphp_recursiveiteratoriterator_valid(obj)) return;
|
||||
decRefObj(rii->m_iterators.back().first);
|
||||
rii->m_iterators.pop_back();
|
||||
return f_hphp_recursiveiteratoriterator_next(obj);
|
||||
} else if (rii->m_mode == CHILD_FIRST ||
|
||||
rii->m_mode == LEAVES_ONLY) {
|
||||
if (!ci.is<RecursiveDirectoryIterator>()) {
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
RecursiveDirectoryIterator *rdi =
|
||||
ci.getTyped<RecursiveDirectoryIterator>();
|
||||
String pathName = rdi->getPathName();
|
||||
if (pathName.empty()) {
|
||||
decRefObj(rii->m_iterators.back().first);
|
||||
rii->m_iterators.pop_back();
|
||||
return f_hphp_recursiveiteratoriterator_next(obj);
|
||||
} else if (f_is_dir(pathName)) {
|
||||
if (!rii->m_iterators[size-1].second) {
|
||||
rii->m_iterators[size-1].second = 1;
|
||||
RecursiveDirectoryIterator *ii =
|
||||
NEWOBJ(RecursiveDirectoryIterator)(pathName, rdi->m_flags);
|
||||
rii->m_iterators.push_back(std::make_pair(ii, 0));
|
||||
ii->incRefCount();
|
||||
ii->rewind();
|
||||
if (f_hphp_recursiveiteratoriterator_valid(obj)) return;
|
||||
return f_hphp_recursiveiteratoriterator_next(obj);
|
||||
} else {
|
||||
// CHILD_FIRST: 0 - drill down; 1 - visit 2 - next
|
||||
// LEAVES_ONLY: 0 - drill down; 1 - next
|
||||
if (rii->m_mode == CHILD_FIRST &&
|
||||
rii->m_iterators[size-1].second == 1) {
|
||||
rii->m_iterators[size-1].second = 2;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
rii->m_iterators[size-1].second = 0;
|
||||
rdi->next();
|
||||
if (f_hphp_recursiveiteratoriterator_valid(obj)) return;
|
||||
return f_hphp_recursiveiteratoriterator_next(obj);
|
||||
} else {
|
||||
if (!ci.is<RecursiveDirectoryIterator>()) {
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
RecursiveDirectoryIterator *rdi =
|
||||
ci.getTyped<RecursiveDirectoryIterator>();
|
||||
assert(rii->m_iterators[size-1].second == 0);
|
||||
rdi->next();
|
||||
}
|
||||
}
|
||||
|
||||
void f_hphp_recursiveiteratoriterator_rewind(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
rii->freeAllIterators();
|
||||
rii->m_iterators.push_back(std::make_pair(rii->m_iterator.get(), 0));
|
||||
rii->m_iterator->incRefCount();
|
||||
if (rii->m_iterator.is<RecursiveDirectoryIterator>()) {
|
||||
ObjectData* rdi = SystemLib::AllocRecursiveDirectoryIteratorObject();
|
||||
rdi->o_set("rsrc", rii->m_iterator, "SplFileInfo");
|
||||
f_hphp_recursivedirectoryiterator_rewind(rdi);
|
||||
if (!f_hphp_recursiveiteratoriterator_valid(obj)) {
|
||||
f_hphp_recursiveiteratoriterator_next(obj);
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
|
||||
bool f_hphp_recursiveiteratoriterator_valid(CObjRef obj) {
|
||||
RecursiveIteratorIterator *rii = get_recursiveiteratoriterator(obj);
|
||||
unsigned int size = rii->m_iterators.size();
|
||||
if (!size) return false;
|
||||
Object firstIt = rii->m_iterators[size-1].first;
|
||||
if (firstIt.is<RecursiveDirectoryIterator>()) {
|
||||
RecursiveDirectoryIterator* rdi =
|
||||
firstIt.getTyped<RecursiveDirectoryIterator>();
|
||||
bool valid = rdi->valid();
|
||||
if (valid) {
|
||||
if (rii->m_mode == LEAVES_ONLY ||
|
||||
rii->m_mode == CHILD_FIRST) {
|
||||
String pathName = rdi->getPathName();
|
||||
if (f_is_dir(pathName)) {
|
||||
if (rii->m_iterators[size-1].second > 0 &&
|
||||
rii->m_mode == CHILD_FIRST) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
throw NotImplementedException("this type of iterator");
|
||||
}
|
||||
|
||||
bool f_hphp_directoryiterator___construct(CObjRef obj, CStrRef path) {
|
||||
SmartObject<DirectoryIterator> rsrc = NEWOBJ(DirectoryIterator)(path);
|
||||
obj->o_set("rsrc", rsrc, "SplFileInfo");
|
||||
return !rsrc->m_dir.isNull();
|
||||
}
|
||||
|
||||
Variant f_hphp_directoryiterator_key(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
return di->m_index;
|
||||
}
|
||||
|
||||
void f_hphp_directoryiterator_next(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
di->next();
|
||||
}
|
||||
|
||||
void f_hphp_directoryiterator_rewind(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
di->rewind();
|
||||
}
|
||||
|
||||
void f_hphp_directoryiterator_seek(CObjRef obj, int64_t position) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
for (int i = 0; i < position - di->m_index; i++) {
|
||||
f_hphp_directoryiterator_next(obj);
|
||||
}
|
||||
}
|
||||
|
||||
Variant f_hphp_directoryiterator_current(CObjRef obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
String f_hphp_directoryiterator___tostring(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
return di->m_dirEntry;
|
||||
}
|
||||
|
||||
bool f_hphp_directoryiterator_valid(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
return di->valid();
|
||||
}
|
||||
|
||||
bool f_hphp_directoryiterator_isdot(CObjRef obj) {
|
||||
DirectoryIterator *di = get_directoryiterator(obj);
|
||||
return di->isdot();
|
||||
}
|
||||
|
||||
bool f_hphp_recursivedirectoryiterator___construct(CObjRef obj, CStrRef path,
|
||||
int64_t flags) {
|
||||
SmartObject<RecursiveDirectoryIterator> rsrc =
|
||||
NEWOBJ(RecursiveDirectoryIterator)(path, flags);
|
||||
obj->o_set("rsrc", rsrc, "SplFileInfo");
|
||||
return !rsrc->m_dir.isNull();
|
||||
}
|
||||
|
||||
Variant f_hphp_recursivedirectoryiterator_key(CObjRef obj) {
|
||||
RecursiveDirectoryIterator *rdi = get_recursivedirectoryiterator(obj);
|
||||
if (rdi->m_flags == KEY_AS_FILENAME) {
|
||||
return rdi->m_dirEntry;
|
||||
}
|
||||
return rdi->getPathName();
|
||||
}
|
||||
|
||||
void f_hphp_recursivedirectoryiterator_next(CObjRef obj) {
|
||||
RecursiveDirectoryIterator *rdi = get_recursivedirectoryiterator(obj);
|
||||
rdi->next();
|
||||
}
|
||||
|
||||
void f_hphp_recursivedirectoryiterator_rewind(CObjRef obj) {
|
||||
f_hphp_directoryiterator_rewind(obj);
|
||||
if (f_hphp_directoryiterator_isdot(obj)) {
|
||||
f_hphp_recursivedirectoryiterator_next(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void f_hphp_recursivedirectoryiterator_seek(CObjRef obj, int64_t position) {
|
||||
f_hphp_directoryiterator_seek(obj, position);
|
||||
}
|
||||
|
||||
String f_hphp_recursivedirectoryiterator___tostring(CObjRef obj) {
|
||||
return f_hphp_directoryiterator___tostring(obj);
|
||||
}
|
||||
|
||||
bool f_hphp_recursivedirectoryiterator_valid(CObjRef obj) {
|
||||
return f_hphp_directoryiterator_valid(obj);
|
||||
}
|
||||
|
||||
Variant f_hphp_recursivedirectoryiterator_current(CObjRef obj) {
|
||||
RecursiveDirectoryIterator *rdi = get_recursivedirectoryiterator(obj);
|
||||
String pathName = rdi->getPathName();
|
||||
if (rdi->m_flags & CURRENT_AS_PATHNAME) {
|
||||
return pathName;
|
||||
}
|
||||
return SystemLib::AllocSplFileInfoObject(pathName);
|
||||
}
|
||||
|
||||
bool f_hphp_recursivedirectoryiterator_haschildren(CObjRef obj) {
|
||||
return f_hphp_splfileinfo_isdir(obj);
|
||||
}
|
||||
|
||||
Object f_hphp_recursivedirectoryiterator_getchildren(CObjRef obj) {
|
||||
if (!f_hphp_recursivedirectoryiterator_haschildren(obj)) return Object();
|
||||
RecursiveDirectoryIterator *rdi = get_recursivedirectoryiterator(obj);
|
||||
ObjectData* o_rdi = SystemLib::AllocRecursiveDirectoryIteratorObject();
|
||||
o_rdi->o_set("rsrc",
|
||||
NEWOBJ(RecursiveDirectoryIterator)(rdi->getPathName(),
|
||||
rdi->m_flags),
|
||||
"SplFileInfo");
|
||||
return o_rdi;
|
||||
}
|
||||
|
||||
String f_hphp_recursivedirectoryiterator_getsubpath(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_recursivedirectoryiterator_getsubpathname(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef incl_HPHP_EXT_ITERATOR_H_
|
||||
#define incl_HPHP_EXT_ITERATOR_H_
|
||||
|
||||
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
||||
|
||||
#include "hphp/runtime/base/base_includes.h"
|
||||
#include "hphp/runtime/ext/ext_splfile.h"
|
||||
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class DirectoryIterator: public SplFileInfo {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(DirectoryIterator);
|
||||
|
||||
DirectoryIterator(CStrRef path);
|
||||
|
||||
static StaticString s_class_name;
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
virtual bool isResource() const { return !m_dir.isNull();}
|
||||
String getPathName() const;
|
||||
|
||||
void rewind();
|
||||
bool valid();
|
||||
void next();
|
||||
bool isdot();
|
||||
|
||||
public:
|
||||
String m_path;
|
||||
Object m_dir;
|
||||
Variant m_dirEntry;
|
||||
int m_index;
|
||||
};
|
||||
|
||||
class RecursiveDirectoryIterator: public DirectoryIterator {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(RecursiveDirectoryIterator);
|
||||
|
||||
RecursiveDirectoryIterator(CStrRef path, int flags);
|
||||
|
||||
static StaticString s_class_name;
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
virtual bool isResource() const { return !m_dir.isNull();}
|
||||
void rewind();
|
||||
void next();
|
||||
|
||||
public:
|
||||
int m_flags;
|
||||
};
|
||||
|
||||
class RecursiveIteratorIterator: public SweepableResourceData {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(RecursiveIteratorIterator);
|
||||
|
||||
RecursiveIteratorIterator(CObjRef iterator, int mode, int flags);
|
||||
~RecursiveIteratorIterator() {
|
||||
freeAllIterators();
|
||||
}
|
||||
|
||||
static StaticString s_class_name;
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
virtual bool isResource() const { return !m_iterator.isNull();}
|
||||
|
||||
void freeAllIterators();
|
||||
|
||||
public:
|
||||
typedef std::vector<std::pair<ObjectData*,int> > IteratorList;
|
||||
|
||||
Object m_iterator;
|
||||
IteratorList m_iterators;
|
||||
int m_mode;
|
||||
int m_flags;
|
||||
};
|
||||
|
||||
Object f_hphp_recursiveiteratoriterator___construct(CObjRef obj, CObjRef iterator, int64_t mode, int64_t flags);
|
||||
Object f_hphp_recursiveiteratoriterator_getinneriterator(CObjRef obj);
|
||||
Variant f_hphp_recursiveiteratoriterator_current(CObjRef obj);
|
||||
Variant f_hphp_recursiveiteratoriterator_key(CObjRef obj);
|
||||
void f_hphp_recursiveiteratoriterator_next(CObjRef obj);
|
||||
void f_hphp_recursiveiteratoriterator_rewind(CObjRef obj);
|
||||
bool f_hphp_recursiveiteratoriterator_valid(CObjRef obj);
|
||||
|
||||
bool f_hphp_directoryiterator___construct(CObjRef obj, CStrRef path);
|
||||
Variant f_hphp_directoryiterator_key(CObjRef obj);
|
||||
void f_hphp_directoryiterator_next(CObjRef obj);
|
||||
void f_hphp_directoryiterator_rewind(CObjRef obj);
|
||||
void f_hphp_directoryiterator_seek(CObjRef obj, int64_t position);
|
||||
Variant f_hphp_directoryiterator_current(CObjRef obj);
|
||||
String f_hphp_directoryiterator___tostring(CObjRef obj);
|
||||
bool f_hphp_directoryiterator_valid(CObjRef obj);
|
||||
bool f_hphp_directoryiterator_isdot(CObjRef obj);
|
||||
|
||||
bool f_hphp_recursivedirectoryiterator___construct(CObjRef obj, CStrRef path, int64_t flags);
|
||||
Variant f_hphp_recursivedirectoryiterator_key(CObjRef obj);
|
||||
void f_hphp_recursivedirectoryiterator_next(CObjRef obj);
|
||||
void f_hphp_recursivedirectoryiterator_rewind(CObjRef obj);
|
||||
void f_hphp_recursivedirectoryiterator_seek(CObjRef obj, int64_t position);
|
||||
Variant f_hphp_recursivedirectoryiterator_current(CObjRef obj);
|
||||
String f_hphp_recursivedirectoryiterator___tostring(CObjRef obj);
|
||||
bool f_hphp_recursivedirectoryiterator_valid(CObjRef obj);
|
||||
bool f_hphp_recursivedirectoryiterator_haschildren(CObjRef obj);
|
||||
Object f_hphp_recursivedirectoryiterator_getchildren(CObjRef obj);
|
||||
String f_hphp_recursivedirectoryiterator_getsubpath(CObjRef obj);
|
||||
String f_hphp_recursivedirectoryiterator_getsubpathname(CObjRef obj);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
#endif // incl_HPHP_EXT_ITERATOR_H_
|
||||
@@ -1,332 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "hphp/runtime/ext/ext_splfile.h"
|
||||
#include "hphp/runtime/ext/ext_file.h"
|
||||
|
||||
#include "hphp/system/lib/systemlib.h"
|
||||
|
||||
namespace HPHP {
|
||||
IMPLEMENT_DEFAULT_EXTENSION(SPL);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StaticString SplFileInfo::s_class_name("splfileinfo");
|
||||
StaticString SplFileObject::s_class_name("splfileobject");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IMPLEMENT_OBJECT_ALLOCATION(SplFileInfo)
|
||||
IMPLEMENT_OBJECT_ALLOCATION(SplFileObject)
|
||||
|
||||
static SplFileInfo *get_splfileinfo(CObjRef obj) {
|
||||
if (!obj->o_instanceof("SplFileInfo")) {
|
||||
throw InvalidObjectTypeException(obj->o_getClassName().c_str());
|
||||
}
|
||||
CObjRef rsrc = obj->o_get("rsrc", true, "SplFileInfo");
|
||||
return rsrc.getTyped<SplFileInfo>();
|
||||
}
|
||||
|
||||
static SplFileObject *get_splfileobject(CObjRef obj) {
|
||||
if (!obj->o_instanceof("SplFileObject")) {
|
||||
throw InvalidObjectTypeException(obj->o_getClassName().c_str());
|
||||
}
|
||||
// "SplFileInfo" as context -- rsrc is a private property
|
||||
CObjRef rsrc = obj->o_get("rsrc", true, "SplFileInfo");
|
||||
return rsrc.getTyped<SplFileObject>();
|
||||
}
|
||||
|
||||
Object f_hphp_splfileinfo___construct(CObjRef obj, CStrRef file_name) {
|
||||
int len = file_name.size();
|
||||
const char *data = file_name.data();
|
||||
ObjectData *fi;
|
||||
if (len && data[len-1] == '/') {
|
||||
do {
|
||||
len--;
|
||||
} while (len && data[len-1] == '/');
|
||||
fi = NEWOBJ(SplFileInfo)(String(data, len, CopyString));
|
||||
} else {
|
||||
fi = NEWOBJ(SplFileInfo)(file_name);
|
||||
}
|
||||
obj->o_set("rsrc", fi, "SplFileInfo");
|
||||
return obj;
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getatime(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_fileatime(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_getbasename(CObjRef obj, CStrRef suffix) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_basename(fileInfo->getFileName(), suffix);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getctime(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_filectime(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
Object f_hphp_splfileinfo_getfileinfo(CObjRef obj, CStrRef class_name) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_getfilename(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_basename(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getgroup(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_filegroup(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getinode(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_fileinode(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_getlinktarget(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
String ret = f_readlink_internal(fileInfo->getFileName(), false);
|
||||
if (!ret.size()) {
|
||||
throw Object(SystemLib::AllocExceptionObject(Variant(
|
||||
"Unable to read link "+std::string(fileInfo->getFileName()) +
|
||||
", error: no such file or directory")));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getmtime(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_filemtime(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getowner(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_fileowner(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_getpath(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
const char *fileName = fileInfo->getFileName().c_str();
|
||||
const char *p1 = strrchr(fileName, '/');
|
||||
if (!p1) return "";
|
||||
return String(fileName, p1 - fileName, CopyString);
|
||||
}
|
||||
|
||||
Object f_hphp_splfileinfo_getpathinfo(CObjRef obj, CStrRef class_name) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_getpathname(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return fileInfo->getFileName();
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getperms(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_fileperms(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileinfo_getrealpath(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_realpath(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileinfo_getsize(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_filesize(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo_gettype(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_filetype(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_isdir(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_dir(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_isexecutable(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_executable(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_isfile(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_file(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_islink(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_link(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_isreadable(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_readable(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
bool f_hphp_splfileinfo_iswritable(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return f_is_writable(fileInfo->getFileName());
|
||||
}
|
||||
|
||||
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return SystemLib::AllocSplFileObjectObject(
|
||||
String(fileInfo->getFileName()), open_mode, use_include_path, context);
|
||||
}
|
||||
|
||||
void f_hphp_splfileinfo_setfileclass(CObjRef obj, CStrRef class_name) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileinfo_setinfoclass(CObjRef obj, CStrRef class_name) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileinfo___tostring(CObjRef obj) {
|
||||
SplFileInfo *fileInfo = get_splfileinfo(obj);
|
||||
return fileInfo->getFileName();
|
||||
}
|
||||
|
||||
Object f_hphp_splfileobject___construct(CObjRef obj, CStrRef filename, CStrRef open_mode, bool use_include_path, CVarRef context) {
|
||||
Variant f = f_fopen(filename, open_mode, use_include_path,
|
||||
context.isNull() ? null_object : context.toObject());
|
||||
obj->o_set("rsrc", NEWOBJ(SplFileObject)(f), "SplFileInfo");
|
||||
return obj;
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileobject_current(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_eof(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_fflush(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileobject_fgetc(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileobject_fgetcsv(CObjRef obj, CStrRef delimiter, CStrRef enclosure, CStrRef escape) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileobject_fgets(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
String f_hphp_splfileobject_fgetss(CObjRef obj, CStrRef allowable_tags) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_flock(CObjRef obj, VRefParam wouldblock) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_fpassthru(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileobject_fscanf(int64_t _argc, CObjRef obj, CStrRef format, CVarRef _argv) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_fseek(CObjRef obj, int64_t offset, int64_t whence) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileobject_fstat(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_ftell(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_ftruncate(CObjRef obj, int64_t size) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_fwrite(CObjRef obj, CStrRef str, int64_t length) {
|
||||
SplFileObject *fileObject = get_splfileobject(obj);
|
||||
Object file = fileObject->getFile();
|
||||
if (!file.isNull()) {
|
||||
File *f = file.getTyped<File>();
|
||||
return f->write(str, length);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Variant f_hphp_splfileobject_getcvscontrol(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_getflags(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_getmaxlinelen(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_haschildren(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
int64_t f_hphp_splfileobject_key(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_next(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_rewind(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_hphp_splfileobject_valid(CObjRef obj) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_seek(CObjRef obj, int64_t line_pos) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_setcsvcontrol(CObjRef obj, CStrRef delimiter, CStrRef enclosure, CStrRef escape) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_setflags(CObjRef obj, int64_t flags) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
void f_hphp_splfileobject_setmaxlinelen(CObjRef obj, int64_t max_len) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
| Copyright (c) 1997-2010 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef incl_HPHP_EXT_SPLFILE_H_
|
||||
#define incl_HPHP_EXT_SPLFILE_H_
|
||||
|
||||
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
||||
|
||||
#include "hphp/runtime/base/base_includes.h"
|
||||
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SplFileInfo: public ResourceData {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(SplFileInfo);
|
||||
|
||||
SplFileInfo() {}
|
||||
SplFileInfo(CStrRef fileName) : m_fileName(fileName) {}
|
||||
|
||||
static StaticString s_class_name;
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
virtual bool isResource() const { return !m_fileName.empty(); }
|
||||
|
||||
CStrRef getFileName() const { return m_fileName; }
|
||||
|
||||
public:
|
||||
String m_fileName;
|
||||
};
|
||||
|
||||
class SplFileObject: public ResourceData {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(SplFileObject);
|
||||
|
||||
SplFileObject(Variant f) {
|
||||
m_file = f.isNull() ? Object() : f.toObject();
|
||||
}
|
||||
|
||||
static StaticString s_class_name;
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
virtual bool isResource() const { return !m_file.isNull();}
|
||||
Object getFile() { return m_file;}
|
||||
private:
|
||||
Object m_file;
|
||||
};
|
||||
|
||||
Object f_hphp_splfileinfo___construct(CObjRef obj, CStrRef file_name);
|
||||
int64_t f_hphp_splfileinfo_getatime(CObjRef obj);
|
||||
String f_hphp_splfileinfo_getbasename(CObjRef obj, CStrRef suffix);
|
||||
int64_t f_hphp_splfileinfo_getctime(CObjRef obj);
|
||||
Object f_hphp_splfileinfo_getfileinfo(CObjRef obj, CStrRef class_name);
|
||||
String f_hphp_splfileinfo_getfilename(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getgroup(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getinode(CObjRef obj);
|
||||
String f_hphp_splfileinfo_getlinktarget(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getmtime(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getowner(CObjRef obj);
|
||||
String f_hphp_splfileinfo_getpath(CObjRef obj);
|
||||
Object f_hphp_splfileinfo_getpathinfo(CObjRef obj, CStrRef class_name);
|
||||
String f_hphp_splfileinfo_getpathname(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getperms(CObjRef obj);
|
||||
Variant f_hphp_splfileinfo_getrealpath(CObjRef obj);
|
||||
int64_t f_hphp_splfileinfo_getsize(CObjRef obj);
|
||||
String f_hphp_splfileinfo_gettype(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_isdir(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_isexecutable(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_isfile(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_islink(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_isreadable(CObjRef obj);
|
||||
bool f_hphp_splfileinfo_iswritable(CObjRef obj);
|
||||
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context);
|
||||
void f_hphp_splfileinfo_setfileclass(CObjRef obj, CStrRef class_name);
|
||||
void f_hphp_splfileinfo_setinfoclass(CObjRef obj, CStrRef class_name);
|
||||
String f_hphp_splfileinfo___tostring(CObjRef obj);
|
||||
Object f_hphp_splfileobject___construct(CObjRef obj, CStrRef filename, CStrRef open_mode, bool use_include_path, CVarRef context);
|
||||
Variant f_hphp_splfileobject_current(CObjRef obj);
|
||||
bool f_hphp_splfileobject_eof(CObjRef obj);
|
||||
bool f_hphp_splfileobject_fflush(CObjRef obj);
|
||||
String f_hphp_splfileobject_fgetc(CObjRef obj);
|
||||
Variant f_hphp_splfileobject_fgetcsv(CObjRef obj, CStrRef delimiter, CStrRef enclosure, CStrRef escape);
|
||||
String f_hphp_splfileobject_fgets(CObjRef obj);
|
||||
String f_hphp_splfileobject_fgetss(CObjRef obj, CStrRef allowable_tags);
|
||||
bool f_hphp_splfileobject_flock(CObjRef obj, VRefParam wouldblock);
|
||||
int64_t f_hphp_splfileobject_fpassthru(CObjRef obj);
|
||||
Variant f_hphp_splfileobject_fscanf(int64_t _argc, CObjRef obj, CStrRef format, CVarRef _argv);
|
||||
int64_t f_hphp_splfileobject_fseek(CObjRef obj, int64_t offset, int64_t whence);
|
||||
Variant f_hphp_splfileobject_fstat(CObjRef obj);
|
||||
int64_t f_hphp_splfileobject_ftell(CObjRef obj);
|
||||
bool f_hphp_splfileobject_ftruncate(CObjRef obj, int64_t size);
|
||||
int64_t f_hphp_splfileobject_fwrite(CObjRef obj, CStrRef str, int64_t length);
|
||||
Variant f_hphp_splfileobject_getcvscontrol(CObjRef obj);
|
||||
int64_t f_hphp_splfileobject_getflags(CObjRef obj);
|
||||
int64_t f_hphp_splfileobject_getmaxlinelen(CObjRef obj);
|
||||
int64_t f_hphp_splfileobject_key(CObjRef obj);
|
||||
void f_hphp_splfileobject_next(CObjRef obj);
|
||||
void f_hphp_splfileobject_rewind(CObjRef obj);
|
||||
bool f_hphp_splfileobject_valid(CObjRef obj);
|
||||
void f_hphp_splfileobject_seek(CObjRef obj, int64_t line_pos);
|
||||
void f_hphp_splfileobject_setcsvcontrol(CObjRef obj, CStrRef delimiter, CStrRef enclosure, CStrRef escape);
|
||||
void f_hphp_splfileobject_setflags(CObjRef obj, int64_t flags);
|
||||
void f_hphp_splfileobject_setmaxlinelen(CObjRef obj, int64_t max_len);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
#endif // incl_HPHP_EXT_SPLFILE_H_
|
||||
+2
-539
@@ -10174,368 +10174,6 @@ const char *g_class_map[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo___construct", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @file_name string\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "file_name", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getatime", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getbasename", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @suffix string\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "suffix", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getctime", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getfileinfo", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @class_name string\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "class_name", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getfilename", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getgroup", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getinode", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getlinktarget", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getmtime", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getowner", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getpath", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getpathinfo", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @class_name string\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "class_name", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getpathname", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getperms", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getrealpath", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_getsize", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_gettype", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_isdir", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_isexecutable", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_isfile", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_islink", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_isreadable", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_iswritable", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_openfile", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @open_mode string\n * @use_include_path\n * bool\n * @context mixed\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "open_mode", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "use_include_path", "", (const char *)0x9 /* KindOfBoolean */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "context", "", (const char *)0xffffffff /* KindOfUnknown: $t: Variant */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_setfileclass", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @class_name string\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "class_name", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo_setinfoclass", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @class_name string\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "class_name", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileinfo___tostring", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject___construct", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @filename string\n * @open_mode string\n * @use_include_path\n * bool\n * @context mixed\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "filename", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "open_mode", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "use_include_path", "", (const char *)0x9 /* KindOfBoolean */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "context", "", (const char *)0xffffffff /* KindOfUnknown: $t: Variant */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_current", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_eof", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fflush", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fgetc", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fgetcsv", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @delimiter string\n * @enclosure string\n * @escape string\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "delimiter", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "enclosure", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "escape", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fgets", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fgetss", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @allowable_tags\n * string\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "allowable_tags", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_flock", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @wouldblock mixed\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2800, "wouldblock", "", (const char *)0xffffffff /* KindOfUnknown: $t: Variant */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fpassthru", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fscanf", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @_argc int\n * @obj resource\n *\n * @format string\n * @_argv mixed\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "_argc", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "format", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "_argv", "", (const char *)0xffffffff /* KindOfUnknown: $t: Variant */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fseek", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @offset int\n * @whence int\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "offset", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "whence", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fstat", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_ftell", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_ftruncate", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @size int\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "size", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_fwrite", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @str string\n * @length int\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "str", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "length", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_getcvscontrol", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_getflags", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_getmaxlinelen", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_key", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return int\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_next", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_rewind", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_valid", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_seek", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @line_pos int\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "line_pos", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_setcsvcontrol", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @delimiter string\n * @enclosure string\n * @escape string\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "delimiter", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "enclosure", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "escape", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_setflags", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @flags int\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "flags", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_splfileobject_setmaxlinelen", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @max_len int\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "max_len", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10006040, "fopen", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( excerpt from http://php.net/manual/en/function.fopen.php )\n *\n * fopen() binds a named resource, specified by filename, to a stream.\n *\n * @filename string\n * @mode string\n * @use_include_path\n * bool\n * @context mixed\n *\n * @return mixed Returns a file pointer resource on success, or FALSE\n * on error.\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "filename", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
@@ -10699,11 +10337,12 @@ const char *g_class_map[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10006040, "fgetcsv", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( excerpt from http://php.net/manual/en/function.fgetcsv.php )\n *\n * Similar to fgets() except that fgetcsv() parses the line it reads for\n * fields in CSV format and returns an array containing the fields read.\n *\n * @handle resource\n * A valid file pointer to a file successfully opened\n * by fopen(), popen(), or fsockopen().\n * @length int Must be greater than the longest line (in\n * characters) to be found in the CSV file (allowing\n * for trailing line-end characters). It became\n * optional in PHP 5. Omitting this parameter (or\n * setting it to 0 in PHP 5.0.4 and later) the maximum\n * line length is not limited, which is slightly\n * slower.\n * @delimiter string Set the field delimiter (one character only).\n * @enclosure string Set the field enclosure character (one character\n * only).\n *\n * @return mixed Returns an indexed array containing the fields read.\n *\n * A blank line in a CSV file will be returned as an\n * array comprising a single null field, and will not\n * be treated as an error. If PHP is not properly\n * recognizing the line endings when reading files\n * either on or created by a Macintosh computer,\n * enabling the auto_detect_line_endings run-time\n * configuration option may help resolve the problem.\n *\n * fgetcsv() returns NULL if an invalid handle is\n * supplied or FALSE on other errors, including end of\n * file.\n */",
|
||||
"/**\n * ( excerpt from http://php.net/manual/en/function.fgetcsv.php )\n *\n * Similar to fgets() except that fgetcsv() parses the line it reads for\n * fields in CSV format and returns an array containing the fields read.\n *\n * @handle resource\n * A valid file pointer to a file successfully opened\n * by fopen(), popen(), or fsockopen().\n * @length int Must be greater than the longest line (in\n * characters) to be found in the CSV file (allowing\n * for trailing line-end characters). It became\n * optional in PHP 5. Omitting this parameter (or\n * setting it to 0 in PHP 5.0.4 and later) the maximum\n * line length is not limited, which is slightly\n * slower.\n * @delimiter string Set the field delimiter (one character only).\n * @enclosure string Set the field enclosure character (one character\n * only).\n * @escape string Set the escape character (one character only).\n *\n * @return mixed Returns an indexed array containing the fields read.\n *\n * A blank line in a CSV file will be returned as an\n * array comprising a single null field, and will not\n * be treated as an error. If PHP is not properly\n * recognizing the line endings when reading files\n * either on or created by a Macintosh computer,\n * enabling the auto_detect_line_endings run-time\n * configuration option may help resolve the problem.\n *\n * fgetcsv() returns NULL if an invalid handle is\n * supplied or FALSE on other errors, including end of\n * file.\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "handle", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "length", "", (const char *)0xa /* KindOfInt64 */, "i:0;", (const char *)4, "0", (const char *)1, NULL,
|
||||
(const char *)0x2000, "delimiter", "", (const char *)0x14 /* KindOfString */, "s:1:\",\";", (const char *)8, "\",\"", (const char *)3, NULL,
|
||||
(const char *)0x2000, "enclosure", "", (const char *)0x14 /* KindOfString */, "s:1:\"\"\";", (const char *)8, "\"\\\"\"", (const char *)4, NULL,
|
||||
(const char *)0x2000, "escape", "", (const char *)0x14 /* KindOfString */, "s:1:\"\\\";", (const char *)8, "\"\\\\\"", (const char *)4, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -13648,182 +13287,6 @@ const char *g_class_map[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator___construct", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @iterator resource\n *\n * @mode int\n * @flags int\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "iterator", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "mode", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "flags", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_getinneriterator", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_current", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_key", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_next", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_rewind", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursiveiteratoriterator_valid", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator___construct", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @path string\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "path", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_key", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_next", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_rewind", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_seek", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @position int\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "position", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_current", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator___tostring", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_valid", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_directoryiterator_isdot", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator___construct", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @path string\n * @flags int\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "path", "", (const char *)0x14 /* KindOfString */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "flags", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_key", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_next", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_rewind", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_seek", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n * @position int\n */",
|
||||
(const char *)0x8 /* KindOfNull */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
(const char *)0x2000, "position", "", (const char *)0xa /* KindOfInt64 */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_current", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return mixed\n */",
|
||||
(const char *)0xffffffff /* KindOfUnknown: $t: Variant */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator___tostring", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_valid", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_haschildren", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return bool\n */",
|
||||
(const char *)0x9 /* KindOfBoolean */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_getchildren", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return resource\n *\n */",
|
||||
(const char *)0x40 /* KindOfObject */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_getsubpath", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10016040, "hphp_recursivedirectoryiterator_getsubpathname", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( HipHop specific )\n *\n *\n * @obj resource\n *\n *\n * @return string\n */",
|
||||
(const char *)0x14 /* KindOfString */, (const char *)0x2000, "obj", "", (const char *)0x40 /* KindOfObject */, "", (const char *)0, "", (const char *)0, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
(const char *)0x10006040, "asio_get_current_context_idx", "", (const char*)0, (const char*)0,
|
||||
"/**\n * ( excerpt from\n * http://php.net/manual/en/function.asio-get-current-context-idx.php )\n *\n * Get index of the current scheduler context, or 0 if there is none\n *\n * @return int An index of the current scheduler context\n */",
|
||||
(const char *)0xa /* KindOfInt64 */, NULL,
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
* contents of filesystem directories.
|
||||
*
|
||||
*/
|
||||
class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
SeekableIterator {
|
||||
class DirectoryIterator extends SplFileInfo
|
||||
implements Traversable, SeekableIterator {
|
||||
|
||||
private $dir;
|
||||
private $dirName;
|
||||
private $index;
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
@@ -21,10 +25,18 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @path mixed The path of the directory to traverse.
|
||||
*/
|
||||
public function __construct($path) {
|
||||
if (!hphp_directoryiterator___construct($this, $path)) {
|
||||
// next() will fill in the correct filename
|
||||
parent::__construct(null);
|
||||
|
||||
if (!is_dir($path)) {
|
||||
throw new UnexpectedValueException(
|
||||
"DirectoryIterator::__construct($path): failed to open dir");
|
||||
"DirectoryIterator::__construct($path): failed to open dir"
|
||||
);
|
||||
}
|
||||
|
||||
$this->dirName = rtrim($path, DIRECTORY_SEPARATOR);
|
||||
$this->dir = opendir($path);
|
||||
$this->rewind();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -36,7 +48,7 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed The current DirectoryIterator item.
|
||||
*/
|
||||
public function current() {
|
||||
return hphp_directoryiterator_current($this);
|
||||
return clone $this;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -48,7 +60,7 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed The key for the current DirectoryIterator item.
|
||||
*/
|
||||
public function key() {
|
||||
return hphp_directoryiterator_key($this);
|
||||
return $this->index;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -60,7 +72,13 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
hphp_directoryiterator_next($this);
|
||||
$file_name = readdir($this->dir);
|
||||
if ($file_name === false) {
|
||||
$this->setPathname(false);
|
||||
} else {
|
||||
$this->setPathname($this->dirName.DIRECTORY_SEPARATOR.$file_name);
|
||||
}
|
||||
$this->index++;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -72,7 +90,9 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
hphp_directoryiterator_rewind($this);
|
||||
rewinddir($this->dir);
|
||||
$this->index = -1;
|
||||
$this->next();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -86,7 +106,9 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function seek($position) {
|
||||
hphp_directoryiterator_seek($this, $position);
|
||||
for ($i = $this->index; $i < $position; $i++) {
|
||||
$this->next();
|
||||
}
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -99,7 +121,7 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* DirectoryIterator item.
|
||||
*/
|
||||
public function __toString() {
|
||||
return hphp_directoryiterator___tostring($this);
|
||||
return $this->getFilename();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -112,7 +134,7 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* FALSE
|
||||
*/
|
||||
public function valid() {
|
||||
return hphp_directoryiterator_valid($this);
|
||||
return $this->getPathname() !== false;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -125,7 +147,7 @@ class DirectoryIterator extends SplFileInfo implements Traversable,
|
||||
* @return mixed TRUE if the entry is . or .., otherwise FALSE
|
||||
*/
|
||||
public function isDot() {
|
||||
return hphp_directoryiterator_isdot($this);
|
||||
return $this->getFilename() == '.' || $this->getFilename() == '..';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,22 +175,22 @@ class FilesystemIterator extends DirectoryIterator
|
||||
|
||||
private $flags;
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.construct.php
|
||||
* )
|
||||
*
|
||||
* Constructs a new filesystem iterator from the path.
|
||||
*
|
||||
* @path mixed The path of the filesystem item to be iterated over.
|
||||
* @flags mixed Flags may be provided which will affect the behavior
|
||||
* of some methods. A list of the flags can found under
|
||||
* FilesystemIterator predefined constants. They can
|
||||
* also be set later with
|
||||
* FilesystemIterator::setFlags()
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.construct.php
|
||||
* )
|
||||
*
|
||||
* Constructs a new filesystem iterator from the path.
|
||||
*
|
||||
* @path mixed The path of the filesystem item to be iterated over.
|
||||
* @flags mixed Flags may be provided which will affect the behavior
|
||||
* of some methods. A list of the flags can found under
|
||||
* FilesystemIterator predefined constants. They can
|
||||
* also be set later with
|
||||
* FilesystemIterator::setFlags()
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function __construct(string $path, int $flags = null) {
|
||||
parent::__construct($path);
|
||||
if ($flags === null) {
|
||||
@@ -180,16 +202,16 @@ class FilesystemIterator extends DirectoryIterator
|
||||
$this->goPastDotsIfNeeded();
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.current.php )
|
||||
*
|
||||
* Get file information of the current element.
|
||||
*
|
||||
* @return mixed The filename, file information, or $this depending
|
||||
* on the set flags. See the FilesystemIterator
|
||||
* constants.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.current.php )
|
||||
*
|
||||
* Get file information of the current element.
|
||||
*
|
||||
* @return mixed The filename, file information, or $this depending
|
||||
* on the set flags. See the FilesystemIterator
|
||||
* constants.
|
||||
*/
|
||||
public function current() {
|
||||
$f = parent::current();
|
||||
if ($this->flags & FilesystemIterator::CURRENT_AS_PATHNAME) {
|
||||
@@ -201,28 +223,28 @@ class FilesystemIterator extends DirectoryIterator
|
||||
return $f;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.getflags.php
|
||||
* )
|
||||
*
|
||||
* Gets the handling flags, as set in FilesystemIterator::__construct() or
|
||||
* FilesystemIterator::setFlags().
|
||||
*
|
||||
* @return mixed The integer value of the set flags.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.getflags.php
|
||||
* )
|
||||
*
|
||||
* Gets the handling flags, as set in FilesystemIterator::__construct() or
|
||||
* FilesystemIterator::setFlags().
|
||||
*
|
||||
* @return mixed The integer value of the set flags.
|
||||
*/
|
||||
public function getFlags() {
|
||||
return $this->flags;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.key.php )
|
||||
*
|
||||
*
|
||||
* @return mixed Returns the pathname or filename depending on the
|
||||
* set flags. See the FilesystemIterator constants.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.key.php )
|
||||
*
|
||||
*
|
||||
* @return mixed Returns the pathname or filename depending on the
|
||||
* set flags. See the FilesystemIterator constants.
|
||||
*/
|
||||
public function key() {
|
||||
if ($this->flags & FilesystemIterator::KEY_AS_FILENAME) {
|
||||
return parent::current()->getFileName();
|
||||
@@ -231,44 +253,44 @@ class FilesystemIterator extends DirectoryIterator
|
||||
return parent::current()->getPathName();
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.next.php )
|
||||
*
|
||||
* Move to the next file.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.next.php )
|
||||
*
|
||||
* Move to the next file.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
parent::next();
|
||||
$this->goPastDotsIfNeeded();
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.rewind.php )
|
||||
*
|
||||
* Rewinds the directory back to the start.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.rewind.php )
|
||||
*
|
||||
* Rewinds the directory back to the start.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
parent::rewind();
|
||||
$this->goPastDotsIfNeeded();
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.setflags.php
|
||||
* )
|
||||
*
|
||||
* Sets handling flags.
|
||||
*
|
||||
* @flags mixed The handling flags to set. See the
|
||||
* FilesystemIterator constants.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/filesystemiterator.setflags.php
|
||||
* )
|
||||
*
|
||||
* Sets handling flags.
|
||||
*
|
||||
* @flags mixed The handling flags to set. See the
|
||||
* FilesystemIterator constants.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setFlags(int $flags) {
|
||||
$this->flags = $flags;
|
||||
}
|
||||
@@ -282,9 +304,13 @@ class FilesystemIterator extends DirectoryIterator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return $this->getPathname();
|
||||
}
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/class.recursivedirectoryiterator.php )
|
||||
@@ -296,6 +322,10 @@ class FilesystemIterator extends DirectoryIterator
|
||||
class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
implements RecursiveIterator {
|
||||
|
||||
const FOLLOW_SYMLINKS = 512;
|
||||
|
||||
private $subPath;
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -313,67 +343,12 @@ class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
* @return mixed Returns the newly created
|
||||
* RecursiveDirectoryIterator.
|
||||
*/
|
||||
function __construct($path, $flags = null) {
|
||||
public function __construct($path, $flags = null) {
|
||||
if ($flags === null) {
|
||||
$flags = FilesystemIterator::KEY_AS_PATHNAME |
|
||||
FilesystemIterator::CURRENT_AS_FILEINFO;
|
||||
}
|
||||
if (!hphp_recursivedirectoryiterator___construct($this, $path, $flags)) {
|
||||
throw new UnexpectedValueException(
|
||||
"RecursiveDirectoryIterator::__construct($path): failed to open dir");
|
||||
}
|
||||
}
|
||||
|
||||
function current() {
|
||||
return hphp_recursivedirectoryiterator_current($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/recursivedirectoryiterator.key.php )
|
||||
*
|
||||
*
|
||||
* @return mixed The path and filename of the current dir entry.
|
||||
*/
|
||||
function key() {
|
||||
return hphp_recursivedirectoryiterator_key($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/recursivedirectoryiterator.next.php )
|
||||
*
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
hphp_recursivedirectoryiterator_next($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/recursivedirectoryiterator.rewind.php )
|
||||
*
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
hphp_recursivedirectoryiterator_rewind($this);
|
||||
}
|
||||
|
||||
public function seek($position) {
|
||||
hphp_recursivedirectoryiterator_seek($this, $position);
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return hphp_recursivedirectoryiterator___toString($this);
|
||||
}
|
||||
|
||||
public function valid() {
|
||||
return hphp_recursivedirectoryiterator_valid($this);
|
||||
parent::__construct($path, $flags);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -385,8 +360,15 @@ class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
* @return mixed Returns whether the current entry is a directory,
|
||||
* but not '.' or '..'
|
||||
*/
|
||||
function hasChildren() {
|
||||
return hphp_recursivedirectoryiterator_haschildren($this);
|
||||
public function hasChildren() {
|
||||
if ($this->isDot()) {
|
||||
return false;
|
||||
}
|
||||
if (is_link($this->getFilename()) &&
|
||||
!($this->flags & self::FOLLOW_SYMLINKS)) {
|
||||
return false;
|
||||
}
|
||||
return $this->isDir();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -399,8 +381,17 @@ class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
* on the set flags. See the FilesystemIterator
|
||||
* constants.
|
||||
*/
|
||||
function getChildren() {
|
||||
return hphp_recursivedirectoryiterator_getchildren($this);
|
||||
public function getChildren() {
|
||||
if ($this->getFlags() & FilesystemIterator::CURRENT_AS_PATHNAME) {
|
||||
return $this->current();
|
||||
}
|
||||
$child = new self($this->getPathname(), $this->getFlags());
|
||||
$child->subPath = $this->subPath;
|
||||
if ($child->subPath) {
|
||||
$child->subPath .= DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$child->subPath .= $this->getPathname();
|
||||
return $child;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -413,8 +404,8 @@ class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
*
|
||||
* @return mixed The sub path (sub directory).
|
||||
*/
|
||||
function getSubPath() {
|
||||
return hphp_recursivedirectoryiterator_getsubpath($this);
|
||||
public function getSubPath() {
|
||||
return $this->subPath;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -427,7 +418,37 @@ class RecursiveDirectoryIterator extends FilesystemIterator
|
||||
*
|
||||
* @return mixed The sub path (sub directory) and filename.
|
||||
*/
|
||||
function getSubPathname() {
|
||||
return hphp_recursivedirectoryiterator_getsubpathname($this);
|
||||
public function getSubPathname() {
|
||||
return ($this->subPath ? $this->subPath . DIRECTORY_SEPARATOR : '') .
|
||||
$this->getPathname();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/recursivedirectoryiterator.rewind.php )
|
||||
*
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
parent::rewind();
|
||||
if ($this->isDot()) {
|
||||
$this->next();
|
||||
}
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
* http://php.net/manual/en/recursivedirectoryiterator.next.php )
|
||||
*
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
do {
|
||||
parent::next();
|
||||
} while ($this->valid() && $this->isDot());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,13 +268,16 @@ interface RecursiveIterator extends Iterator {
|
||||
*/
|
||||
class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
|
||||
private $rsrc;
|
||||
|
||||
const LEAVES_ONLY = 0;
|
||||
const SELF_FIRST = 1;
|
||||
const CHILD_FIRST = 2;
|
||||
const CATCH_GET_CHILD = 16;
|
||||
|
||||
private $iterators = array();
|
||||
private $originalIterator;
|
||||
private $mode;
|
||||
private $flags;
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -302,8 +305,12 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
public function __construct($iterator,
|
||||
$mode = RecursiveIteratorIterator::LEAVES_ONLY,
|
||||
$flags = 0) {
|
||||
hphp_recursiveiteratoriterator___construct($this, $iterator, $mode, $flags);
|
||||
$this->iterators[] = array($iterator, 0);
|
||||
$this->originalIterator = $iterator;
|
||||
$this->mode = (int) $mode;
|
||||
$this->flags = $flags;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -316,8 +323,15 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* @return mixed The current active sub iterator.
|
||||
*/
|
||||
public function getInnerIterator() {
|
||||
return hphp_recursiveiteratoriterator_getinneriterator($this);
|
||||
$it = $this->iterators[count($this->iterators)-1][0];
|
||||
if (!$it instanceof RecursiveDirectoryIterator) {
|
||||
throw new NotImplementedException(
|
||||
"RecursiveIteratorIterator only supports RecursiveDirectoryIterator"
|
||||
);
|
||||
}
|
||||
return $it;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -327,8 +341,9 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* @return mixed The current elements value.
|
||||
*/
|
||||
public function current() {
|
||||
return hphp_recursiveiteratoriterator_current($this);
|
||||
return $this->getInnerIterator()->current();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -338,8 +353,9 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* @return mixed The current key.
|
||||
*/
|
||||
public function key() {
|
||||
return hphp_recursiveiteratoriterator_key($this);
|
||||
return $this->getInnerIterator()->key();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -349,8 +365,64 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
hphp_recursiveiteratoriterator_next($this);
|
||||
if ($this->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$it = $this->getInnerIterator();
|
||||
|
||||
if ($this->mode == self::SELF_FIRST) {
|
||||
if ($it->hasChildren() && !$this->getInnerIteratorFlag()) {
|
||||
$this->setInnerIteratorFlag(1);
|
||||
$newit = $it->getChildren();
|
||||
$this->iterators[] = array($newit, 0);
|
||||
} else {
|
||||
$it->next();
|
||||
$this->setInnerIteratorFlag(0);
|
||||
}
|
||||
|
||||
if ($this->valid()) {
|
||||
return;
|
||||
}
|
||||
array_pop($this->iterators);
|
||||
return $this->next();
|
||||
} else if ($this->mode == self::CHILD_FIRST ||
|
||||
$this->mode == self::LEAVES_ONLY) {
|
||||
|
||||
if (!$it->valid()) {
|
||||
array_pop($this->iterators);
|
||||
return $this->next();
|
||||
} else if ($it->hasChildren()) {
|
||||
if (!$this->getInnerIteratorFlag()) {
|
||||
$this->setInnerIteratorFlag(1);
|
||||
$this->iterators[] = array($it->getChildren(), 0);
|
||||
if ($this->valid()) {
|
||||
return;
|
||||
}
|
||||
return $this->next();
|
||||
} else {
|
||||
// CHILD_FIRST: 0 - drill down; 1 - visit 2 - next
|
||||
// LEAVES_ONLY: 0 - drill down; 1 - next
|
||||
if ($this->mode == self::CHILD_FIRST &&
|
||||
$this->getInnerIteratorFlag() == 1) {
|
||||
$this->setInnerIteratorFlag(2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setInnerIteratorFlag(0);
|
||||
$it->next();
|
||||
if ($this->valid()) {
|
||||
return;
|
||||
}
|
||||
return $this->next();
|
||||
} else {
|
||||
$this->setInnerIteratorFlag(0);
|
||||
$it->next();
|
||||
}
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -360,8 +432,16 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
hphp_recursiveiteratoriterator_rewind($this);
|
||||
$it = $this->originalIterator;
|
||||
$this->iterators = array(array($it, 0));
|
||||
$it->rewind();
|
||||
|
||||
// Make sure the first entry is valid
|
||||
if (!$this->valid()) {
|
||||
$this->next();
|
||||
}
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from
|
||||
@@ -372,7 +452,31 @@ class RecursiveIteratorIterator implements OuterIterator, Traversable {
|
||||
* FALSE
|
||||
*/
|
||||
public function valid() {
|
||||
return hphp_recursiveiteratoriterator_valid($this);
|
||||
if ($this->isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$it = $this->getInnerIterator();
|
||||
if ($it->valid() &&
|
||||
$it->isDir() &&
|
||||
($this->mode == self::LEAVES_ONLY ||
|
||||
($this->mode == self::CHILD_FIRST &&
|
||||
$this->getInnerIteratorFlag() == 0))) {
|
||||
return false;
|
||||
}
|
||||
return $it->valid();
|
||||
}
|
||||
|
||||
private function isEmpty() {
|
||||
return count($this->iterators) == 0;
|
||||
}
|
||||
|
||||
private function getInnerIteratorFlag() {
|
||||
return $this->iterators[count($this->iterators)-1][1];
|
||||
}
|
||||
|
||||
private function setInnerIteratorFlag($flag) {
|
||||
$this->iterators[count($this->iterators)-1][1] = $flag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+280
-135
@@ -9,7 +9,10 @@
|
||||
*
|
||||
*/
|
||||
class SplFileInfo {
|
||||
private $rsrc;
|
||||
|
||||
private $fileName;
|
||||
private $fileClass;
|
||||
private $infoClass;
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
@@ -21,7 +24,7 @@ class SplFileInfo {
|
||||
* @file_name mixed Path to the file.
|
||||
*/
|
||||
public function __construct($file_name) {
|
||||
hphp_splfileinfo___construct($this, $file_name);
|
||||
$this->setPathname($file_name);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -34,7 +37,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the path to the file.
|
||||
*/
|
||||
public function getPath() {
|
||||
return hphp_splfileinfo_getpath($this);
|
||||
return dirname($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -46,7 +49,7 @@ class SplFileInfo {
|
||||
* @return mixed The filename.
|
||||
*/
|
||||
public function getFilename() {
|
||||
return hphp_splfileinfo_getfilename($this);
|
||||
return $this->getBasename();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -59,8 +62,11 @@ class SplFileInfo {
|
||||
*
|
||||
* @return mixed An SplFileInfo object created for the file.
|
||||
*/
|
||||
public function getFileInfo($class_name = "") {
|
||||
return hphp_splfileinfo_getfileinfo($this, $class_name);
|
||||
public function getFileInfo($class_name = null) {
|
||||
if (!$class_name) {
|
||||
$class_name = $this->fileClass;
|
||||
}
|
||||
return new $class_name($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -75,7 +81,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the base name without path information.
|
||||
*/
|
||||
public function getBasename($suffix = "") {
|
||||
return hphp_splfileinfo_getbasename($this, $suffix);
|
||||
return basename($this->getPathname(), $suffix);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -87,7 +93,7 @@ class SplFileInfo {
|
||||
* @return mixed The path to the file.
|
||||
*/
|
||||
public function getPathname() {
|
||||
return hphp_splfileinfo_getpathname($this);
|
||||
return $this->fileName;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -101,8 +107,11 @@ class SplFileInfo {
|
||||
* @return mixed Returns an SplFileInfo object for the parent path of
|
||||
* the file.
|
||||
*/
|
||||
public function getPathInfo($class_name = "") {
|
||||
return hphp_splfileinfo_getpathinfo($this, $class_name);
|
||||
public function getPathInfo($class_name = null) {
|
||||
if (!$class_name) {
|
||||
$class_name = $this->fileClass;
|
||||
}
|
||||
return new $class_name($this->getPath());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -114,7 +123,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the file permissions.
|
||||
*/
|
||||
public function getPerms() {
|
||||
return hphp_splfileinfo_getperms($this);
|
||||
return fileperms($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -126,7 +135,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the inode number for the filesystem object.
|
||||
*/
|
||||
public function getInode() {
|
||||
return hphp_splfileinfo_getinode($this);
|
||||
return fileinode($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -138,7 +147,7 @@ class SplFileInfo {
|
||||
* @return mixed The filesize in bytes.
|
||||
*/
|
||||
public function getSize() {
|
||||
return hphp_splfileinfo_getsize($this);
|
||||
return filesize($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -150,7 +159,7 @@ class SplFileInfo {
|
||||
* @return mixed The owner id in numerical format.
|
||||
*/
|
||||
public function getOwner() {
|
||||
return hphp_splfileinfo_getowner($this);
|
||||
return fileowner($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -162,7 +171,7 @@ class SplFileInfo {
|
||||
* @return mixed The group id in numerical format.
|
||||
*/
|
||||
public function getGroup() {
|
||||
return hphp_splfileinfo_getgroup($this);
|
||||
return filegroup($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -174,7 +183,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the time the file was last accessed.
|
||||
*/
|
||||
public function getATime() {
|
||||
return hphp_splfileinfo_getatime($this);
|
||||
return fileatime($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -188,7 +197,7 @@ class SplFileInfo {
|
||||
* Unix timestamp.
|
||||
*/
|
||||
public function getMTime() {
|
||||
return hphp_splfileinfo_getmtime($this);
|
||||
return filemtime($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -201,7 +210,7 @@ class SplFileInfo {
|
||||
* @return mixed The last change time, in a Unix timestamp.
|
||||
*/
|
||||
public function getCTime() {
|
||||
return hphp_splfileinfo_getctime($this);
|
||||
return filectime($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -214,7 +223,20 @@ class SplFileInfo {
|
||||
* one of file, link, or dir
|
||||
*/
|
||||
public function getType() {
|
||||
return hphp_splfileinfo_gettype($this);
|
||||
return filetype($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileinfo.getextension.php )
|
||||
*
|
||||
* Retrieves the file extension.
|
||||
*
|
||||
* @return mixed Returns a string containing the file extension, or
|
||||
* an empty string if the file has no extension.
|
||||
*/
|
||||
public function getExtension() {
|
||||
return pathinfo($this->getPathname(), PATHINFO_EXTENSION);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -226,7 +248,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns TRUE if writable, FALSE otherwise;
|
||||
*/
|
||||
public function isWritable() {
|
||||
return hphp_splfileinfo_iswritable($this);
|
||||
return is_writable($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -238,7 +260,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns TRUE if readable, FALSE otherwise.
|
||||
*/
|
||||
public function isReadable() {
|
||||
return hphp_splfileinfo_isreadable($this);
|
||||
return is_readable($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -250,7 +272,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns TRUE if executable, FALSE otherwise.
|
||||
*/
|
||||
public function isExecutable() {
|
||||
return hphp_splfileinfo_isexecutable($this);
|
||||
return is_executable($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -264,7 +286,7 @@ class SplFileInfo {
|
||||
* file (not a link), FALSE otherwise.
|
||||
*/
|
||||
public function isFile() {
|
||||
return hphp_splfileinfo_isfile($this);
|
||||
return is_file($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -276,7 +298,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns TRUE if a directory, FALSE otherwise.
|
||||
*/
|
||||
public function isDir() {
|
||||
return hphp_splfileinfo_isdir($this);
|
||||
return is_dir($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -289,7 +311,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns TRUE if the file is a link, FALSE otherwise.
|
||||
*/
|
||||
public function isLink() {
|
||||
return hphp_splfileinfo_islink($this);
|
||||
return is_link($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -304,7 +326,13 @@ class SplFileInfo {
|
||||
* @return mixed Returns the target of the filesystem link.
|
||||
*/
|
||||
public function getLinkTarget() {
|
||||
return hphp_splfileinfo_getlinktarget($this);
|
||||
$link = @readlink($this->getPathname());
|
||||
if ($link === false) {
|
||||
throw new Exception(
|
||||
'Unable to read link '.$this->getPathname()
|
||||
);
|
||||
}
|
||||
return $link;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -317,7 +345,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the path to the file.
|
||||
*/
|
||||
public function getRealPath() {
|
||||
return hphp_splfileinfo_getrealpath($this);
|
||||
return realpath($this->getPathname());
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -329,7 +357,7 @@ class SplFileInfo {
|
||||
* @return mixed Returns the path to the file.
|
||||
*/
|
||||
public function __toString() {
|
||||
return hphp_splfileinfo___tostring($this);
|
||||
return $this->getPathname();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -354,8 +382,13 @@ class SplFileInfo {
|
||||
*/
|
||||
public function openFile($mode = 'r', $use_include_path = false,
|
||||
$context = null) {
|
||||
return hphp_splfileinfo_openfile($this, $mode,
|
||||
$use_include_path, $context);
|
||||
$class_name = $this->fileClass;
|
||||
return new $class_name(
|
||||
$this->getPathname(),
|
||||
$mode,
|
||||
$use_include_path,
|
||||
$context
|
||||
);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -371,7 +404,7 @@ class SplFileInfo {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setFileClass($class_name = "SplFileObject") {
|
||||
hphp_splfileinfo_setfileclass($this, $class_name);
|
||||
$this->fileClass = $class_name;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -387,7 +420,14 @@ class SplFileInfo {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setInfoClass($class_name = "SplFileInfo") {
|
||||
hphp_splfileinfo_setinfoclass($this, $class_name);
|
||||
$this->infoClass = $class_name;
|
||||
}
|
||||
|
||||
protected function setPathname($file_name) {
|
||||
if ($file_name !== false) {
|
||||
$file_name = rtrim($file_name, '/');
|
||||
}
|
||||
$this->fileName = $file_name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,14 +438,23 @@ class SplFileInfo {
|
||||
* The SplFileObject class offers an object oriented interface for a file.
|
||||
*
|
||||
*/
|
||||
class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
Traversable, SeekableIterator {
|
||||
class SplFileObject extends SplFileInfo
|
||||
implements RecursiveIterator, SeekableIterator {
|
||||
|
||||
const DROP_NEW_LINE = 1;
|
||||
const READ_AHEAD = 2;
|
||||
const SKIP_EMPTY = 6;
|
||||
const SKIP_EMPTY = 4;
|
||||
const READ_CSV = 8;
|
||||
|
||||
private $delimiter = ',';
|
||||
private $enclosure = '"';
|
||||
private $escape = '\\';
|
||||
private $flags;
|
||||
private $maxLineLen = 0;
|
||||
private $currentLineNum = 0;
|
||||
private $rsrc;
|
||||
private $currentLine = false;
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.construct.php )
|
||||
@@ -432,23 +481,14 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
public function __construct($filename, $open_mode = 'r',
|
||||
$use_include_path = false,
|
||||
$context = null) {
|
||||
hphp_splfileobject___construct($this, $filename, $open_mode,
|
||||
$use_include_path, $context);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.current.php )
|
||||
*
|
||||
* Retrieves the current line of the file.
|
||||
*
|
||||
* @return mixed Retrieves the current line of the file. If the
|
||||
* SplFileObject::READ_CSV flag is set, this method
|
||||
* returns an array containing the current line parsed
|
||||
* as CSV data.
|
||||
*/
|
||||
public function current() {
|
||||
return hphp_splfileobject_current($this);
|
||||
parent::__construct($filename);
|
||||
if (!is_string($open_mode)) {
|
||||
throw new Exception(
|
||||
'SplFileObject::__construct() expects parameter 2 to be string, '.
|
||||
gettype($open_mode).' given'
|
||||
);
|
||||
}
|
||||
$this->rsrc = fopen($filename, $open_mode, $use_include_path, $context);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -460,7 +500,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns TRUE if file is at EOF, FALSE otherwise.
|
||||
*/
|
||||
public function eof() {
|
||||
return hphp_splfileobject_eof($this);
|
||||
return feof($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -472,7 +512,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns TRUE on success or FALSE on failure.
|
||||
*/
|
||||
public function fflush() {
|
||||
return hphp_splfileobject_fflush($this);
|
||||
return fflush($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -490,7 +530,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* this function.
|
||||
*/
|
||||
public function fgetc() {
|
||||
return hphp_splfileobject_fgetc($this);
|
||||
return fgetc($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -519,10 +559,28 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* SplFileObject::DROP_NEW_LINE, in which case empty
|
||||
* lines are skipped.
|
||||
*/
|
||||
public function fgetcsv($delimiter = ",", $enclosure = "\"",
|
||||
$escape = "\\") {
|
||||
return hphp_splfileobject_fgetcsv($this, $delimiter,
|
||||
$enclosure, $escape);
|
||||
public function fgetcsv(
|
||||
$delimiter = null,
|
||||
$enclosure = null,
|
||||
$escape = null) {
|
||||
|
||||
if (!$delimiter) {
|
||||
$delimiter = $this->delimiter;
|
||||
}
|
||||
if (!$enclosure) {
|
||||
$enclosure = $this->enclosure;
|
||||
}
|
||||
if (!$escape) {
|
||||
$escape = $this->escape;
|
||||
}
|
||||
|
||||
return fgetcsv(
|
||||
$this->rsrc,
|
||||
$this->maxLineLen,
|
||||
$delimiter,
|
||||
$enclosure,
|
||||
$escape
|
||||
);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -535,7 +593,15 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* file, or FALSE on error.
|
||||
*/
|
||||
public function fgets() {
|
||||
return hphp_splfileobject_fgets($this);
|
||||
$line = fgets($this->rsrc);
|
||||
if ($this->flags & self::DROP_NEW_LINE) {
|
||||
$line = rtrim($line);
|
||||
}
|
||||
return $line;
|
||||
}
|
||||
|
||||
public function getCurrentLine() {
|
||||
return $this->fgets();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -554,8 +620,8 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* file with HTML and PHP code stripped, or FALSE on
|
||||
* error.
|
||||
*/
|
||||
public function fgetss($allowable_tags) {
|
||||
return hphp_splfileobject_fgetss($this, $allowable_tags);
|
||||
public function fgetss($allowable_tags = null) {
|
||||
return fgetss($this->rsrc, $this->maxLineLen, $allowable_tags);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -575,7 +641,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns TRUE on success or FALSE on failure.
|
||||
*/
|
||||
public function flock($operation, &$wouldblock) {
|
||||
return hphp_splfileobject_flock($this, $wouldblock);
|
||||
return flock($this->rsrc, $operation, $wouldblock);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -593,7 +659,42 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* and passed through to the output.
|
||||
*/
|
||||
public function fpassthru() {
|
||||
return hphp_splfileobject_fpassthru($this);
|
||||
return fpassthru($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.fputcsv.php )
|
||||
*
|
||||
* Writes the fields array to the file as a CSV line.
|
||||
*
|
||||
* @fields mixed An array of values.
|
||||
* @delimiter mixed The optional delimiter parameter sets the field
|
||||
* delimiter (one character only).
|
||||
* @enclosure mixed The optional enclosure parameter sets the field
|
||||
* enclosure (one character only).
|
||||
*
|
||||
* @return mixed Returns the length of the written string or FALSE on
|
||||
* failure.
|
||||
*
|
||||
* Returns FALSE, and does not write the CSV line to
|
||||
* the file, if the delimiter or enclosure parameter is
|
||||
* not a single character.
|
||||
*/
|
||||
public function fputcsv($fields, $delimiter = null, $enclosure = null) {
|
||||
if (!$delimiter) {
|
||||
$delimiter = $this->delimiter;
|
||||
}
|
||||
if (!$enclosure) {
|
||||
$enclosure = $this->enclosure;
|
||||
}
|
||||
|
||||
return fputcsv(
|
||||
$this->rsrc,
|
||||
$fields,
|
||||
$delimiter,
|
||||
$enclosure
|
||||
);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -617,9 +718,11 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* The optional parameters must be passed by reference.
|
||||
*/
|
||||
public function fscanf($format) {
|
||||
$argc = func_num_args();
|
||||
$argv = func_get_args();
|
||||
return hphp_splfileobject_fscanf($argc, $this, $format, $argv);
|
||||
$argv = array($this->rsrc);
|
||||
for ($i = 0; $i < func_num_args(); $i++) {
|
||||
$argv[] = func_get_arg($i);
|
||||
}
|
||||
return call_user_func_array('fscanf', $argv);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -645,7 +748,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* error.
|
||||
*/
|
||||
public function fseek($offset, $whence) {
|
||||
return hphp_splfileobject_fseek($this, $offset, $whence);
|
||||
return fseek($this->rsrc, $offset, $whence);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -659,7 +762,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* the stat() manual page.
|
||||
*/
|
||||
public function fstat() {
|
||||
return hphp_splfileobject_fstat($this);
|
||||
return fstat($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -673,7 +776,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* integer, or FALSE on error.
|
||||
*/
|
||||
public function ftell() {
|
||||
return hphp_splfileobject_ftell($this);
|
||||
return ftell($this->rsrc);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -693,7 +796,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns TRUE on success or FALSE on failure.
|
||||
*/
|
||||
public function ftruncate($size) {
|
||||
return hphp_splfileobject_ftruncate($this, $size);
|
||||
return ftruncate($this->rsrc, $size);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -711,7 +814,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* error.
|
||||
*/
|
||||
public function fwrite($str, $length) {
|
||||
return hphp_splfileobject_fwrite($this, $str, $length);
|
||||
return fwrite($this->rsrc, $str, $length);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -737,7 +840,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* and enclosure character.
|
||||
*/
|
||||
public function getCsvControl() {
|
||||
return hphp_splfileobject_getcvscontrol($this);
|
||||
return array($this->delimiter, $this->enclosure);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -749,7 +852,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns an integer representing the flags.
|
||||
*/
|
||||
public function getFlags() {
|
||||
return hphp_splfileobject_getflags($this);
|
||||
return $this->flags;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -763,7 +866,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* with SplFileObject::setMaxLineLen(), default is 0.
|
||||
*/
|
||||
public function getMaxLineLen() {
|
||||
return hphp_splfileobject_getmaxlinelen($this);
|
||||
return $this->maxLineLen;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -779,60 +882,6 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
return false; // An SplFileOjbect does not have children
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.key.php )
|
||||
*
|
||||
* Gets the current line number.
|
||||
*
|
||||
* This number may not reflect the actual line number in the file if
|
||||
* SplFileObject::setMaxLineLen() is used to read fixed lengths of the
|
||||
* file.
|
||||
*
|
||||
* @return mixed Returns the current line number.
|
||||
*/
|
||||
public function key() {
|
||||
return hphp_splfileobject_key($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.next.php )
|
||||
*
|
||||
* Moves ahead to the next line in the file.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
hphp_splfileobject_next($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.rewind.php )
|
||||
*
|
||||
* Rewinds the file back to the first line.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
hphp_splfileobject_rewind($this);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.seek.php )
|
||||
*
|
||||
* Seek to specified line in the file.
|
||||
*
|
||||
* @line_pos mixed The zero-based line number to seek to.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function seek($line_pos) {
|
||||
hphp_splfileobject_seek($this, $line_pos);
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.setcsvcontrol.php
|
||||
@@ -846,9 +895,14 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setCsvControl($delimiter = ",", $enclosure = "\"",
|
||||
$escape = "\\") {
|
||||
hphp_splfileobject_setcsvcontrol($this, $delimiter, $enclosure, $escape);
|
||||
public function setCsvControl(
|
||||
$delimiter = ",",
|
||||
$enclosure = "\"",
|
||||
$escape = "\\") {
|
||||
|
||||
$this->delimiter = $delimiter;
|
||||
$this->enclosure = $enclosure;
|
||||
$this->escape = $escape;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -863,7 +917,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setFlags($flags) {
|
||||
hphp_splfileobject_setflags($this, $flags);
|
||||
$this->flags = $flags;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -878,7 +932,95 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setMaxLineLen($max_len) {
|
||||
hphp_splfileobject_setmaxlinelen($this, $max_len);
|
||||
if ($max_len < 0) {
|
||||
throw new DomainException(
|
||||
'Maximum line length must be greater than or equal zero'
|
||||
);
|
||||
}
|
||||
$this->maxLineLen = $max_len;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.current.php )
|
||||
*
|
||||
* Retrieves the current line of the file.
|
||||
*
|
||||
* @return mixed Retrieves the current line of the file. If the
|
||||
* SplFileObject::READ_CSV flag is set, this method
|
||||
* returns an array containing the current line parsed
|
||||
* as CSV data.
|
||||
*/
|
||||
public function current() {
|
||||
if ($this->currentLine === false) {
|
||||
$this->currentLine = $this->fgets();
|
||||
}
|
||||
return $this->currentLine;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.key.php )
|
||||
*
|
||||
* Gets the current line number.
|
||||
*
|
||||
* This number may not reflect the actual line number in the file if
|
||||
* SplFileObject::setMaxLineLen() is used to read fixed lengths of the
|
||||
* file.
|
||||
*
|
||||
* @return mixed Returns the current line number.
|
||||
*/
|
||||
public function key() {
|
||||
return $this->currentLineNum;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.next.php )
|
||||
*
|
||||
* Moves ahead to the next line in the file.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function next() {
|
||||
$this->currentLine = false;
|
||||
$this->currentLineNum++;
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.rewind.php )
|
||||
*
|
||||
* Rewinds the file back to the first line.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function rewind() {
|
||||
rewind($this->rsrc);
|
||||
$this->currentLineNum = 0;
|
||||
$this->currentLine = false;
|
||||
if ($this->flags & self::READ_AHEAD) {
|
||||
$this->current();
|
||||
}
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/splfileobject.seek.php )
|
||||
*
|
||||
* Seek to specified line in the file.
|
||||
*
|
||||
* @line_pos mixed The zero-based line number to seek to.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function seek($line_pos) {
|
||||
$this->rewind();
|
||||
for ($i = 0; $i < $line_pos; $i++) {
|
||||
$this->current();
|
||||
$this->next();
|
||||
}
|
||||
$this->current();
|
||||
}
|
||||
|
||||
// This doc comment block generated by idl/sysdoc.php
|
||||
@@ -890,6 +1032,9 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator,
|
||||
* @return mixed Returns TRUE if not reached EOF, FALSE otherwise.
|
||||
*/
|
||||
public function valid() {
|
||||
return hphp_splfileobject_valid($this);
|
||||
if ($this->flags & self::READ_AHEAD) {
|
||||
return $this->current() !== false;
|
||||
}
|
||||
return !$this->eof();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,20 +111,6 @@ SystemLib::AllocSoapFaultObject(CVarRef code,
|
||||
detail, name, header));
|
||||
}
|
||||
|
||||
ObjectData* SystemLib::AllocSplFileObjectObject(CVarRef filename,
|
||||
CVarRef open_mode,
|
||||
CVarRef use_include_path,
|
||||
CVarRef context) {
|
||||
CREATE_AND_CONSTRUCT(SplFileObject, CREATE_VECTOR4(filename,
|
||||
open_mode,
|
||||
use_include_path,
|
||||
context));
|
||||
}
|
||||
|
||||
ObjectData* SystemLib::AllocSplFileInfoObject(CVarRef filename) {
|
||||
CREATE_AND_CONSTRUCT(SplFileInfo, CREATE_VECTOR1(filename));
|
||||
}
|
||||
|
||||
ObjectData* SystemLib::AllocKeysIterableObject(CVarRef mp) {
|
||||
CREATE_AND_CONSTRUCT(KeysIterable, CREATE_VECTOR1(mp));
|
||||
}
|
||||
@@ -162,7 +148,6 @@ ObjectData* SystemLib::AllocKeyedIterableViewObject(CVarRef iterable) {
|
||||
#undef CREATE_AND_CONSTRUCT
|
||||
|
||||
ALLOC_OBJECT_STUB(Directory);
|
||||
ALLOC_OBJECT_STUB(RecursiveDirectoryIterator);
|
||||
ALLOC_OBJECT_STUB(PDOException);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -41,10 +41,6 @@ namespace Eval {
|
||||
x(pinitSentinel) \
|
||||
x(resource) \
|
||||
x(Directory) \
|
||||
x(RecursiveDirectoryIterator) \
|
||||
x(RecursiveIteratorIterator) \
|
||||
x(DirectoryIterator) \
|
||||
x(FilesystemIterator) \
|
||||
x(SplFileInfo) \
|
||||
x(SplFileObject) \
|
||||
x(DOMDocument) \
|
||||
@@ -98,12 +94,6 @@ class SystemLib {
|
||||
static ObjectData* AllocDOMExceptionObject(CVarRef message,
|
||||
CVarRef code);
|
||||
static ObjectData* AllocDirectoryObject();
|
||||
static ObjectData* AllocRecursiveDirectoryIteratorObject();
|
||||
static ObjectData* AllocSplFileInfoObject(CVarRef filename);
|
||||
static ObjectData* AllocSplFileObjectObject(CVarRef filename,
|
||||
CVarRef open_mode,
|
||||
CVarRef use_include_path,
|
||||
CVarRef context);
|
||||
static ObjectData* AllocPDOExceptionObject();
|
||||
static ObjectData* AllocSoapFaultObject(CVarRef code,
|
||||
CVarRef message,
|
||||
|
||||
+14
-12
@@ -311,7 +311,7 @@ class Status {
|
||||
$start = array('op' => 'start', 'test' => $test);
|
||||
$end = array('op' => 'test_done', 'test' => $test, 'status' => $status);
|
||||
if ($status == 'failed') {
|
||||
$end['details'] = file_get_contents("$test.diff");
|
||||
$end['details'] = @file_get_contents("$test.diff");
|
||||
}
|
||||
self::say($start, $end);
|
||||
}
|
||||
@@ -484,7 +484,9 @@ function main($argv) {
|
||||
|
||||
$threads = min(count($tests), idx($options, 'threads', 20));
|
||||
|
||||
print "Running ".count($tests)." tests in $threads threads\n";
|
||||
if (!isset($options['fbmake'])) {
|
||||
print "Running ".count($tests)." tests in $threads threads\n";
|
||||
}
|
||||
|
||||
# Try to construct the buckets so the test results are ready in approximately
|
||||
# alphabetical order
|
||||
@@ -519,8 +521,16 @@ function main($argv) {
|
||||
$return_value |= pcntl_wexitstatus($status);
|
||||
}
|
||||
|
||||
if (!$return_value) {
|
||||
print "\nAll tests passed.\n\n".<<<SHIP
|
||||
$results = array();
|
||||
foreach ($bad_test_files as $bad_test_file) {
|
||||
$results = array_merge($results,
|
||||
json_decode(file_get_contents($bad_test_file), true));
|
||||
}
|
||||
if (isset($options['fbmake'])) {
|
||||
Status::say(array('op' => 'all_done', 'results' => $results));
|
||||
} else {
|
||||
if (!$return_value) {
|
||||
print "\nAll tests passed.\n\n".<<<SHIP
|
||||
| | |
|
||||
)_) )_) )_)
|
||||
)___))___))___)\
|
||||
@@ -532,14 +542,6 @@ function main($argv) {
|
||||
^^^^ ^^^
|
||||
SHIP
|
||||
."\n";
|
||||
} else {
|
||||
$results = array();
|
||||
foreach ($bad_test_files as $bad_test_file) {
|
||||
$results = array_merge($results,
|
||||
json_decode(file_get_contents($bad_test_file), true));
|
||||
}
|
||||
if (isset($options['fbmake'])) {
|
||||
Status::say(array('op' => 'all_done', 'results' => $results));
|
||||
} else {
|
||||
$failed = array();
|
||||
foreach ($results as $result) {
|
||||
|
||||
@@ -24,30 +24,32 @@ $files = array();
|
||||
// order changes per machine
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
$files[$fileinfo->getFilename()] = $fileinfo;
|
||||
$str = "BEGIN:\n";
|
||||
$name = $fileinfo->getFilename();
|
||||
$str .= $name . "\n";
|
||||
$fileinfo->getCTime() . "\n";
|
||||
$fileinfo->getBasename() . "\n";
|
||||
$fileinfo->getBasename('.cpp') . "\n";
|
||||
$fileinfo->getGroup() . "\n";
|
||||
$fileinfo->getInode() . "\n";
|
||||
$fileinfo->getMTime() . "\n";
|
||||
$fileinfo->getOwner() . "\n";
|
||||
$fileinfo->getPerms() . "\n";
|
||||
$fileinfo->getSize() . "\n";
|
||||
$fileinfo->getType() . "\n";
|
||||
$fileinfo->isDir() . "\n";
|
||||
$fileinfo->isDot() . "\n";
|
||||
$fileinfo->isExecutable() . "\n";
|
||||
$fileinfo->isLink() . "\n";
|
||||
$fileinfo->isReadable() . "\n";
|
||||
$fileinfo->isWritable() . "\n";
|
||||
$str .= "END\n";
|
||||
$files[$name] = $str;
|
||||
}
|
||||
}
|
||||
ksort($files);
|
||||
foreach ($files as $name => $fileinfo) {
|
||||
echo "BEGIN: " . $name . "\n";
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
$fileinfo->getCTime() . "\n";
|
||||
$fileinfo->getBasename() . "\n";
|
||||
$fileinfo->getBasename('.cpp') . "\n";
|
||||
$fileinfo->getGroup() . "\n";
|
||||
$fileinfo->getInode() . "\n";
|
||||
$fileinfo->getMTime() . "\n";
|
||||
$fileinfo->getOwner() . "\n";
|
||||
$fileinfo->getPerms() . "\n";
|
||||
$fileinfo->getSize() . "\n";
|
||||
$fileinfo->getType() . "\n";
|
||||
$fileinfo->isDir() . "\n";
|
||||
$fileinfo->isDot() . "\n";
|
||||
$fileinfo->isExecutable() . "\n";
|
||||
$fileinfo->isLink() . "\n";
|
||||
$fileinfo->isReadable() . "\n";
|
||||
$fileinfo->isWritable() . "\n";
|
||||
echo "END" . "\n";
|
||||
foreach ($files as $str) {
|
||||
echo $str;
|
||||
}
|
||||
|
||||
$iterator = new RecursiveDirectoryIterator($sample_dir);
|
||||
|
||||
@@ -11,17 +11,17 @@ array(5) {
|
||||
[4]=>
|
||||
string(7) "symlink"
|
||||
}
|
||||
BEGIN: empty
|
||||
|
||||
BEGIN:
|
||||
empty
|
||||
END
|
||||
BEGIN: file
|
||||
|
||||
BEGIN:
|
||||
file
|
||||
END
|
||||
BEGIN: fix_mtimes.inc
|
||||
|
||||
BEGIN:
|
||||
fix_mtimes.inc
|
||||
END
|
||||
BEGIN: symlink
|
||||
|
||||
BEGIN:
|
||||
symlink
|
||||
END
|
||||
empty
|
||||
file
|
||||
|
||||
@@ -37,8 +37,9 @@ foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
// invalid mode -100$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
// new RecursiveDirectoryIterator($directory), -100);
|
||||
// invalid mode -100
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory), -100);
|
||||
$files = array();
|
||||
// order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
@@ -47,3 +48,19 @@ foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
// two foreaches
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory));
|
||||
$files = array();
|
||||
// order changes per machine
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
foreach( $fileSPLObjects as $fullFileName => $fileSPLObject ) {
|
||||
if (substr($fullFileName,-1)=='.') continue;
|
||||
$files[] = $fullFileName . " " .$fileSPLObject->getFilename(). "\n";
|
||||
}
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
@@ -57,7 +57,7 @@ array(5) {
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
string(%d) "%s/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
@@ -72,3 +72,35 @@ array(5) {
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(10) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[5]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[6]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[7]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[8]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
[9]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
function getFiles(&$rdi,$depth=0) {
|
||||
if (!is_object($rdi)) return;
|
||||
$files = array();
|
||||
// order changes per machine
|
||||
for ($rdi->rewind();
|
||||
$rdi->valid();
|
||||
$rdi->next()) {
|
||||
// order changes per machine
|
||||
for ($rdi->rewind(); $rdi->valid(); $rdi->next()) {
|
||||
if ($rdi->isDot()) continue;
|
||||
if ($rdi->isDir() || $rdi->isFile()) {
|
||||
$indent = '';
|
||||
for ($i = 0;
|
||||
$i<=$depth;
|
||||
++$i) $indent .= " ";
|
||||
for ($i = 0; $i<=$depth; ++$i) $indent .= " ";
|
||||
$files[] = $indent.$rdi->current()."\n";
|
||||
if ($rdi->hasChildren()) getFiles($rdi->getChildren(),1+$depth);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
Caught exception: Unable to read link does-not-exist-will-fail-on-getLinkTarget, error: no such file or directory
|
||||
Caught exception: Unable to read link does-not-exist-will-fail-on-getLinkTarget
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#include "hphp/test/test_ext_imap.h"
|
||||
#include "hphp/test/test_ext_intl.h"
|
||||
#include "hphp/test/test_ext_ipc.h"
|
||||
#include "hphp/test/test_ext_iterator.h"
|
||||
#include "hphp/test/test_ext_json.h"
|
||||
#include "hphp/test/test_ext_ldap.h"
|
||||
#include "hphp/test/test_ext_magick.h"
|
||||
@@ -77,7 +76,6 @@
|
||||
#include "hphp/test/test_ext_soap.h"
|
||||
#include "hphp/test/test_ext_socket.h"
|
||||
#include "hphp/test/test_ext_spl.h"
|
||||
#include "hphp/test/test_ext_splfile.h"
|
||||
#include "hphp/test/test_ext_sqlite3.h"
|
||||
#include "hphp/test/test_ext_stream.h"
|
||||
#include "hphp/test/test_ext_string.h"
|
||||
|
||||
@@ -32,7 +32,6 @@ RUN_TESTSUITE(TestExtImagesprite);
|
||||
RUN_TESTSUITE(TestExtImap);
|
||||
RUN_TESTSUITE(TestExtIntl);
|
||||
RUN_TESTSUITE(TestExtIpc);
|
||||
RUN_TESTSUITE(TestExtIterator);
|
||||
RUN_TESTSUITE(TestExtJson);
|
||||
RUN_TESTSUITE(TestExtLdap);
|
||||
RUN_TESTSUITE(TestExtMagick);
|
||||
@@ -59,7 +58,6 @@ RUN_TESTSUITE(TestExtSimplexml);
|
||||
RUN_TESTSUITE(TestExtSoap);
|
||||
RUN_TESTSUITE(TestExtSocket);
|
||||
RUN_TESTSUITE(TestExtSpl);
|
||||
RUN_TESTSUITE(TestExtSplfile);
|
||||
RUN_TESTSUITE(TestExtSqlite3);
|
||||
RUN_TESTSUITE(TestExtStream);
|
||||
RUN_TESTSUITE(TestExtString);
|
||||
|
||||
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "hphp/test/test_ext_iterator.h"
|
||||
#include "hphp/runtime/ext/ext_iterator.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtIterator::RunTests(const std::string &which) {
|
||||
bool ret = true;
|
||||
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator___construct);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_getinneriterator);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_current);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_key);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_next);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_rewind);
|
||||
RUN_TEST(test_hphp_recursiveiteratoriterator_valid);
|
||||
RUN_TEST(test_hphp_directoryiterator___construct);
|
||||
RUN_TEST(test_hphp_directoryiterator_getatime);
|
||||
RUN_TEST(test_hphp_directoryiterator_getbasename);
|
||||
RUN_TEST(test_hphp_directoryiterator_getctime);
|
||||
RUN_TEST(test_hphp_directoryiterator_getfilename);
|
||||
RUN_TEST(test_hphp_directoryiterator_getgroup);
|
||||
RUN_TEST(test_hphp_directoryiterator_getinode);
|
||||
RUN_TEST(test_hphp_directoryiterator_getmtime);
|
||||
RUN_TEST(test_hphp_directoryiterator_getowner);
|
||||
RUN_TEST(test_hphp_directoryiterator_getpathname);
|
||||
RUN_TEST(test_hphp_directoryiterator_getperms);
|
||||
RUN_TEST(test_hphp_directoryiterator_getsize);
|
||||
RUN_TEST(test_hphp_directoryiterator_gettype);
|
||||
RUN_TEST(test_hphp_directoryiterator_isdir);
|
||||
RUN_TEST(test_hphp_directoryiterator_isdot);
|
||||
RUN_TEST(test_hphp_directoryiterator_isexecutable);
|
||||
RUN_TEST(test_hphp_directoryiterator_isfile);
|
||||
RUN_TEST(test_hphp_directoryiterator_islink);
|
||||
RUN_TEST(test_hphp_directoryiterator_isreadable);
|
||||
RUN_TEST(test_hphp_directoryiterator_iswritable);
|
||||
RUN_TEST(test_hphp_directoryiterator_key);
|
||||
RUN_TEST(test_hphp_directoryiterator_next);
|
||||
RUN_TEST(test_hphp_directoryiterator_rewind);
|
||||
RUN_TEST(test_hphp_directoryiterator_seek);
|
||||
RUN_TEST(test_hphp_directoryiterator_current);
|
||||
RUN_TEST(test_hphp_directoryiterator___tostring);
|
||||
RUN_TEST(test_hphp_directoryiterator_valid);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator___construct);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_key);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_next);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_rewind);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_seek);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_current);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator___tostring);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_valid);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_haschildren);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_getchildren);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_getsubpath);
|
||||
RUN_TEST(test_hphp_recursivedirectoryiterator_getsubpathname);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator___construct() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_getinneriterator() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_current() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_key() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_next() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_rewind() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursiveiteratoriterator_valid() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator___construct() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getatime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getbasename() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getctime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getfilename() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getgroup() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getinode() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getmtime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getowner() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getpathname() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getperms() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_getsize() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_gettype() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_isdir() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_isdot() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_isexecutable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_isfile() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_islink() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_isreadable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_iswritable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_key() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_next() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_rewind() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_seek() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_current() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator___tostring() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_directoryiterator_valid() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator___construct() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_key() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_next() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_rewind() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_seek() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_current() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator___tostring() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_valid() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_haschildren() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_getchildren() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_getsubpath() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtIterator::test_hphp_recursivedirectoryiterator_getsubpathname() {
|
||||
return Count(true);
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef incl_HPHP_TEST_EXT_ITERATOR_H_
|
||||
#define incl_HPHP_TEST_EXT_ITERATOR_H_
|
||||
|
||||
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
||||
|
||||
#include "hphp/test/test_cpp_ext.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TestExtIterator : public TestCppExt {
|
||||
public:
|
||||
virtual bool RunTests(const std::string &which);
|
||||
|
||||
bool test_hphp_recursiveiteratoriterator___construct();
|
||||
bool test_hphp_recursiveiteratoriterator_getinneriterator();
|
||||
bool test_hphp_recursiveiteratoriterator_current();
|
||||
bool test_hphp_recursiveiteratoriterator_key();
|
||||
bool test_hphp_recursiveiteratoriterator_next();
|
||||
bool test_hphp_recursiveiteratoriterator_rewind();
|
||||
bool test_hphp_recursiveiteratoriterator_valid();
|
||||
bool test_hphp_directoryiterator___construct();
|
||||
bool test_hphp_directoryiterator_getatime();
|
||||
bool test_hphp_directoryiterator_getbasename();
|
||||
bool test_hphp_directoryiterator_getctime();
|
||||
bool test_hphp_directoryiterator_getfilename();
|
||||
bool test_hphp_directoryiterator_getgroup();
|
||||
bool test_hphp_directoryiterator_getinode();
|
||||
bool test_hphp_directoryiterator_getmtime();
|
||||
bool test_hphp_directoryiterator_getowner();
|
||||
bool test_hphp_directoryiterator_getpathname();
|
||||
bool test_hphp_directoryiterator_getperms();
|
||||
bool test_hphp_directoryiterator_getsize();
|
||||
bool test_hphp_directoryiterator_gettype();
|
||||
bool test_hphp_directoryiterator_isdir();
|
||||
bool test_hphp_directoryiterator_isdot();
|
||||
bool test_hphp_directoryiterator_isexecutable();
|
||||
bool test_hphp_directoryiterator_isfile();
|
||||
bool test_hphp_directoryiterator_islink();
|
||||
bool test_hphp_directoryiterator_isreadable();
|
||||
bool test_hphp_directoryiterator_iswritable();
|
||||
bool test_hphp_directoryiterator_key();
|
||||
bool test_hphp_directoryiterator_next();
|
||||
bool test_hphp_directoryiterator_rewind();
|
||||
bool test_hphp_directoryiterator_seek();
|
||||
bool test_hphp_directoryiterator_current();
|
||||
bool test_hphp_directoryiterator___tostring();
|
||||
bool test_hphp_directoryiterator_valid();
|
||||
bool test_hphp_recursivedirectoryiterator___construct();
|
||||
bool test_hphp_recursivedirectoryiterator_key();
|
||||
bool test_hphp_recursivedirectoryiterator_next();
|
||||
bool test_hphp_recursivedirectoryiterator_rewind();
|
||||
bool test_hphp_recursivedirectoryiterator_seek();
|
||||
bool test_hphp_recursivedirectoryiterator_current();
|
||||
bool test_hphp_recursivedirectoryiterator___tostring();
|
||||
bool test_hphp_recursivedirectoryiterator_valid();
|
||||
bool test_hphp_recursivedirectoryiterator_haschildren();
|
||||
bool test_hphp_recursivedirectoryiterator_getchildren();
|
||||
bool test_hphp_recursivedirectoryiterator_getsubpath();
|
||||
bool test_hphp_recursivedirectoryiterator_getsubpathname();
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // incl_HPHP_TEST_EXT_ITERATOR_H_
|
||||
@@ -105,7 +105,6 @@ bool TestExtOptions::test_dl() {
|
||||
bool TestExtOptions::test_extension_loaded() {
|
||||
VERIFY(f_extension_loaded("phpmcc"));
|
||||
VERIFY(f_extension_loaded("bcmath"));
|
||||
VERIFY(f_extension_loaded("spl"));
|
||||
VERIFY(f_extension_loaded("curl"));
|
||||
VERIFY(f_extension_loaded("simplexml"));
|
||||
VERIFY(f_extension_loaded("mysql"));
|
||||
|
||||
@@ -1,304 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "hphp/test/test_ext_splfile.h"
|
||||
#include "hphp/runtime/ext/ext_splfile.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtSplfile::RunTests(const std::string &which) {
|
||||
bool ret = true;
|
||||
|
||||
RUN_TEST(test_hphp_splfileinfo___construct);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_atime);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_basename);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_ctime);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_fileinfo);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_filename);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_group);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_inode);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_linktarget);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_mtime);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_owner);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_path);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_pathinfo);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_pathname);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_perms);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_realpath);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_size);
|
||||
RUN_TEST(test_hphp_splfileinfo_get_type);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_dir);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_executable);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_file);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_link);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_readable);
|
||||
RUN_TEST(test_hphp_splfileinfo_is_writable);
|
||||
RUN_TEST(test_hphp_splfileinfo_open_file);
|
||||
RUN_TEST(test_hphp_splfileinfo_set_file_class);
|
||||
RUN_TEST(test_hphp_splfileinfo_set_info_class);
|
||||
RUN_TEST(test_hphp_splfileinfo___tostring);
|
||||
RUN_TEST(test_hphp_splfileobject___construct);
|
||||
RUN_TEST(test_hphp_splfileobject_current);
|
||||
RUN_TEST(test_hphp_splfileobject_eof);
|
||||
RUN_TEST(test_hphp_splfileobject_fflush);
|
||||
RUN_TEST(test_hphp_splfileobject_fgetc);
|
||||
RUN_TEST(test_hphp_splfileobject_fgetcsv);
|
||||
RUN_TEST(test_hphp_splfileobject_fgets);
|
||||
RUN_TEST(test_hphp_splfileobject_fgetss);
|
||||
RUN_TEST(test_hphp_splfileobject_flock);
|
||||
RUN_TEST(test_hphp_splfileobject_fpassthru);
|
||||
RUN_TEST(test_hphp_splfileobject_fscanf);
|
||||
RUN_TEST(test_hphp_splfileobject_fseek);
|
||||
RUN_TEST(test_hphp_splfileobject_fstat);
|
||||
RUN_TEST(test_hphp_splfileobject_ftell);
|
||||
RUN_TEST(test_hphp_splfileobject_ftruncate);
|
||||
RUN_TEST(test_hphp_splfileobject_fwrite);
|
||||
RUN_TEST(test_hphp_splfileobject_get_cvscontrol);
|
||||
RUN_TEST(test_hphp_splfileobject_get_flags);
|
||||
RUN_TEST(test_hphp_splfileobject_get_maxlinelen);
|
||||
RUN_TEST(test_hphp_splfileobject_haschildren);
|
||||
RUN_TEST(test_hphp_splfileobject_key);
|
||||
RUN_TEST(test_hphp_splfileobject_next);
|
||||
RUN_TEST(test_hphp_splfileobject_rewind);
|
||||
RUN_TEST(test_hphp_splfileobject_seek);
|
||||
RUN_TEST(test_hphp_splfileobject_setcsvcontrol);
|
||||
RUN_TEST(test_hphp_splfileobject_set_flags);
|
||||
RUN_TEST(test_hphp_splfileobject_set_maxlinelen);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo___construct() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_atime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_basename() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_ctime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_fileinfo() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_filename() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_group() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_inode() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_linktarget() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_mtime() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_owner() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_path() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_pathinfo() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_pathname() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_perms() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_realpath() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_size() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_get_type() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_dir() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_executable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_file() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_link() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_readable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_is_writable() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_open_file() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_set_file_class() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo_set_info_class() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileinfo___tostring() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject___construct() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_current() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_eof() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fflush() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fgetc() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fgetcsv() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fgets() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fgetss() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_flock() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fpassthru() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fscanf() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fseek() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fstat() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_ftell() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_ftruncate() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_fwrite() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_get_cvscontrol() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_get_flags() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_get_maxlinelen() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_haschildren() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_key() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_next() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_rewind() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_seek() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_setcsvcontrol() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_set_flags() {
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtSplfile::test_hphp_splfileobject_set_maxlinelen() {
|
||||
return Count(true);
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| HipHop for PHP |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef incl_HPHP_TEST_EXT_SPLFILE_H_
|
||||
#define incl_HPHP_TEST_EXT_SPLFILE_H_
|
||||
|
||||
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
||||
|
||||
#include "hphp/test/test_cpp_ext.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TestExtSplfile : public TestCppExt {
|
||||
public:
|
||||
virtual bool RunTests(const std::string &which);
|
||||
|
||||
bool test_hphp_splfileinfo___construct();
|
||||
bool test_hphp_splfileinfo_get_atime();
|
||||
bool test_hphp_splfileinfo_get_basename();
|
||||
bool test_hphp_splfileinfo_get_ctime();
|
||||
bool test_hphp_splfileinfo_get_fileinfo();
|
||||
bool test_hphp_splfileinfo_get_filename();
|
||||
bool test_hphp_splfileinfo_get_group();
|
||||
bool test_hphp_splfileinfo_get_inode();
|
||||
bool test_hphp_splfileinfo_get_linktarget();
|
||||
bool test_hphp_splfileinfo_get_mtime();
|
||||
bool test_hphp_splfileinfo_get_owner();
|
||||
bool test_hphp_splfileinfo_get_path();
|
||||
bool test_hphp_splfileinfo_get_pathinfo();
|
||||
bool test_hphp_splfileinfo_get_pathname();
|
||||
bool test_hphp_splfileinfo_get_perms();
|
||||
bool test_hphp_splfileinfo_get_realpath();
|
||||
bool test_hphp_splfileinfo_get_size();
|
||||
bool test_hphp_splfileinfo_get_type();
|
||||
bool test_hphp_splfileinfo_is_dir();
|
||||
bool test_hphp_splfileinfo_is_executable();
|
||||
bool test_hphp_splfileinfo_is_file();
|
||||
bool test_hphp_splfileinfo_is_link();
|
||||
bool test_hphp_splfileinfo_is_readable();
|
||||
bool test_hphp_splfileinfo_is_writable();
|
||||
bool test_hphp_splfileinfo_open_file();
|
||||
bool test_hphp_splfileinfo_set_file_class();
|
||||
bool test_hphp_splfileinfo_set_info_class();
|
||||
bool test_hphp_splfileinfo___tostring();
|
||||
bool test_hphp_splfileobject___construct();
|
||||
bool test_hphp_splfileobject_current();
|
||||
bool test_hphp_splfileobject_eof();
|
||||
bool test_hphp_splfileobject_fflush();
|
||||
bool test_hphp_splfileobject_fgetc();
|
||||
bool test_hphp_splfileobject_fgetcsv();
|
||||
bool test_hphp_splfileobject_fgets();
|
||||
bool test_hphp_splfileobject_fgetss();
|
||||
bool test_hphp_splfileobject_flock();
|
||||
bool test_hphp_splfileobject_fpassthru();
|
||||
bool test_hphp_splfileobject_fscanf();
|
||||
bool test_hphp_splfileobject_fseek();
|
||||
bool test_hphp_splfileobject_fstat();
|
||||
bool test_hphp_splfileobject_ftell();
|
||||
bool test_hphp_splfileobject_ftruncate();
|
||||
bool test_hphp_splfileobject_fwrite();
|
||||
bool test_hphp_splfileobject_get_cvscontrol();
|
||||
bool test_hphp_splfileobject_get_flags();
|
||||
bool test_hphp_splfileobject_get_maxlinelen();
|
||||
bool test_hphp_splfileobject_haschildren();
|
||||
bool test_hphp_splfileobject_key();
|
||||
bool test_hphp_splfileobject_next();
|
||||
bool test_hphp_splfileobject_rewind();
|
||||
bool test_hphp_splfileobject_seek();
|
||||
bool test_hphp_splfileobject_setcsvcontrol();
|
||||
bool test_hphp_splfileobject_set_flags();
|
||||
bool test_hphp_splfileobject_set_maxlinelen();
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // incl_HPHP_TEST_EXT_SPLFILE_H_
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$file = md5('SplFileInfo::getExtension');
|
||||
$exts = array('.txt', '.extension', '..', '.', '');
|
||||
foreach ($exts as $ext) {
|
||||
touch($file . $ext);
|
||||
$info = new SplFileInfo($file . $ext);
|
||||
var_dump($info->getExtension(), pathinfo($file . $ext, PATHINFO_EXTENSION));
|
||||
}
|
||||
?><?php
|
||||
$file = md5('SplFileInfo::getExtension');
|
||||
$exts = array('.txt', '.extension', '..', '.', '');
|
||||
foreach ($exts as $ext) {
|
||||
unlink($file . $ext);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
string(3) "txt"
|
||||
string(3) "txt"
|
||||
string(9) "extension"
|
||||
string(9) "extension"
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_escape_basic.csv', 'w+');
|
||||
fwrite($fp, '"aaa","b""bb","ccc"');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_escape_basic.csv');
|
||||
var_dump($fo->fgetcsv(',', '"', '"'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_escape_basic.csv');
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "aaa"
|
||||
[1]=>
|
||||
string(4) "b"bb"
|
||||
[2]=>
|
||||
string(3) "ccc"
|
||||
}
|
||||
@@ -13,7 +13,8 @@ $delim = ";";
|
||||
$enclosure ="\"";
|
||||
var_dump( $fo->fputcsv($fields, $delim, $enclosure, $fo) );
|
||||
|
||||
echo "Done\n";<?php
|
||||
echo "Done\n";?>
|
||||
<?php
|
||||
$file = __DIR__ . '/SplFileObject_fputcsv.csv';
|
||||
unlink($file);
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
file_put_contents('testdata.csv', 'eerste;tweede;derde');
|
||||
|
||||
$fo = new SplFileObject('testdata.csv');
|
||||
$fo->setFlags(SplFileObject::READ_CSV);
|
||||
|
||||
$fo->getFlags('fake');
|
||||
|
||||
?><?php
|
||||
unlink('testdata.csv');
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
file_put_contents('testdata.csv', 'eerste;tweede;derde');
|
||||
|
||||
$fo = new SplFileObject('testdata.csv');
|
||||
|
||||
$fo->rewind( "invalid" );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
file_put_contents('csv_control_data.csv',
|
||||
<<<CDATA
|
||||
'groene appelen'|10
|
||||
'gele bananen'|20
|
||||
'rode kersen'|30
|
||||
CDATA
|
||||
);
|
||||
$s = new SplFileObject('csv_control_data.csv');
|
||||
$s->setFlags(SplFileObject::READ_CSV);
|
||||
$s->setCsvControl('|', '\'', '/');
|
||||
foreach ($s as $row) {
|
||||
list($fruit, $quantity) = $row;
|
||||
echo "$fruit : $quantity\n";
|
||||
}
|
||||
?><?php
|
||||
unlink('csv_control_data.csv');
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
groene appelen : 10
|
||||
gele bananen : 20
|
||||
rode kersen : 30
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
file_put_contents('csv_control_data.csv',
|
||||
<<<CDATA
|
||||
'groene appelen'|10
|
||||
'gele bananen'|20
|
||||
'rode kersen'|30
|
||||
CDATA
|
||||
);
|
||||
$s = new SplFileObject('csv_control_data.csv');
|
||||
$s->setFlags(SplFileObject::READ_CSV);
|
||||
$s->setCsvControl('||');
|
||||
?><?php
|
||||
unlink('csv_control_data.csv');
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
HipHop Warning: %a
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
file_put_contents('csv_control_data.csv',
|
||||
<<<CDATA
|
||||
'groene appelen'|10
|
||||
'gele bananen'|20
|
||||
'rode kersen'|30
|
||||
CDATA
|
||||
);
|
||||
$s = new SplFileObject('csv_control_data.csv');
|
||||
$s->setFlags(SplFileObject::READ_CSV);
|
||||
$s->setCsvControl('|', 'two');
|
||||
?><?php
|
||||
unlink('csv_control_data.csv');
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
HipHop Warning: %a
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
file_put_contents('csv_control_data.csv',
|
||||
<<<CDATA
|
||||
"groene appelen",10
|
||||
"gele bananen",20
|
||||
"rode kersen",30
|
||||
CDATA
|
||||
);
|
||||
$s = new SplFileObject('csv_control_data.csv');
|
||||
$s->setFlags(SplFileObject::READ_CSV);
|
||||
$s->setCsvControl();
|
||||
foreach ($s as $row) {
|
||||
list($fruit, $quantity) = $row;
|
||||
echo "$fruit : $quantity\n";
|
||||
}
|
||||
?><?php
|
||||
unlink('csv_control_data.csv');
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
groene appelen : 10
|
||||
gele bananen : 20
|
||||
rode kersen : 30
|
||||
@@ -10,5 +10,4 @@ zero=>0
|
||||
one=>1
|
||||
two=>2
|
||||
===Append===
|
||||
|
||||
HipHop Fatal error: %a
|
||||
@@ -19,7 +19,8 @@ $fo->fwrite("blahlubba");
|
||||
var_dump($fo->ftruncate());
|
||||
|
||||
?>
|
||||
==DONE==<?php
|
||||
==DONE==?>
|
||||
<?php
|
||||
$path = dirname(__FILE__).DIRECTORY_SEPARATOR.'fileobject_005.txt';
|
||||
unlink($path);
|
||||
?>
|
||||
@@ -1,4 +0,0 @@
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -1,5 +0,0 @@
|
||||
*** Test substituting argument 1 with boolean values ***
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,6 +0,0 @@
|
||||
*** Test substituting argument 1 with float values ***
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_basic.csv', 'w+');
|
||||
fputcsv($fp, array(
|
||||
'field1',
|
||||
'field2',
|
||||
'field3',
|
||||
5
|
||||
));
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_basic.csv');
|
||||
var_dump($fo->fgetcsv());
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_basic.csv');
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(6) "field1"
|
||||
[1]=>
|
||||
string(6) "field2"
|
||||
[2]=>
|
||||
string(6) "field3"
|
||||
[3]=>
|
||||
string(1) "5"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_delimiter_basic.csv', 'w+');
|
||||
fputcsv($fp, array(
|
||||
'field1',
|
||||
'field2',
|
||||
'field3',
|
||||
5
|
||||
), '|');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_delimiter_basic.csv');
|
||||
var_dump($fo->fgetcsv('|'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_delimiter_basic.csv');
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(6) "field1"
|
||||
[1]=>
|
||||
string(6) "field2"
|
||||
[2]=>
|
||||
string(6) "field3"
|
||||
[3]=>
|
||||
string(1) "5"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_delimiter_error.csv', 'w+');
|
||||
fputcsv($fp, array(
|
||||
'field1',
|
||||
'field2',
|
||||
'field3',
|
||||
5
|
||||
), '|');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_delimiter_error.csv');
|
||||
var_dump($fo->fgetcsv('invalid'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_delimiter_error.csv');
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_enclosure_basic.csv', 'w+');
|
||||
fputcsv($fp, array(
|
||||
'field1',
|
||||
'field2',
|
||||
'field3',
|
||||
5
|
||||
), ',', '"');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_enclosure_basic.csv');
|
||||
var_dump($fo->fgetcsv(',', '"'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_enclosure_basic.csv');
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(6) "field1"
|
||||
[1]=>
|
||||
string(6) "field2"
|
||||
[2]=>
|
||||
string(6) "field3"
|
||||
[3]=>
|
||||
string(1) "5"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_enclosure_error.csv', 'w+');
|
||||
fputcsv($fp, array(
|
||||
'field1',
|
||||
'field2',
|
||||
'field3',
|
||||
5
|
||||
), ',', '"');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_enclosure_error.csv');
|
||||
var_dump($fo->fgetcsv(',', 'invalid'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_enclosure_error.csv');
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_escape_default.csv', 'w+');
|
||||
fwrite($fp, '"aa\"","bb","\"c"');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_escape_default.csv');
|
||||
var_dump($fo->fgetcsv());
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_escape_default.csv');
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(4) "aa\""
|
||||
[1]=>
|
||||
string(2) "bb"
|
||||
[2]=>
|
||||
string(3) "\"c"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$fp = fopen('SplFileObject_fgetcsv_escape_error.csv', 'w+');
|
||||
fwrite($fp, '"aaa","b""bb","ccc"');
|
||||
fclose($fp);
|
||||
|
||||
$fo = new SplFileObject('SplFileObject_fgetcsv_escape_error.csv');
|
||||
var_dump($fo->fgetcsv(',', '"', 'invalid'));
|
||||
?><?php
|
||||
unlink('SplFileObject_fgetcsv_escape_error.csv');
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário