Zend Framework

zf.bat on Windows throws Undefined index: STORAGE_DIR Notice

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.0
  • Fix Version/s: 1.9.1
  • Component/s: Zend_Tool
  • Labels:
    None

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

Activity

Hide
Rob Allen added a comment -

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']);
+        }
     }
     
 }
Show
Rob Allen added a comment - 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']);
+        }
     }
     
 }
Hide
Ryan Schmidt added a comment -

Not Windows-specific. Happens on Mac OS X, too, with 1.9.0 final. Did not happen with 1.8.4PL1.

Show
Ryan Schmidt added a comment - Not Windows-specific. Happens on Mac OS X, too, with 1.9.0 final. Did not happen with 1.8.4PL1.
Hide
Matt Cockayne added a comment -

Also Occured using final version of 1.9 on a CentOS 5.2, apache 2, php 5.2.9, with ioncude, Zend ext Manager and Optimizer. Suggested patch resolves

Show
Matt Cockayne added a comment - Also Occured using final version of 1.9 on a CentOS 5.2, apache 2, php 5.2.9, with ioncude, Zend ext Manager and Optimizer. Suggested patch resolves
Hide
Peter Sharp added a comment -

Patch effective for vanilla install of Apache 2, PHP 5.3 under Windows (XP & 7). Nice work.

Show
Peter Sharp added a comment - Patch effective for vanilla install of Apache 2, PHP 5.3 under Windows (XP & 7). Nice work.
Hide
Ralph Schindler added a comment -

Fixed in trunk in r17522 and 1.9 release branch in r17524

Show
Ralph Schindler added a comment - Fixed in trunk in r17522 and 1.9 release branch in r17524
Hide
Ralph Schindler added a comment -

Updating fix information

Show
Ralph Schindler added a comment - Updating fix information

People

Vote (3)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: