示例#1
0
 /**
  * loadData
  *
  * Load and parse data from a yml file
  * 
  * @param  string  $path  Path to load yaml data from
  * @return array   $array Array of parsed yaml data
  */
 public function loadData($path)
 {
     $contents = $this->doLoad($path);
     $spyc = new Doctrine_Spyc();
     $array = $spyc->load($contents);
     return $array;
 }
示例#2
0
文件: Spyc.php 项目: stelaireri/Hive
 /**
  * Load YAML into a PHP array statically
  *
  * The load method, when supplied with a YAML stream (string or file),
  * will do its best to convert YAML in a file into a PHP array.  Pretty
  * simple.
  *  Usage:
  *  <code>
  *   $array = Doctrine_Spyc::YAMLLoad('lucky.yaml');
  *   print_r($array);
  *  </code>
  * @access public
  * @return array
  * @param string $input Path of YAML file or string containing YAML
  */
 function YAMLLoad($input)
 {
     $spyc = new Doctrine_Spyc();
     return $spyc->load($input);
 }