Hi,
I'm currently writing a shared extension thta depends on another shared
extension (igbinary). "make test" doesn't handle this at the moment,
because it removes every extension= line from it's temporary php.ini.
This means that the dependent extension (igbinary) now isn't loaded,
which means my extension doesn't load either and obviously all the tests
fail.
I've attached a patch that adds a new --EXTENSIONS-- section to the PHPT
format. The run-tests.php script makes sure that all extensions in that
last are added to the PHP command with -dextension=... , but only if
they're not build in (or already loaded in some other way).
The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and trunk
some time soon.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Hi,
I'm currently writing a shared extension thta depends on another shared
extension (igbinary). "make test" doesn't handle this at the moment,
because it removes every extension= line from it's temporary php.ini.
This means that the dependent extension (igbinary) now isn't loaded,
which means my extension doesn't load either and obviously all the tests
fail.I've attached a patch that adds a new --EXTENSIONS-- section to the PHPT
format. The run-tests.php script makes sure that all extensions in that
last are added to the PHP command with -dextension=... , but only if
they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and trunk
some time soon.
wouldn't --INI-- + extension do the same?
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
I'm currently writing a shared extension thta depends on another
shared extension (igbinary). "make test" doesn't handle this at the
moment, because it removes every extension= line from it's temporary
php.ini. This means that the dependent extension (igbinary) now
isn't loaded, which means my extension doesn't load either and
obviously all the tests fail.I've attached a patch that adds a new --EXTENSIONS-- section to the
PHPT format. The run-tests.php script makes sure that all extensions
in that last are added to the PHP command with -dextension=... , but
only if they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and
trunk some time soon.wouldn't --INI-- + extension do the same?
No, as the run-tests.php framework changes "extension_dir" to
"./modules/". It would also cause issues if you try to load an extension
that is built-in. And it's not portable because not on every platform
the extension name = extension.so
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
I'm currently writing a shared extension thta depends on another
shared extension (igbinary). "make test" doesn't handle this at the
moment, because it removes every extension= line from it's temporary
php.ini. This means that the dependent extension (igbinary) now
isn't loaded, which means my extension doesn't load either and
obviously all the tests fail.I've attached a patch that adds a new --EXTENSIONS-- section to the
PHPT format. The run-tests.php script makes sure that all extensions
in that last are added to the PHP command with -dextension=... , but
only if they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and
trunk some time soon.wouldn't --INI-- + extension do the same?
No, as the run-tests.php framework changes "extension_dir" to
"./modules/". It would also cause issues if you try to load an extension
that is built-in. And it's not portable because not on every platform
the extension name = extension.so
Can you use PHP_SHLIB_SUFFIX?
--
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370
I'm currently writing a shared extension thta depends on another
shared extension (igbinary). "make test" doesn't handle this at the
moment, because it removes every extension= line from it's temporary
php.ini. This means that the dependent extension (igbinary) now
isn't loaded, which means my extension doesn't load either and
obviously all the tests fail.I've attached a patch that adds a new --EXTENSIONS-- section to the
PHPT format. The run-tests.php script makes sure that all extensions
in that last are added to the PHP command with -dextension=... , but
only if they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and
trunk some time soon.wouldn't --INI-- + extension do the same?
No, as the run-tests.php framework changes "extension_dir" to
"./modules/". It would also cause issues if you try to load an extension
that is built-in. And it's not portable because not on every platform
the extension name = extension.soCan you use PHP_SHLIB_SUFFIX?
I am using that in my patch, but obviously that doesn't work with
extension= on the command line, which is how run-tests.php passes in
arguments from --INI--.
derick@whisky:~$ php -dextension=igbinary.PHP_SHLIB_SUFFIX
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary.PHP_SHLIB_SUFFIX' - /usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary.PHP_SHLIB_SUFFIX: cannot open shared object file: No such file or directory in Unknown on line 0
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
On Mon, Nov 28, 2011 at 2:11 PM, Derick Rethans derick@php.net
wrote:I'm currently writing a shared extension thta depends on another
shared extension (igbinary). "make test" doesn't handle this at the
moment, because it removes every extension= line from it's temporary
php.ini. This means that the dependent extension (igbinary) now
isn't loaded, which means my extension doesn't load either and
obviously all the tests fail.I've attached a patch that adds a new --EXTENSIONS-- section to the
PHPT format. The run-tests.php script makes sure that all extensions
in that last are added to the PHP command with -dextension=... , but
only if they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and
trunk some time soon.wouldn't --INI-- + extension do the same?
No, as the run-tests.php framework changes "extension_dir" to
"./modules/". It would also cause issues if you try to load an
extension
that is built-in. And it's not portable because not on every platform
the extension name = extension.soCan you use PHP_SHLIB_SUFFIX?
I am using that in my patch, but obviously that doesn't work with
extension= on the command line, which is how run-tests.php passes in
arguments from --INI--.derick@whisky:~$ php -dextension=igbinary.PHP_SHLIB_SUFFIX
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary.PHP_SHLIB_SUFFIX'/usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary.PHP_SHLIB_SUFFIX:
cannot open shared object file: No such file or directory in Unknown on
line 0
thanks for the answer, in this case I think this would be a worthwhile
improvement.
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
; - if ($loaded == '0') {
it would be more efficient to get all the loaded modules at
once(get_loaded_extensions or php -m)
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
;- if ($loaded == '0') {
This should use the tmp-php.ini as that might already load the required
extension if it was built in the same built. A configure line like
./configure --enable-igbinary=shared --enable-new-fancy-extension=shared
should add both to the tmp-php.ini.
I'm also not sure if we really want to cover all these cases in extra
sections, the user can do
run-tests.php -d extension=/path/to/extname.so
this would also work for extensions outside the default extension_dir
and one could test against different versions of the other extension,
while I agree it's more annoying ... for the individual case.
johannes
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
;- if ($loaded == '0') {
This should use the tmp-php.ini as that might already load the required
extension if it was built in the same built. A configure line like
the tmp-php.ini has no extension= lines in it, they're stripped out.
./configure --enable-igbinary=shared --enable-new-fancy-extension=shared
should add both to the tmp-php.ini.
But that is not doing anything from the phpized directory... where you'd
just run ./configure.
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
;- if ($loaded == '0') {
This should use the tmp-php.ini as that might already load the required
extension if it was built in the same built. A configure line likethe tmp-php.ini has no extension= lines in it, they're stripped out.
Ah indeed, it adds -d extension=... directives, I thought they would be
added on to the ini file. My mistake.
./configure --enable-igbinary=shared --enable-new-fancy-extension=shared
should add both to the tmp-php.ini.
But that is not doing anything from the phpized directory... where you'd
just run ./configure.
People might, for whatever reason, built the extension as part of the
PHP build. For instance one might think about using this feature with
PDO drivers. And build PDO shared (not saying that makes sense, but it
is a supported thing)
johannes
2011/11/28 Johannes Schlüter johannes@schlueters.de
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
;- if ($loaded == '0') {
This should use the tmp-php.ini as that might already load the required
extension if it was built in the same built. A configure line like./configure --enable-igbinary=shared --enable-new-fancy-extension=shared
should add both to the tmp-php.ini.
uhm, based on the code:
http://svn.php.net/viewvc/php/php-src/trunk/Makefile.global?view=markup#l99
http://svn.php.net/viewvc/php/php-src/trunk/Makefile.global?view=markup#l86
the extension lines will be stripped/omitted from the tmp-php.ini
I'm also not sure if we really want to cover all these cases in extra
sections, the user can dorun-tests.php -d extension=/path/to/extname.so
yeah, but we advertise make test as the official/endorsed way to run the
test suite, so that should work.
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
2011/11/28 Ferenc Kovacs tyra3l@gmail.com:
run-tests.php -d extension=/path/to/extname.so
yeah, but we advertise make test as the official/endorsed way to run the
test suite, so that should work.
any reliable tests cannot be done using make test as long as there
some random php.ini's in the system, or other install. We have been
there already and the whole idea of testing random configuration to
provide reliable results has failed, too many false positive. I've
been using run-tests.php only for a while now and I feel much more
comfortable with the results.
thanks for the answer, in this case I think this would be a worthwhile
improvement.
- foreach ($extensions as $req_ext) {
- $loaded =
$php -n -r 'echo (int) extension_loaded("$req_ext");'
;- if ($loaded == '0') {
it would be more efficient to get all the loaded modules at
once(get_loaded_extensions or php -m)
Yup, good catch. Patch attached again.
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
hi Derick,
I'm currently writing a shared extension thta depends on another shared
extension (igbinary). "make test" doesn't handle this at the moment,
because it removes every extension= line from it's temporary php.ini.
This means that the dependent extension (igbinary) now isn't loaded,
which means my extension doesn't load either and obviously all the tests
fail.
It could be handy yes, the idea until now was to create a custom
php.ini to load (non core) extensions.
I've attached a patch that adds a new --EXTENSIONS-- section to the PHPT
format. The run-tests.php script makes sure that all extensions in that
last are added to the PHP command with -dextension=... , but only if
they're not build in (or already loaded in some other way).The patch is simple, and it doesn't touch any other section or
functionality so I'm suggesting to commit it to PHP 5.3/5.4 and trunk
some time soon.
Patch looks fine, I've to test on win tho'. I would suggest to call
once php -m instead of the foreach and check the result/
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org