Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable runkit_import, supporting a subset of the flags #73

Closed
TysonAndre opened this issue Feb 7, 2017 · 3 comments
Closed

Re-enable runkit_import, supporting a subset of the flags #73

TysonAndre opened this issue Feb 7, 2017 · 3 comments

Comments

@TysonAndre
Copy link
Member

TysonAndre commented Feb 7, 2017

This was temporarily disabled because it depended on redefining properties of objects (instances), which was impractical in php 7.0+.
However, importing classes and functions which don't already exist should be possible. The code hasn't yet been ported to compile with the php 7.0 data structures and APIs, and may have to be restored from git.

If RUNKIT_IMPORT_OVERRIDE is enabled, then when combined with the below flags:

  • RUNKIT_IMPORT_CLASS_PROPS - Likely not possible if instances already exist. (By extension, RUNKIT_IMPORT_CLASSES isn't possible)
  • RUNKIT_IMPORT_CLASS_STATIC_PROPS - Have to investigate how the PHP interpreter handles accesses to static properties --- It's similar to instance properties. The property names are converted to indices, and C code knowing the index can quickly access those properties(for internal functions).
  • RUNKIT_IMPORT_FUNCTIONS, RUNKIT_IMPORT_CLASS_METHODS, RUNKIT_IMPORT_CLASS_CONSTS: doable?

If RUNKIT_IMPORT_OVERRIDE is disabled, then any of the other flags can probably be used

  • But in the case with no overrides, one may be able to do something similar using PHP-Parser and php-ast to extract only the top-level class/function definitions.

See #72

EDIT: earlier description mixed up constants.

@amoydavid
Copy link

I builded up with the current branch of work-on-runkit_import, but got a warning when I run a php script in console:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/runkit.so' - /usr/lib64/php/modules/runkit.so: undefined symbol: php_runkit_def_prop_add_int in Unknown on line 0

@TysonAndre
Copy link
Member Author

That branch is a work in progress. I'm aware that it doesn't compile yet, which is why this issue didn't link to it yet.

@TysonAndre
Copy link
Member Author

This branch has been merged to master, open new issues for any bugs or requests for support for different flags. undefined symbol: php_runkit_def_prop_add_int was fixed.

  • Property manipulation is unsupported, even for classes that didn't previously exist. If the class is brand new, it should be easier to support in future runkit releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants