Details
Description
When I run zf show version on Windows, I get this notice:
PHP Notice: Undefined index: STORAGE_DIR in C:\www\zf-trunk\bin\zf.php on line 70
PHP Stack trace:
PHP 1. {main}() C:\www\zf-trunk\bin\zf.php:0
PHP 2. zf_main() C:\www\zf-trunk\bin\zf.php:23
PHP 3. zf_setup_storage_directory() C:\www\zf-trunk\bin\zf.php:32
Zend Framework Version: 1.9.0a1
(Xdebug installed - also happens if Xdebug isn't installed.)
I tested trunk and release-1.9 and both have this problem.
Issue Links
| This issue is duplicated by: | ||||
| ZF-7515 | fail to set STORAGE_DIR to $HOME/.zf/ |
|
|
|
Suggested patch:
Index: bin/zf.php =================================================================== --- bin/zf.php (revision 17369) +++ bin/zf.php (working copy) @@ -66,13 +66,15 @@ } elseif (isset($_zf['HOME']) && file_exists($_zf['HOME'] . '/.zf/')) { $_zf['STORAGE_DIR'] = $_ENV['HOME'] . '/.zf/'; } - - $storageRealpath = realpath($_zf['STORAGE_DIR']); - - if ($storageRealpath) { - $_zf['STORAGE_DIR'] = $storageRealpath; - } else { - unset($_zf['STORAGE_DIR']); + + if(isset($_zf['STORAGE_DIR'])) { + $storageRealpath = realpath($_zf['STORAGE_DIR']); + + if ($storageRealpath) { + $_zf['STORAGE_DIR'] = $storageRealpath; + } else { + unset($_zf['STORAGE_DIR']); + } } }Index: bin/zf.php =================================================================== --- bin/zf.php (revision 17369) +++ bin/zf.php (working copy) @@ -66,13 +66,15 @@ } elseif (isset($_zf['HOME']) && file_exists($_zf['HOME'] . '/.zf/')) { $_zf['STORAGE_DIR'] = $_ENV['HOME'] . '/.zf/'; } - - $storageRealpath = realpath($_zf['STORAGE_DIR']); - - if ($storageRealpath) { - $_zf['STORAGE_DIR'] = $storageRealpath; - } else { - unset($_zf['STORAGE_DIR']); + + if(isset($_zf['STORAGE_DIR'])) { + $storageRealpath = realpath($_zf['STORAGE_DIR']); + + if ($storageRealpath) { + $_zf['STORAGE_DIR'] = $storageRealpath; + } else { + unset($_zf['STORAGE_DIR']); + } } }