Development

Changeset 23193

You must first sign up to be able to contribute.

Changeset 23193

Show
Ignore:
Timestamp:
10/19/09 18:24:58 (5 months ago)
Author:
Kris.Wallsmith
Message:

[1.3] enhanced generate:app task to check for a skeleton in the directory in the project, similar to how generate:module works already

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/lib/task/generator/sfGenerateAppTask.class.php

    r21884 r23193  
    8484  [./symfony generate:app frontend --csrf-secret=UniqueSecret|INFO] 
    8585 
     86You can customize the default skeleton used by the task by creating a 
     87[%sf_data_dir%/skeleton/app|COMMENT] directory. 
    8688EOF; 
    8789  } 
     
    107109    } 
    108110 
     111    if (is_readable(sfConfig::get('sf_data_dir').'/skeleton/app')) 
     112    { 
     113      $skeletonDir = sfConfig::get('sf_data_dir').'/skeleton/app'; 
     114    } 
     115    else 
     116    { 
     117      $skeletonDir = dirname(__FILE__).'/skeleton/app'; 
     118    } 
     119 
    109120    // Create basic application structure 
    110121    $finder = sfFinder::type('any')->discard('.sf'); 
    111     $this->getFilesystem()->mirror(dirname(__FILE__).'/skeleton/app/app', $appDir, $finder); 
     122    $this->getFilesystem()->mirror($skeletonDir.'/app', $appDir, $finder); 
    112123 
    113124    // Create $app.php or index.php if it is our first app 
     
    132143    )); 
    133144 
    134     $this->getFilesystem()->copy(dirname(__FILE__).'/skeleton/app/web/index.php', sfConfig::get('sf_web_dir').'/'.$indexName.'.php'); 
    135     $this->getFilesystem()->copy(dirname(__FILE__).'/skeleton/app/web/index.php', sfConfig::get('sf_web_dir').'/'.$app.'_dev.php'); 
     145    $this->getFilesystem()->copy($skeletonDir.'/web/index.php', sfConfig::get('sf_web_dir').'/'.$indexName.'.php'); 
     146    $this->getFilesystem()->copy($skeletonDir.'/web/index.php', sfConfig::get('sf_web_dir').'/'.$app.'_dev.php'); 
    136147 
    137148    $this->getFilesystem()->replaceTokens(sfConfig::get('sf_web_dir').'/'.$indexName.'.php', '##', '##', array( 

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.