Issues

ZF-12122: Zend_Tool (zf) doesn't respect ZF_TOOL_INCLUDE_PATH_PREPEND

Issue Type: Bug Created: 2012-03-27T18:04:11.000+0000 Last Updated: 2012-03-30T13:17:16.000+0000 Status: Open Fix version(s): Reporter: Philip (guice) Assignee: Ralph Schindler (ralph) Tags: - Zend_Tool

Related issues: Attachments:

Description

Zend_Tool CLI isn't respecting the ZF_TOOL_INCLUDE_PATH_PREPEND environment variable. Setup (using cygwin):

Environment:

<pre class="literal">
$ env | grep ZF
ZF_CONFIG_FILE=C:\Users\guice\Documents\Sites\vhosts\cis.dev/.zf.ini
ZF_HOME=C:\Users\guice\Documents\Sites\vhosts\cis.dev
ZF_TOOL_INCLUDE_PATH_PREPEND=C:\Users\guice\Documents\Sites\vhosts\cis.dev\application



<pre class="literal">
$ cat .zf.ini
basicloader.classes.1=Glacial_Tools_DbModel



<pre class="literal">
$ zf --setup

ZF Command Line Tool - Setup
----------------------------

Current Paths (Existing or not):
    Home Directory: C:\Users\guice\Documents\Sites\vhosts\cis.dev
    Storage Directory: C:\Users\guice\Documents\Sites\vhosts\cis.dev/.zf/
    Config File: C:\Users\guice\Documents\Sites\vhosts\cis.dev/.zf.ini
...



<pre class="literal">
$ ls -l $ZF_TOOL_INCLUDE_PATH_PREPEND/Glacial/Tools/
total 5.0K
-rw-r--r-- 1 guice Domain Users 1.5K Mar 27 09:09 DbModel.php
-rw-r--r-- 1 guice Domain Users  279 Mar 26 17:29 Manifest.php

Class File:

<pre class="highlight">
<?php
namespace Glacial\Tools 
{
    class DbModel extends \Zend_Tool_Project_Provider_Abstract
                  implements \Zend_Tool_Framework_Provider_Pretendable 
    {
        ...
    }
}

namespace
{
    class Glacial_Tools_DbModel extends \Glacial\Tools\DbModel
    {
        // Nothing to see here. This is a hack to make Zend_Tool a happy puppy.
    }
}

Running the command:

<pre class="literal">
$ zf

Warning: include_once(Glacial\Tools\DbModel.php): failed to open stream: No such file or directory in C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Loader.php on line 146

Call Stack:
    0.0012     469992   1. {main}() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:0
    0.0012     469992   2. ZF::main() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:623
    0.0064     817752   3. ZF->run() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:74
    0.0064     817752   4. ZF->_runTool() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:117
    0.0078     907536   5. Zend_Tool_Framework_Client_Abstract->dispatch() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:600
    0.0078     907536   6. Zend_Tool_Framework_Client_Abstract->initialize() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Client\Abstract.php:223
    0.0274    2052672   7. Zend_Tool_Framework_Loader_BasicLoader->load() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Client\Abstract.php:122
    0.0563    3313544   8. Zend_Loader::loadClass() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Loader\BasicLoader.php:110
    0.0563    3313856   9. Zend_Loader::loadFile() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Loader.php:94


Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Glacial\Tools\DbModel.php" does not exist or class "Glacial_Tools_DbModel" was not found in the file' in C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Loader.php on line 99

Zend_Exception: File "Glacial\Tools\DbModel.php" does not exist or class "Glacial_Tools_DbModel" was not found in the file in C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Loader.php on line 99

Call Stack:
    0.0012     469992   1. {main}() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:0
    0.0012     469992   2. ZF::main() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:623
    0.0064     817752   3. ZF->run() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:74
    0.0064     817752   4. ZF->_runTool() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:117
    0.0078     907536   5. Zend_Tool_Framework_Client_Abstract->dispatch() C:\Users\guice\Documents\Sites\vhosts\cis.dev\bin\zf.php:600
    0.0078     907536   6. Zend_Tool_Framework_Client_Abstract->initialize() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Client\Abstract.php:223
    0.0274    2052672   7. Zend_Tool_Framework_Loader_BasicLoader->load() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Client\Abstract.php:122
    0.0563    3313544   8. Zend_Loader::loadClass() C:\Users\guice\Documents\Sites\library\cis.externals\php\Zend\Tool\Framework\Loader\BasicLoader.php:110

Pretty clear ZF_TOOL_INCLUDE_PATH_PREPEND isn't being prepended to the path. I've searched the library code base and found no instances of ZF_TOOL_INCLUDE_PATH_PREPEND other than the "help" documents and comments (but is it possible it's buried somewhere else ... maybe).

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts