Browse Source

Update PhpConfig::dump() to generate file which returns array.

ADmad 11 years ago
parent
commit
1884d7bb40

+ 1 - 1
src/Core/Configure/Engine/PhpConfig.php

@@ -90,7 +90,7 @@ class PhpConfig implements ConfigEngineInterface
      */
     public function dump($key, array $data)
     {
-        $contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';';
+        $contents = '<?php' . "\n" . 'return ' . var_export($data, true) . ';';
 
         $filename = $this->_getFilePath($key);
         return file_put_contents($filename, $contents);

+ 1 - 1
tests/TestCase/Core/Configure/Engine/PhpConfigTest.php

@@ -145,7 +145,7 @@ class PhpConfigTest extends TestCase
         $this->assertTrue($result > 0);
         $expected = <<<PHP
 <?php
-\$config = array (
+return array (
   'One' => 
   array (
     'two' => 'value',