Pārlūkot izejas kodu

[ZF-10636] Zend_Config

- Fixed comment wrong and added svn:keywords $Id$.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23293 44c647ce-9c0f-0410-b52a-842ac1e357ba
ramon 15 gadi atpakaļ
vecāks
revīzija
9b4f46fee9

+ 8 - 8
library/Zend/Config/Json.php

@@ -16,7 +16,7 @@
  * @package   Zend_Config
  * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license   http://framework.zend.com/license/new-bsd     New BSD License
- * @version   $Id: Xml.php 19059 2009-11-19 20:05:27Z jan $
+ * @version   $Id$
  */
 
 /**
@@ -30,7 +30,7 @@ require_once 'Zend/Config.php';
 require_once 'Zend/Json.php';
 
 /**
- * XML Adapter for Zend_Config
+ * JSON Adapter for Zend_Config
  *
  * @category  Zend
  * @package   Zend_Config
@@ -47,9 +47,9 @@ class Zend_Config_Json extends Zend_Config
     /**
      * Whether or not to ignore constants in the JSON string
      *
-     * Note: if you do not have constant names in quotations in your JSON 
+     * Note: if you do not have constant names in quotations in your JSON
      * string, they may lead to syntax errors when parsing.
-     * 
+     *
      * @var bool
      */
     protected $_ignoreConstants = false;
@@ -129,7 +129,7 @@ class Zend_Config_Json extends Zend_Config
 
         // Parse/decode
         $config = Zend_Json::decode($json);
-        
+
         if (null === $config) {
             // decode failed
             require_once 'Zend/Config/Exception.php';
@@ -212,8 +212,8 @@ class Zend_Config_Json extends Zend_Config
 
     /**
      * Replace any constants referenced in a string with their values
-     * 
-     * @param  string $value 
+     *
+     * @param  string $value
      * @return string
      */
     protected function _replaceConstants($value)
@@ -228,7 +228,7 @@ class Zend_Config_Json extends Zend_Config
 
     /**
      * Get (reverse) sorted list of defined constant names
-     * 
+     *
      * @return array
      */
     protected function _getConstants()

+ 9 - 9
library/Zend/Config/Writer/Json.php

@@ -16,7 +16,7 @@
  * @package    Zend_Config
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: Xml.php 18862 2009-11-05 18:25:20Z beberlei $
+ * @version    $Id$
  */
 
 /**
@@ -39,28 +39,28 @@ class Zend_Config_Writer_Json extends Zend_Config_Writer_FileAbstract
 {
     /**
      * If we need to pretty-print JSON data
-     * 
+     *
      * @var boolean
      */
     protected $_prettyPrint = false;
-    
+
     /**
      * Get prettyPrint flag
-     * 
+     *
      * @return the prettyPrint flag
      */
-    public function prettyPrint() 
+    public function prettyPrint()
     {
         return $this->_prettyPrint;
     }
 
     /**
      * Set prettyPrint flag
-     * 
+     *
      * @param  bool $prettyPrint PrettyPrint flag
      * @return Zend_Config_Writer_Json
      */
-    public function setPrettyPrint($flag) 
+    public function setPrettyPrint($flag)
     {
         $this->_prettyPrint = (bool) $flag;
         return $this;
@@ -81,7 +81,7 @@ class Zend_Config_Writer_Json extends Zend_Config_Writer_FileAbstract
         if (is_string($sectionName)) {
             $data = array($sectionName => $data);
         }
-        
+
         foreach ($extends as $section => $parentSection) {
             $data[$section][Zend_Config_Json::EXTENDS_NAME] = $parentSection;
         }
@@ -99,7 +99,7 @@ class Zend_Config_Writer_Json extends Zend_Config_Writer_FileAbstract
 
         $out = Zend_Json::encode($data);
         if ($this->prettyPrint()) {
-             $out = Zend_Json::prettyPrint($out);   
+             $out = Zend_Json::prettyPrint($out);
         }
         return $out;
     }

+ 17 - 17
library/Zend/Config/Writer/Yaml.php

@@ -16,7 +16,7 @@
  * @package    Zend_Config
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: Xml.php 18862 2009-11-05 18:25:20Z beberlei $
+ * @version    $Id$
  */
 
 /**
@@ -25,7 +25,7 @@
 require_once 'Zend/Config/Writer/FileAbstract.php';
 
 /**
- * @see Zend_Config_Json
+ * @see Zend_Config_Yaml
  */
 require_once 'Zend/Config/Yaml.php';
 
@@ -39,38 +39,38 @@ class Zend_Config_Writer_Yaml extends Zend_Config_Writer_FileAbstract
 {
     /**
      * What to call when we need to decode some YAML?
-     * 
+     *
      * @var callable
      */
-    protected $_yamlEncoder = array('Zend_Config_Writer_Yaml', 'encode'); 
-    
+    protected $_yamlEncoder = array('Zend_Config_Writer_Yaml', 'encode');
+
     /**
      * Get callback for decoding YAML
-     * 
+     *
 	 * @return callable
 	 */
-	public function getYamlEncoder() 
+	public function getYamlEncoder()
 	{
 		return $this->_yamlEncoder;
 	}
 
 	/**
 	 * Set callback for decoding YAML
-	 * 
+	 *
 	 * @param  $yamlEncoder the decoder to set
 	 * @return Zend_Config_Yaml
 	 */
-	public function setYamlEncoder($yamlEncoder) 
+	public function setYamlEncoder($yamlEncoder)
 	{
 	    if (!is_callable($yamlEncoder)) {
             require_once 'Zend/Config/Exception.php';
             throw new Zend_Config_Exception('Invalid parameter to setYamlEncoder - must be callable');
 	    }
-	    
+
 		$this->_yamlEncoder = $yamlEncoder;
 		return $this;
 	}
-    
+
     /**
      * Render a Zend_Config into a YAML config string.
      *
@@ -101,15 +101,15 @@ class Zend_Config_Writer_Yaml extends Zend_Config_Writer_FileAbstract
                 }
             }
         }
-        
+
         return call_user_func($this->getYamlEncoder(), $data);
     }
 
     /**
      * Very dumb YAML encoder
-     * 
+     *
      * Until we have Zend_Yaml...
-     * 
+     *
      * @param array $data YAML data
      * @return string
      */
@@ -117,15 +117,15 @@ class Zend_Config_Writer_Yaml extends Zend_Config_Writer_FileAbstract
     {
         return self::_encodeYaml(0, $data);
     }
-    
+
     /**
      * Service function for encoding YAML
-     * 
+     *
      * @param int $indent Current indent level
      * @param array $data Data to encode
      * @return string
      */
-    protected static function _encodeYaml($indent, $data) 
+    protected static function _encodeYaml($indent, $data)
     {
         reset($data);
         $result = "";

+ 2 - 1
library/Zend/Config/Yaml.php

@@ -16,6 +16,7 @@
  * @package   Zend_Config
  * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  * @license   http://framework.zend.com/license/new-bsd     New BSD License
+ * @version   $Id$
  */
 
 /**
@@ -24,7 +25,7 @@
 require_once 'Zend/Config.php';
 
 /**
- * XML Adapter for Zend_Config
+ * YAML Adapter for Zend_Config
  *
  * @category  Zend
  * @package   Zend_Config