pyrus / Pyrus

The next generation of the PEAR installer.
http://pear2.php.net/
Other
70 stars 18 forks source link

Class 'XMLWriter' not found #101

Closed trq closed 11 years ago

trq commented 12 years ago
thorpe@dev[~/test]+ mkdir vendor
thorpe@dev[~/test]+ php pyrus.phar ./vendor di pear.phpspec.net
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52
Using PEAR installation found at /home/thorpe/test/vendor
PHP Fatal error:  Class 'XMLWriter' not found in phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/XMLWriter.php on line 30
PHP Stack trace:
PHP   1. {main}() /home/thorpe/test/pyrus.phar:0
PHP   2. Pyrus\ScriptFrontend\Commands->run() /home/thorpe/test/pyrus.phar:69
PHP   3. Pyrus\ScriptFrontend\Commands->channelDiscover() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ScriptFrontend/Commands.php:309
PHP   4. Pyrus\ChannelRegistry->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ScriptFrontend/Commands.php:802
PHP   5. Pyrus\ChannelRegistry\Xml->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry.php:92
PHP   6. Pyrus\ChannelRegistry\Base->lazyInit() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Xml.php:144
PHP   7. Pyrus\ChannelRegistry\Base->initDefaultChannels() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:37
PHP   8. Pyrus\ChannelRegistry\Xml->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:338
PHP   9. Pyrus\ChannelFile\v1->__toString() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:155
PHP  10. pyrus_autoload() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:0
PHP  11. include() /home/thorpe/test/pyrus.phar:57

Fatal error: Class 'XMLWriter' not found in phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/XMLWriter.php on line 30

Call Stack:
    0.0397    1710824   1. {main}() /home/thorpe/test/pyrus.phar:0
    0.0562    2978504   2. Pyrus\ScriptFrontend\Commands->run() /home/thorpe/test/pyrus.phar:69
    1.2676    5119144   3. Pyrus\ScriptFrontend\Commands->channelDiscover() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ScriptFrontend/Commands.php:309
    2.9234    5362432   4. Pyrus\ChannelRegistry->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ScriptFrontend/Commands.php:802
    3.0867    5366704   5. Pyrus\ChannelRegistry\Xml->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry.php:92
    3.0867    5366912   6. Pyrus\ChannelRegistry\Base->lazyInit() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Xml.php:144
    3.0868    5367024   7. Pyrus\ChannelRegistry\Base->initDefaultChannels() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:37
    3.0945    5665072   8. Pyrus\ChannelRegistry\Xml->add() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:338
    3.0946    5665640   9. Pyrus\ChannelFile\v1->__toString() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:155
    3.0946    5665976  10. pyrus_autoload() phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/ChannelRegistry/Base.php:0
    3.0950    5728200  11. include('phar:///home/thorpe/test/pyrus.phar/Pyrus-2.0.0a4/php/Pyrus/XMLWriter.php') /home/thorpe/test/pyrus.phar:57
fpoirotte commented 12 years ago

It seems Pyrus is lacking a check here...

In the meantime, you can work around this problem by installing the package corresponding to the XMLWriter extension from your distribution's repositories or (in case you compiled PHP yourself) by adding --enable-xmlwriter to your configure line.

trq commented 12 years ago

Yeah, I recompiled with xmlwriter enabled and the error is gone.

till commented 11 years ago

@trq @fpoirotte Can you guys paste the output of the following from Windows:

$ php -r 'var_dump(extension_loaded("xmlwriter"));'
bool(true)

Because pyrus checks for the extension here: https://github.com/pyrus/Pyrus/blob/master/stub.php#L12

trq commented 11 years ago

I don't use Windows and as mentioned in my previous reply, installing the xmlwriter extension resolved the issue for me.

fpoirotte commented 11 years ago

@saltybeagle: I think this issue should be reopened as the issue still stands: stub.php checks whether the XMLReader extension is available, it doesn't check whether XMLWriter is though and both are required for Pyrus to work properly AFAIK.

till commented 11 years ago

@fpoirotte I'm fixing this! Just running tests again.