Development

/branches/1.1/lib/config/sfSimpleYamlConfigHandler.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/config/sfSimpleYamlConfigHandler.class.php

Revision 9085, 1.2 kB (checked in by Carl.Vondrick, 7 years ago)

1.1: fixed @param phpdoc to fit specs in config (refs #2991)

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfSimpleYamlConfigHandler allows you to load simple configuration files formatted as YAML.
13  *
14  * @package    symfony
15  * @subpackage config
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfSimpleYamlConfigHandler extends sfYamlConfigHandler
20 {
21   /**
22    * Executes this configuration handler.
23    *
24    * @param array $configFiles An array of absolute filesystem path to a configuration file
25    *
26    * @return string Data to be written to a cache file
27    */
28   public function execute($configFiles)
29   {
30     $config = self::getConfiguration($configFiles);
31
32     // compile data
33     $retval = "<?php\n".
34               "// auto-generated by %s\n".
35               "// date: %s\nreturn %s;\n";
36     $retval = sprintf($retval, __CLASS__, date('Y/m/d H:i:s'), var_export($config, true));
37
38     return $retval;
39   }
40
41   /**
42    * @see sfConfigHandler
43    */
44   static public function getConfiguration(array $configFiles)
45   {
46     return self::parseYamls($configFiles);
47   }
48 }
49
Note: See TracBrowser for help on using the browser.