Development

Changeset 13051

You must first sign up to be able to contribute.

Changeset 13051

Show
Ignore:
Timestamp:
11/17/08 00:46:03 (1 year ago)
Author:
fabien
Message:

[1.2] fixed project:freeze does not update symbolic links of default plugins in /web (closes #4899)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/task/plugin/sfPluginPublishAssetsTask.class.php

    r12848 r13051  
    2828    $this->addOptions(array( 
    2929      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'), 
    3031    )); 
    3132 
     
    5152  protected function execute($arguments = array(), $options = array()) 
    5253  { 
    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'; 
    5455    foreach (sfFinder::type('dir')->relative()->maxdepth(0)->in($corePluginsDir) as $plugin) 
    5556    { 
  • branches/1.2/lib/task/project/sfProjectFreezeTask.class.php

    r8809 r13051  
    8989    $this->getFilesystem()->rename(sfConfig::get('sf_data_dir').'/symfony/web/sf', sfConfig::get('sf_web_dir').'/sf'); 
    9090 
     91    $publishAssets = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter); 
     92    $publishAssets->setCommandApplication($this->commandApplication); 
     93 
    9194    // change symfony path in ProjectConfiguration.class.php 
    9295    $config = sfConfig::get('sf_config_dir').'/ProjectConfiguration.class.php'; 
     
    9598    $content = preg_replace('#(\'|")'.preg_quote($symfonyLibDir, '#').'#', "dirname(__FILE__).$1/../lib/symfony", $content); 
    9699    file_put_contents($config, $content); 
     100 
     101    // re-publish assets 
     102    $publishAssets->run(array(), array('--symfony-lib-dir='.sfConfig::get('sf_lib_dir').'/symfony')); 
    97103  } 
    98104 
  • branches/1.2/lib/task/project/sfProjectUnfreezeTask.class.php

    r7962 r13051  
    5656    if (preg_match('/^# FROZEN_SF_LIB_DIR\: (.+?)$/m', $content, $match)) 
    5757    { 
     58      $publishAssets = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter); 
     59      $publishAssets->setCommandApplication($this->commandApplication); 
     60 
     61      $symfonyLibDir = $match[1]; 
     62 
    5863      $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); 
    6065      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'); 
    6178    } 
    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'); 
    7079  } 
    7180} 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.