But until then there are still some issues to struggle with.
An example: I tried to set up a new project with Zend_Tool but it refused to work and confronted me with the following error.
Fatal error: Cannot redeclare class phpunit_framework_testsuite_dataprovider in /Users/andreas/WebStack/PHP-5.3.0/PEAR/PHPUnit/Framework/TestSuite/DataProvider.php on line 65 Call Stack: 0.0007 707528 1. {main}() /Users/andreas/WebStack/PHP-5.3.0/bin/zf.php:0 0.0008 707528 2. zf_main() /Users/andreas/WebStack/PHP-5.3.0/bin/zf.php:23 0.0067 1519280 3. zf_run() /Users/andreas/WebStack/PHP-5.3.0/bin/zf.php:36 0.0068 1519496 4. Zend_Tool_Framework_Client_Console::main() /Users/andreas/WebStack/PHP-5.3.0/bin/zf.php:214 0.0068 1520776 5. Zend_Tool_Framework_Client_Abstract->dispatch() /Users/andreas/WebStack/PHP-5.3.0/lib/ZendFramework-1.9-svn/Zend/Tool/Framework/Client/Console.php:96 0.0068 1520776 6. Zend_Tool_Framework_Client_Abstract->initialize() /Users/andreas/WebStack/PHP-5.3.0/lib/ZendFramework-1.9-svn/Zend/Tool/Framework/Client/Abstract.php:209 0.0095 1774360 7. Zend_Tool_Framework_Loader_Abstract->load() /Users/andreas/WebStack/PHP-5.3.0/lib/ZendFramework-1.9-svn/Zend/Tool/Framework/Client/Abstract.php:118 0.3263 2390528 8. include_once('/Users/andreas/WebStack/PHP-5.3.0/PEAR/PHPUnit/Framework/TestSuite/DataProvider.php') /Users/andreas/WebStack/PHP-5.3.0/lib/ZendFramework-1.9-svn/Zend/Tool/Framework/Loader/Abstract.php:90
After a little investigation I found out what the trouble is:
- Zend_Tool_Framework_Loader_IncludePathLoader attempts to include_once() all files named like XYZProvider.php. This also covers PHPUnit's DataProvider.php.
- In DataProvider.php PHPUnit/Framework.php is require_once()'ed.
- Framework.php contains a back reference to DataProvider.php using a require() statement and thus causing the trouble.
For instance (this is how it worked on my system; PEAR is in include_path):
# cd ~/WebStack/PHP/PEAR/ # mv PHPUnit/ .. # ln -s ~/WebStack/PHPUnit/ ~/WebStack/PHP/PEAR/PHPUnitAnd voila, there you go!
andreas@wonderlustking-2:~/WebStack/PHP/PEAR # zf show version Zend Framework Version: 1.9.5