Development

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

You must first sign up to be able to contribute.

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

Revision 3203, 1.1 kB (checked in by fabien, 8 years ago)
  • added phpdoc to the config/ files
  • renamed sfLoader::getConfigDirs() to sfLoader::getConfigPaths()
  • 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 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 = $this->parseYamls($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
Note: See TracBrowser for help on using the browser.