ZF2-89: Either include Zend\Tool and Zend\Console in the Standard Distribution or exclude zf.php from it

Description

Similar to well-established workflows in ZF1, I tried to create a ZF2 project via the CLI after downloading the standard distribution.

After figuring out what to tweak to get rid of the ZF ERROR messages, I tried


$> zf create project

and got


Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in /Applications/ZendFramework2beta/bin/zf.php on line 611

Call Stack:
    0.0025     801144   1. {main}() /Applications/ZendFramework2beta/bin/zf.php:0
    0.0224     801144   2. ZF::main() /Applications/ZendFramework2beta/bin/zf.php:636
    0.0589     922024   3. ZF->run() /Applications/ZendFramework2beta/bin/zf.php:74
    0.0590     922024   4. ZF->_runTool() /Applications/ZendFramework2beta/bin/zf.php:117

and after pulling Zend\Tool I got


Fatal error: Class 'Zend\Console\Getopt' not found in /Applications/ZendFramework2beta/library/Zend/Tool/Framework/Client/Console/ArgumentParser.php on line 250

Call Stack:
    0.0017     801144   1. {main}() /Applications/ZendFramework2beta/bin/zf.php:0
    0.0019     801144   2. ZF::main() /Applications/ZendFramework2beta/bin/zf.php:636
    0.0151     922024   3. ZF->run() /Applications/ZendFramework2beta/bin/zf.php:74
    0.0151     922024   4. ZF->_runTool() /Applications/ZendFramework2beta/bin/zf.php:117
    0.0369    1247128   5. Zend\Tool\Framework\Client\AbstractClient->dispatch() /Applications/ZendFramework2beta/bin/zf.php:612
    0.3756    6003432   6. Zend\Tool\Framework\Client\Console\Console->_preDispatch() /Applications/ZendFramework2beta/library/Zend/Tool/Framework/Client/AbstractClient.php:218
    0.3871    6321704   7. Zend\Tool\Framework\Client\Console\ArgumentParser->parse() /Applications/ZendFramework2beta/library/Zend/Tool/Framework/Client/Console/Console.php:201
    0.3871    6322312   8. Zend\Tool\Framework\Client\Console\ArgumentParser->_parseGlobalPart() /Applications/ZendFramework2beta/library/Zend/Tool/Framework/Client/Console/ArgumentParser.php:136

After pulling Zend\Console there was an issue with Zend\Code\Generator\FileGeneratorRegistry::registerFileCodeGenerator() not defined, but that's a different story.

So my suggestion is to either include those packages in the Standard Distribution or leave out the zf command line tool altogether.

If zf.php should be there in order to handle ZF configuration, I recommend rewriting it so it fails gracefully when a user tries to create zf components with it from the Standard Distribution.

Comments

I can confirm this. Running "zf show version" yields

[05-Nov-2011 11:05:26] PHP Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in /var/applications/ZendFramework-2.0.0beta1/bin/zf.php on line 611

Matthew can you fix this in beta1?

Standard distribution is already decided in RFC.

Zend\Tool does not work with ZF2. You can clone the ZendSkeletonApplication to get a base working ZF2 project.

Closing as "Wont' Fix" (See Matthew's comment on ZF2-103 here)