Development

Changeset 7253

You must first sign up to be able to contribute.

Changeset 7253

Show
Ignore:
Timestamp:
01/31/08 21:22:00 (10 months ago)
Author:
Mark.Quezada
Message:

Added the ability to specify an environment in pake tasks. This is important for being able to create an index using a different environment's connection parameters. Usage remains the same, but you can now do something like this:

symfony lucene-rebuild myapp dev

... in order to build the index using the 'dev' environment. This is useful when you need to rebuild an index on your production server where your connection parameters are different for the 'dev' and 'prod' environments.

This is a backwards compatible change as you can leave off the environment and the pake task will work the same as before.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfLucenePlugin/branches/1.0/data/tasks/sfPakeLucene.php

    r5712 r7253  
    179179  if (count($args)) 
    180180  { 
    181     _load_application_environment($args[0]); 
     181    _load_application_environment($args); 
    182182 
    183183    foreach (sfLucene::getAllInstances() as $search) 
     
    296296  } 
    297297 
    298   _load_application_environment($args[0]); 
     298  _load_application_environment($args); 
    299299} 
    300300 
     
    307307} 
    308308 
    309 function _load_application_environment($app
     309function _load_application_environment($args
    310310{ 
    311311  static $loaded; 
     
    313313  if (!$loaded) 
    314314  { 
    315     _check_app($app); 
     315    _check_app($args[0]); 
    316316 
    317317    define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); 
    318     define('SF_APP', $app); 
    319     define('SF_ENVIRONMENT', 'search'); 
     318    define('SF_APP', $args[0]); 
     319    define('SF_ENVIRONMENT', !empty($args[1]) ? $args[1] : 'search'); 
    320320    define('SF_DEBUG', true); 
    321321