PHP RFC: Module API Inspection
- Version: 1.0
- Date: 2014-01-24
- Author: Sara Golemon, email@example.com
- Status: Inactive
- First Published at: http://wiki.php.net/rfc/moduleapi-inspection
Was asked at PHPBenelux about being able to tell what PHP version a given module is loadable in (given only the .so). Since the answer came down to “Try it and see if it works”, I thought something more formal would be nice.
Add zend module api introspection to php-cli as two new command line switches
`--apino` option: Outputs PHP's compiled Zend Module API info:
$ sapi/cli/php --apino ZEND_MODULE_API_NO: 20131227 ZEND_DEBUG: enabled ZTS: enabled
`--modinfo /path/to/module.so` Options: Loads the .so (without attempting to register it as an extension) and output the corresponding Zend Module API info the module was compiled with.
$ sapi/cli/php --modinfo /usr/libexec/php/hello.so ZEND_MODULE_API_NO: 20121212 ZEND_DEBUG: disabled ZTS: disabled
Backward Incompatible Changes
Very old zend_module_entry versions have slightly different module headers. I addressed this by putting a bottom limit on the Zend Module API Version I'll look at which corresponds to 5.0. In earlier versions only the high-level API version number is shown.
Proposed PHP Version(s)
Unaffected PHP Functionality
This doesn't impact the engine or runtime at all. It's just a set of options for the command line sapi which dump some info and exit.