[ Index ] |
|
Code source de Symfony 1.0.0 |
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 * sfGeneratorManager helps generate classes, views and templates for scaffolding, admin interface, ... 13 * 14 * @package symfony 15 * @subpackage generator 16 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 17 * @version SVN: $Id: sfGeneratorManager.class.php 3302 2007-01-18 13:42:46Z fabien $ 18 */ 19 class sfGeneratorManager 20 { 21 protected $cache = null; 22 23 /** 24 * Initializes the sfGeneratorManager instance. 25 */ 26 public function initialize() 27 { 28 // create cache instance 29 $this->cache = new sfFileCache(sfConfig::get('sf_module_cache_dir')); 30 $this->cache->setSuffix(''); 31 } 32 33 /** 34 * Returns the current sfCache implementation instance. 35 * 36 * @return sfCache A sfCache implementation instance 37 */ 38 public function getCache() 39 { 40 return $this->cache; 41 } 42 43 /** 44 * Generates classes and templates for a given generator class. 45 * 46 * @param string The generator class name 47 * @param array An array of parameters 48 * 49 * @return string The cache for the configuration file 50 */ 51 public function generate($generator_class, $param) 52 { 53 $generator = new $generator_class(); 54 $generator->initialize($this); 55 $data = $generator->generate($param); 56 57 return $data; 58 } 59 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |