You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Travis-CI and PHP-Build along with PHP-Unit on PHP 5.2.17 we are running into this error
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/travis/.phpenv/versions/5.2.17/pear/File/Iterator/Autoload.php on line 45
Perhaps some bad code was pushed into pear a while back and it is just now trickling down.
We've been pointed in several different directions on this one after doing some code review myself it seems as though the offending file is actually part of PHP-Unit. (though It might have already been fixed)
It seems travis-ci upgraded you to PHPUnit 3.7 which is PHP >= 5.3.3.
Given that PHP 5.2 isn't supported anymore for 2 years we decided to switch PHPUnit to 5.3 for the new version.
If you depend on 5.2 support downgrade to PHPUnit 3.6 ( you seem to be doing so in CHH/php-build-plugin-phpunit#1 anyways).
From a PHPUnit side there is not much we can do here. The version change is needed and the old version is not going away. I think we pushed out another 3.6 release to help with dependency management but for all 5.2 projects CI envs have to use PHPUnit 3.6
hope thats fine and feel free to join #phpunit on freenode if you run into issues
Is it possible to make PHPUnit 3.6 depend on File_Iterator <= 1.3.2, PHP_Timer <= 1.0.3 and Text_Template <= 1.1.2?
Seems like the autoloading was changed to use Closures in the latest versions of these packages. So when one does just pear install phpunit/PHPUnit-3.6.12 he has a broken PHPUnit on 5.2.
Also I get the error of "duplicate" packages when trying to install PHPUnit 3.6.12:
vagrant@lucid32:/tmp/php-5.2.17$ ./bin/pear install phpunit/PHPUnit-3.6.12
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.3 found
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.2 found
install failed
When I manually install File_Iterator then I will get the same error just with Text_Template and PHP_Timer.
I don't know how graceful pear is when it comes to downgrading versions but for installing a new phpunit (what you seem to be doing in your vbox) I think it should pick up the right dependencies. The re-release was done a couple weeks back iirc to ease "staying on 3.6" without installing fixed versions for all deps.
If that doesn't work out like planned I'll have another look
@edorian Could you please have another look? PEAR complains about duplicate packages, just like in the error message I've posted.
I got the error I've posted just about half an hour ago, when trying to do pear install PHPUnit-3.6.12. For travis, I explicitly install the right versions of these dependencies for now, then it works.
I was having the same issue and did something similar to CHH to install 3.6.12; I installed manually the dependencies that threw an error and then installed the phpUnit package.
Today I spend some time searching why I couldn't install PHPUnit 3.6.12. Beside bug above there was also below error:
Fatal error: Call to undefined function php_timer_autoload() in .....
For the benefit of people that are still using this version could you please add a rule that phpunit/PHP_Timer package should have version of 1.0.2. Bug was appearing in version 1.0.4 - probably method have been deleted there.
Activity
edorian commentedon Oct 12, 2012
It seems travis-ci upgraded you to PHPUnit 3.7 which is
PHP >= 5.3.3.Given that PHP 5.2 isn't supported anymore for 2 years we decided to switch PHPUnit to 5.3 for the new version.
If you depend on 5.2 support downgrade to PHPUnit 3.6 ( you seem to be doing so in CHH/php-build-plugin-phpunit#1 anyways).
From a PHPUnit side there is not much we can do here. The version change is needed and the old version is not going away. I think we pushed out another 3.6 release to help with dependency management but for all 5.2 projects CI envs have to use PHPUnit 3.6
hope thats fine and feel free to join #phpunit on freenode if you run into issues
tm1000 commentedon Oct 12, 2012
@edorian makes sense I think we'll get it figured out in https://github.com/CHH/php-build-plugin-phpunit/issues/1 I understand about moving up and onward. 5.2 is something like 4-5 years old anyways.
CHH commentedon Oct 13, 2012
Is it possible to make PHPUnit 3.6 depend on
File_Iterator <= 1.3.2,PHP_Timer <= 1.0.3andText_Template <= 1.1.2?Seems like the autoloading was changed to use Closures in the latest versions of these packages. So when one does just
pear install phpunit/PHPUnit-3.6.12he has a broken PHPUnit on 5.2.Also I get the error of "duplicate" packages when trying to install PHPUnit
3.6.12:When I manually install
File_Iteratorthen I will get the same error just withText_TemplateandPHP_Timer.sebastianbergmann commentedon Oct 13, 2012
What you suggest has already been done: PHPUnit 3.6.12 has been re-released with updated metadata information.
edorian commentedon Oct 13, 2012
I don't know how graceful pear is when it comes to downgrading versions but for installing a new phpunit (what you seem to be doing in your vbox) I think it should pick up the right dependencies. The re-release was done a couple weeks back iirc to ease "staying on 3.6" without installing fixed versions for all deps.
If that doesn't work out like planned I'll have another look
sebastianbergmann commentedon Oct 13, 2012
CHH commentedon Oct 13, 2012
@edorian Could you please have another look? PEAR complains about duplicate packages, just like in the error message I've posted.
I got the error I've posted just about half an hour ago, when trying to do
pear install PHPUnit-3.6.12. For travis, I explicitly install the right versions of these dependencies for now, then it works.sebastianbergmann commentedon Oct 13, 2012
Looks like a bug in PEAR to me: https://pear.php.net/bugs/bug.php?id=19650
CHH commentedon Oct 13, 2012
Thanks Sebastian! 😃
dexbarrett commentedon Oct 25, 2012
I was having the same issue and did something similar to CHH to install 3.6.12; I installed manually the dependencies that threw an error and then installed the phpUnit package.
Cinderella-Man commentedon Nov 23, 2012
Hi Sebastian,
Today I spend some time searching why I couldn't install PHPUnit 3.6.12. Beside bug above there was also below error:
Fatal error: Call to undefined function php_timer_autoload() in .....
For the benefit of people that are still using this version could you please add a rule that phpunit/PHP_Timer package should have version of 1.0.2. Bug was appearing in version 1.0.4 - probably method have been deleted there.
PS. Sorry for not creating separate bug ticket.
Thanks,
Kamil