Changeset 13051
- Timestamp:
- 11/17/08 00:46:03 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/task/plugin/sfPluginPublishAssetsTask.class.php
r12848 r13051 28 28 $this->addOptions(array( 29 29 new sfCommandOption('core-only', '', sfCommandOption::PARAMETER_NONE, 'If set only core plugins will publish their assets'), 30 new sfCommandOption('symfony-lib-dir', '', sfCommandOption::PARAMETER_REQUIRED, 'The symfony lib dir'), 30 31 )); 31 32 … … 51 52 protected function execute($arguments = array(), $options = array()) 52 53 { 53 $corePluginsDir = sfConfig::get('sf_symfony_lib_dir').'/plugins';54 $corePluginsDir = ($options['symfony-lib-dir'] ? $options['symfony-lib-dir'] : sfConfig::get('sf_symfony_lib_dir')).'/plugins'; 54 55 foreach (sfFinder::type('dir')->relative()->maxdepth(0)->in($corePluginsDir) as $plugin) 55 56 { branches/1.2/lib/task/project/sfProjectFreezeTask.class.php
r8809 r13051 89 89 $this->getFilesystem()->rename(sfConfig::get('sf_data_dir').'/symfony/web/sf', sfConfig::get('sf_web_dir').'/sf'); 90 90 91 $publishAssets = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter); 92 $publishAssets->setCommandApplication($this->commandApplication); 93 91 94 // change symfony path in ProjectConfiguration.class.php 92 95 $config = sfConfig::get('sf_config_dir').'/ProjectConfiguration.class.php'; … … 95 98 $content = preg_replace('#(\'|")'.preg_quote($symfonyLibDir, '#').'#', "dirname(__FILE__).$1/../lib/symfony", $content); 96 99 file_put_contents($config, $content); 100 101 // re-publish assets 102 $publishAssets->run(array(), array('--symfony-lib-dir='.sfConfig::get('sf_lib_dir').'/symfony')); 97 103 } 98 104 branches/1.2/lib/task/project/sfProjectUnfreezeTask.class.php
r7962 r13051 56 56 if (preg_match('/^# FROZEN_SF_LIB_DIR\: (.+?)$/m', $content, $match)) 57 57 { 58 $publishAssets = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter); 59 $publishAssets->setCommandApplication($this->commandApplication); 60 61 $symfonyLibDir = $match[1]; 62 58 63 $content = str_replace("# FROZEN_SF_LIB_DIR: {$match[1]}\n\n", '', $content); 59 $content = preg_replace('#^require_once.+?$#m', "require_once '{$ match[1]}/autoload/sfCoreAutoload.class.php';", $content, 1);64 $content = preg_replace('#^require_once.+?$#m', "require_once '{$symfonyLibDir}/autoload/sfCoreAutoload.class.php';", $content, 1); 60 65 file_put_contents($config, $content); 66 67 // re-publish assets 68 $publishAssets->run(array(), array('--symfony-lib-dir='.$symfonyLibDir)); 69 70 // remove files 71 $finder = sfFinder::type('any'); 72 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_lib_dir').'/symfony')); 73 $this->getFilesystem()->remove(sfConfig::get('sf_lib_dir').'/symfony'); 74 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_data_dir').'/symfony')); 75 $this->getFilesystem()->remove(sfConfig::get('sf_data_dir').'/symfony'); 76 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_web_dir').'/sf')); 77 $this->getFilesystem()->remove(sfConfig::get('sf_web_dir').'/sf'); 61 78 } 62 63 $finder = sfFinder::type('any');64 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_lib_dir').'/symfony'));65 $this->getFilesystem()->remove(sfConfig::get('sf_lib_dir').'/symfony');66 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_data_dir').'/symfony'));67 $this->getFilesystem()->remove(sfConfig::get('sf_data_dir').'/symfony');68 $this->getFilesystem()->remove($finder->in(sfConfig::get('sf_web_dir').'/sf'));69 $this->getFilesystem()->remove(sfConfig::get('sf_web_dir').'/sf');70 79 } 71 80 }

