diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-13 22:47:44 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-13 22:47:44 +0100 |
commit | e14d8c6f985aeaeb247387b51d6ec027655efb99 (patch) | |
tree | af2baf1e73668fe994bb6254a35b507b664f2fc0 /zend/super.cpp | |
parent | 75944e3e755053bc2ebe9a2a8c55575941f79a56 (diff) |
in response to issue #156: the super-global arrays Php::POST, Php::SERVER, etcetera can now be iterated over, and they can be assigned to a regular Php::Value variable
Diffstat (limited to 'zend/super.cpp')
-rw-r--r-- | zend/super.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/zend/super.cpp b/zend/super.cpp index a2fa0a9..ea690fe 100644 --- a/zend/super.cpp +++ b/zend/super.cpp @@ -23,33 +23,10 @@ Super FILES (TRACK_VARS_FILES, "_FILES"); Super REQUEST (TRACK_VARS_REQUEST, "_REQUEST"); /** - * Array access operator - * This can be used for accessing associative arrays - * @param key + * Convert object to a value * @return Value */ -Value Super::operator[](const std::string &key) -{ - // we need the tsrm_ls pointer - TSRMLS_FETCH(); - - // call zend_is_auto_global to ensure that the just-in-time globals are loaded - if (_name) { zend_is_auto_global(_name, ::strlen(_name) TSRMLS_CC); _name = nullptr; } - - // create a value object that wraps around the actual zval - Value value(PG(http_globals)[_index]); - - // pass on the call - return value.get(key); -} - -/** - * Array access operator - * This can be used for accessing associative arrays - * @param key - * @return Value - */ -Value Super::operator[](const char *key) +Value Super::value() { // we need the tsrm_ls pointer TSRMLS_FETCH(); @@ -58,10 +35,7 @@ Value Super::operator[](const char *key) if (_name) { zend_is_auto_global(_name, ::strlen(_name) TSRMLS_CC); _name = nullptr; } // create a value object that wraps around the actual zval - Value value(PG(http_globals)[_index]); - - // pass on the call - return value.get(key); + return Value(PG(http_globals)[_index]); } /** |