protected function _initialize() { $cachePath = sfConfig::get('sf_cache_dir') . '/sympal/' . $this->_name . '.cache'; if (!file_exists($cachePath)) { $this->_loadFromSymfonyPlugins(); if ($pluginConfiguration = sfSympalPluginToolkit::isPluginDownloaded($this->_name)) { $downloadPath = sfContext::getInstance()->getConfiguration()->getPluginConfiguration($this->_name)->getRootDir(); } else { $downloadPath = sfSympalPluginToolkit::getPluginDownloadPath($this->_name); } $packageXmlPath = $downloadPath . '/package.xml'; $readmePath = $downloadPath . '/README'; if (sfSympalToolkit::fileGetContents($packageXmlPath)) { $packageXml = simplexml_load_file($packageXmlPath); } else { if (sfSympalToolkit::fileGetContents($packageXmlPath . '.tmpl')) { $packageXml = simplexml_load_file($packageXmlPath . '.tmpl'); } } if (isset($packageXml)) { $package = sfSympalPluginApi::simpleXmlToArray($packageXml); $this->_plugin = array_merge($package, $this->_plugin); } if ($readme = sfSympalToolkit::fileGetContents($readmePath)) { $this->_plugin['readme'] = $readme; } $this->_plugin['name'] = $this->_name; file_put_contents($cachePath, serialize($this->_plugin)); } else { $serialized = file_get_contents($cachePath); $this->_plugin = unserialize($serialized); } }