コード例 #1
0
ファイル: Toml.php プロジェクト: bruensicke/radium
 public static function file($file)
 {
     if (!file_exists($file)) {
         return array();
     }
     return TomlParser::fromFile($file);
 }
コード例 #2
0
 public function load($filename)
 {
     if (!class_exists('Toml\\Parser')) {
         throw new \RuntimeException('Unable to read toml as the Toml Parser is not installed.');
     }
     $config = Parser::fromFile($filename);
     return $config ?: array();
 }
コード例 #3
0
ファイル: TomlProtocol.php プロジェクト: eloquent/schemer
 /**
  * @param string $data
  *
  * @return mixed
  * @throws Exception\TomlThawException
  */
 public function thaw($data)
 {
     try {
         $value = Parser::fromString($data);
     } catch (Exception $e) {
         throw new Exception\TomlThawException($e);
     }
     return $value;
 }
コード例 #4
0
ファイル: TomlLoader.php プロジェクト: davidbadura/fixtures
 /**
  *
  * @param  string $path
  * @param array $options
  * @return FixtureCollection
  */
 public function load($path, array $options = array())
 {
     $data = Parser::fromFile($path);
     return FixtureCollection::create($data);
 }
コード例 #5
0
ファイル: TomlParser.php プロジェクト: allmarkedup/dayglo
 public function parse($content)
 {
     return Toml::fromString($content);
 }
コード例 #6
0
 /**
  * Deserializes Frontmatter data in the Toml format.
  *
  * @param string $data
  *
  * @return object
  */
 public function deserialize($data)
 {
     return Parser::fromString($data);
 }