Permet de loader un yml dans le plugin avec la possibilité de l'overwritter s'il ce meme fichier est present dans l'application.
Dans /plugin/myPlugin/config faire un fichier config_handlers.yml
config/sfBBCodeParser.yml:
class: sfSimpleYamlConfigHandler
Donc ici, on va preparer une pre-compilation de ce fichier de config dans le cache, mais il ne sera pas inclut par défaut. Il faut donc l'apeller a partir du cache config des lors qu'on en a besoin.
/** * Test and include the default sfBBCodeParserPlugin config if it doesn't exists. * * @author loic.vernet * @since 30 july 08 * * @param Array $config */ function bb_check_and_include_config($config) { if (!$config) { // Include config file from generated cache $bb_config_file = include(sfContext::getInstance()->getConfigCache()->checkConfig(sfBBCodeParserConfig::getConfileFilePattern())); sfConfig::set(sfBBCodeParserConfig::getNamespace(), $bb_config_file); } return $config['config']; }
Ici j'ai ajouté une classe d'abstraction pour gérer la configuration du plugin.
in factories.yml file add a auto_start entry like this:
all:
storage:
param:
auto_start: false
$security = $this->getSecurityConfiguration();
all:
lucene:
index_path: %MY_CONSTANT%/data/lucene
image_path:
photos: %SF_WEB_DIR%/images/photos
avatars: %SF_WEB_DIR%/images/avatars
logs
8071.4 KB