public function customize($params) { $params['moduleName'] = 'search'; sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir')); $generatorManager = new sfGeneratorManager(sfProjectConfiguration::getActive()); sfGeneratorConfigHandler::getContent($generatorManager, 'xfGeneratorInterface', $params); }
public function customizeGenerator($params) { $params['model_class'] = 'Article'; $params['moduleName'] = $this->moduleName; sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir')); $generatorManager = new sfGeneratorManager($this->getContext()->getConfiguration()); if (!is_dir(sfConfig::get('sf_config_cache_dir'))) { mkdir(sfConfig::get('sf_config_cache_dir'), 0777); } file_put_contents(sprintf('%s/modules_%s_config_generator.yml.php', sfConfig::get('sf_config_cache_dir'), $this->moduleName), '<?php ' . sfGeneratorConfigHandler::getContent($generatorManager, 'sfPropelAdminGenerator', $params)); return $this; }
/** * Customizes the generator configuration * * @param $params */ public function customizeGenerator(array $params) { if (!isset($params['index_class'])) { $params['index_class'] = 'TestSearch'; } $params['moduleName'] = 'search'; sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir')); $generatorManager = new sfGeneratorManager($this->getContext()->getConfiguration()); if (!is_dir(sfConfig::get('sf_config_cache_dir'))) { mkdir(sfConfig::get('sf_config_cache_dir'), 0777); } $filename = sprintf('%s/modules_%s_config_generator.yml.php', sfConfig::get('sf_config_cache_dir'), $params['moduleName']); $content = '<?php ' . sfGeneratorConfigHandler::getContent($generatorManager, 'xfGeneratorInterface', $params); file_put_contents($filename, $content); return $this; }
/* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); sfConfig::set('sf_symfony_lib_dir', realpath(dirname(__FILE__).'/../../../lib')); $t = new lime_test(5); $handler = new sfGeneratorConfigHandler(); $handler->initialize(); $dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'sfGeneratorConfigHandler'.DIRECTORY_SEPARATOR; $t->diag('parse errors'); $files = array( $dir.'empty.yml', $dir.'no_generator_class.yml', ); try { $data = $handler->execute($files); $t->fail('generator.yml must have a "class" section'); }