Przeglądaj źródła

[ZF-10926] Zend_Tool

- Fixed Zend_Tool_Project_Context_Zf_ApplicationConfigFile::addStringItem() to final of the section.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23622 44c647ce-9c0f-0410-b52a-842ac1e357ba
ramon 15 lat temu
rodzic
commit
67787fecb6

+ 5 - 3
library/Zend/Tool/Project/Context/Zf/ApplicationConfigFile.php

@@ -136,15 +136,17 @@ class Zend_Tool_Project_Context_Zf_ApplicationConfigFile extends Zend_Tool_Proje
                 $insideSection = true;
             }
 
+            $newLines[] = $contentLine;
             if ($insideSection) {
                 // if its blank, or a section heading
-                if ((trim($contentLine) == null) || (isset($contentLines[$contentLineIndex + 1]{0}) && $contentLines[$contentLineIndex + 1]{0} == '[')) {
+                if (isset($contentLines[$contentLineIndex + 1]{0}) && $contentLines[$contentLineIndex + 1]{0} == '[') {
+                    $newLines[] = $key . ' = ' . $value;
+                    $insideSection = null;
+                } else if (!isset($contentLines[$contentLineIndex + 1])){
                     $newLines[] = $key . ' = ' . $value;
                     $insideSection = null;
                 }
             }
-
-            $newLines[] = $contentLine;
         }
 
         $this->_content = implode("\n", $newLines);