forked from runkit7/runkit7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - resurrecting runkit import and property manipulation
TODO: tests/runkit_add_old_style_ctor_by_importing.inc segfaults Work on getting runkit_import.c to compile, add runkit_import to functions declared by runkit
- Loading branch information
1 parent
7f34657
commit ffcb3bc
Showing
7 changed files
with
364 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
| http://www.opensource.org/licenses/BSD-3-Clause | | ||
| If you did not receive a copy of the license and are unable to | | ||
| obtain it through the world-wide-web, please send a note to | | ||
| [email protected] so we can mail you a copy immediately. | | ||
| [email protected] so we can mail you a copy immediately. | | ||
+----------------------------------------------------------------------+ | ||
| Author: Sara Golemon <[email protected]> | | ||
| Modified by Dmitry Zenovich <[email protected]> | | ||
|
@@ -203,11 +203,9 @@ zend_function_entry runkit_functions[] = { | |
#endif | ||
|
||
#ifdef PHP_RUNKIT_MANIPULATION | ||
#ifdef PHP_RUNKIT_MANIPULATION_CLASSES | ||
// PHP_FE(runkit_class_emancipate, NULL) | ||
// PHP_FE(runkit_class_adopt, NULL) | ||
#ifdef PHP_RUNKIT_MANIPULATION_IMPORT | ||
PHP_FE(runkit_import, NULL) | ||
#endif | ||
// PHP_FE(runkit_import, NULL) | ||
|
||
PHP_FE(runkit_function_add, arginfo_runkit_function_add) | ||
PHP_FE(runkit_function_remove, arginfo_runkit_function_remove) | ||
|
@@ -227,16 +225,25 @@ zend_function_entry runkit_functions[] = { | |
PHP_FALIAS(classkit_method_remove, runkit_method_remove, arginfo_runkit_method_remove) | ||
PHP_FALIAS(classkit_method_rename, runkit_method_rename, arginfo_runkit_method_rename) | ||
PHP_FALIAS(classkit_method_copy, runkit_method_copy, arginfo_runkit_method_copy) | ||
PHP_FALIAS(classkit_import, runkit_import, arginfo_runkit_import) | ||
#endif | ||
|
||
PHP_FE(runkit_constant_redefine, arginfo_runkit_constant_redefine) | ||
PHP_FE(runkit_constant_remove, arginfo_runkit_constant_remove) | ||
PHP_FE(runkit_constant_add, arginfo_runkit_constant_add) | ||
|
||
// PHP_FE(runkit_default_property_add, NULL) | ||
// PHP_FE(runkit_default_property_remove, NULL) | ||
#ifdef PHP_RUNKIT_MANIPULATION_PROPERTIES | ||
PHP_FE(runkit_default_property_add, NULL) | ||
PHP_FE(runkit_default_property_remove, NULL) | ||
#endif | ||
#endif /* PHP_RUNKIT_MANIPULATION */ | ||
|
||
#ifdef PHP_RUNKIT_SANDBOX | ||
PHP_FE(runkit_sandbox_output_handler, NULL) | ||
PHP_FE(runkit_lint, NULL) | ||
PHP_FE(runkit_lint_file, NULL) | ||
#endif | ||
|
||
{NULL, NULL, NULL} | ||
}; | ||
/* }}} */ | ||
|
@@ -433,7 +440,8 @@ static void php_runkit_register_auto_global(char *s, int len TSRMLS_DC) | |
ALLOC_HASHTABLE(RUNKIT_G(superglobals)); | ||
zend_hash_init(RUNKIT_G(superglobals), 2, NULL, NULL, 0); | ||
} | ||
// Insert a different but equivalent zend_string into the map for function runkit_superglobals(), | ||
// Insert a different but equivalent zend_string (superglobal name) | ||
// into the list for function runkit_superglobals(), | ||
// to make reasoning about reference tracking easier. | ||
ZVAL_NEW_STR(&z, zend_string_init(s, len, 1)); | ||
zend_hash_next_index_insert(RUNKIT_G(superglobals), &z); | ||
|
@@ -508,9 +516,9 @@ static int php_runkit_superglobal_dtor(zval *zv TSRMLS_DC) | |
*/ | ||
PHP_RSHUTDOWN_FUNCTION(runkit) | ||
{ | ||
#ifdef PHP_RUNKIT_MANIPULATION | ||
// #ifdef PHP_RUNKIT_MANIPULATION | ||
// php_runkit_default_class_members_list_element *el; | ||
#endif | ||
// #endif | ||
|
||
#ifdef PHP_RUNKIT_SUPERGLOBALS | ||
if (RUNKIT_G(superglobals)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.