Issues

ZF-7139: ProjectProvider create action generates invalid/faulty provider skeleton

Description

When running 'sudo zf create project-provider xml import,export' against an existing project, which of course was also created via Zend_Tool, the generated code is faulty as shown in the next code snippets. I guess this is somehow related to issue http://framework.zend.com/issues/browse/ZF-6501 issue. The generated provider isn't also executable via the Zend_Tool Cli.

Actually generated code:

<?php

require_once 'Zend/Tool/Project/Provider/Abstract.php';
require_once 'Zend/Tool/Project/Provider/Exception.php';

class XmlProvider extends Zend_Tool_Project_Provider_Abstract
{
...
}

Should be:

<?php

require_once 'Zend/Tool/Project/Provider/Abstract.php';
require_once 'Zend/Tool/Project/Provider/Exception.php';

class Xml extends Zend_Tool_Project_Provider_Abstract
{
...
}

When having the generated Provider in the include_path and calling 'zf import (x)ml' I get an error message like the following console output dump:

PHP Notice:  Undefined index:  ml in /opt/local/lib/php/Zend/Tool/Framework/Provider/Repository.php on line 226
PHP Stack trace:
PHP   1. {main}() /opt/local/bin/zf.php:0
PHP   2. Zend_Tool_Framework_Client_Console::main() /opt/local/bin/zf.php:77
PHP   3. Zend_Tool_Framework_Client_Abstract->dispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Console.php:86
PHP   4. Zend_Tool_Framework_Client_Abstract->_handleDispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:210
PHP   5. Zend_Tool_Framework_Provider_Repository->getProviderSignature() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:239

Notice: Undefined index:  ml in /opt/local/lib/php/Zend/Tool/Framework/Provider/Repository.php on line 226

Call Stack:
    0.0008      61532   1. {main}() /opt/local/bin/zf.php:0
    0.0107     568020   2. Zend_Tool_Framework_Client_Console::main() /opt/local/bin/zf.php:77
    0.0107     568924   3. Zend_Tool_Framework_Client_Abstract->dispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Console.php:86
    1.2078    3653520   4. Zend_Tool_Framework_Client_Abstract->_handleDispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:210
    1.2078    3656100   5. Zend_Tool_Framework_Provider_Repository->getProviderSignature() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:239

PHP Fatal error:  Call to a member function getProvider() on a non-object in /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php on line 242
PHP Stack trace:
PHP   1. {main}() /opt/local/bin/zf.php:0
PHP   2. Zend_Tool_Framework_Client_Console::main() /opt/local/bin/zf.php:77
PHP   3. Zend_Tool_Framework_Client_Abstract->dispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Console.php:86
PHP   4. Zend_Tool_Framework_Client_Abstract->_handleDispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:210

Fatal error: Call to a member function getProvider() on a non-object in /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php on line 242

Call Stack:
    0.0008      61532   1. {main}() /opt/local/bin/zf.php:0
    0.0107     568020   2. Zend_Tool_Framework_Client_Console::main() /opt/local/bin/zf.php:77
    0.0107     568924   3. Zend_Tool_Framework_Client_Abstract->dispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Console.php:86
    1.2078    3653520   4. Zend_Tool_Framework_Client_Abstract->_handleDispatch() /opt/local/lib/php/Zend/Tool/Framework/Client/Abstract.php:210

ZF: Version 1.8.4 OS: Mac OS X 10.5.7 PHP: Version 5.2.10

Comments

Fixed in r23201 in trunk & r23202 in release branch 1.11 (as part of ZF-9397 and ZF-8463)