Development

Changeset 3525

You must first sign up to be able to contribute.

Changeset 3525

Show
Ignore:
Timestamp:
02/21/07 15:44:06 (2 years ago)
Author:
fabien
Message:

merged 1.0 into trunk (3350:3513)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r3316 r3525  
     1Version 1.0.0 
     2------------- 
     3 
     4No major changes since 1.0.0-rc2. 
     5 
     6* r3502: fixed sfFilter::isFirstCall() method 
     7* r3493: removed the DATABASE_NAME constants 
     8 
     9* fixed typos in the book 
     10 
     11Version 1.0.0-rc2 
     12----------------- 
     13 
     14No major changes since 1.0.0-rc1. 
     15 
     16* r3385: new propel-dump-data task 
     17* r3377: fixed PEAR installation problem with PEAR 1.5 
     18 
     19* new book is now bundled with symfony under the doc/ directory 
     20* added some phpdoc comments 
     21 
    122Version 1.0.0-rc1 
    223----------------- 
     
    425No major changes since beta4. 
    526 
     27* r3348: added "The Definitive guide to symfony" 
     28* r3325: better inheritance for admin generator templates 
    629* r3316: updated script.aculo.us to 1.7.0 and prototype to 1.5.0 
    730* r3313: added a new decorate_with() helper 
    831* r3312: added a new isForwardedTo() method to sfTestBrowser 
    932* r3298: fixed tests on windows 
     33 
    1034* updated phpdoc comments 
    1135* added more unit tests (> 3800 now) 
  • trunk/README

    r3264 r3525  
    1818------------ 
    1919 
    20 see doc/book/03-Running-Symfony.txt 
     20see doc/03-Running-Symfony.txt 
  • trunk/data/bin/create_sandbox.sh

    r3344 r3525  
    5555touch web/uploads/assets/.sf 
    5656 
     57touch data/sandbox.db 
     58chmod 777 data 
     59chmod 777 data/sandbox.db 
     60 
    5761echo ">>> create archive" 
    5862cd .. 
  • trunk/data/config/settings.yml

    r3043 r3525  
    7878    path_info_key:          PATH_INFO 
    7979    url_format:             PATH 
    80    
     80 
     81    # ORM 
     82    orm:                    propel 
  • trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php

    r3335 r3525  
    3636<?php if ($this->getParameterValue('list.peer_method')): ?> 
    3737    $this->pager->setPeerMethod('<?php echo $this->getParameterValue('list.peer_method') ?>'); 
     38<?php endif ?> 
     39<?php if ($this->getParameterValue('list.peer_count_method')): ?> 
     40    $this->pager->setPeerCountMethod('<?php echo $this->getParameterValue('list.peer_count_method') ?>'); 
    3841<?php endif ?> 
    3942    $this->pager->init(); 
     
    393396    else if (isset($this->filters['<?php echo $column->getName() ?>']) && $this->filters['<?php echo $column->getName() ?>'] !== '') 
    394397    { 
    395 <?php if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR): ?> 
     398<?php if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR || $type == CreoleTypes::LONGVARCHAR): ?> 
    396399      $c->add(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, strtr($this->filters['<?php echo $column->getName() ?>'], '*', '%'), Criteria::LIKE); 
    397400<?php else: ?> 
  • trunk/data/generator/sfPropelAdmin/default/template/templates/_edit_form.php

    r3310 r3525  
    1 [?php echo form_tag('<?php echo $this->getModuleName() ?>/edit', 'id=sf_admin_edit_form name=sf_admin_edit_form multipart=true onsubmit=double_list_submit(); return true;') ?] 
     1[?php echo form_tag('<?php echo $this->getModuleName() ?>/edit', array( 
     2  'id'        => 'sf_admin_edit_form', 
     3  'name'      => 'sf_admin_edit_form', 
     4  'multipart' => true, 
     5<?php foreach ($this->getColumnCategories('edit.display') as $category): ?> 
     6<?php foreach ($this->getColumns('edit.display', $category) as $name => $column): ?> 
     7<?php if ('admin_double_list' == $this->getParameterValue('edit.fields.'.$column->getName().'.type')): ?> 
     8  'onsubmit'  => 'double_list_submit(); return true;' 
     9<?php break 2; ?> 
     10<?php endif; ?> 
     11<?php endforeach; ?> 
     12<?php endforeach; ?> 
     13)) ?] 
    214 
    315<?php foreach ($this->getPrimaryKey() as $pk): ?> 
  • trunk/data/i18n/nl_BE.dat

    r449 r3525  
    1 a:3:{s:14:"NumberPatterns";a:4:{i:0;s:20:"#,##0.###;-#,##0.###";i:1;s:24:"#,##0.00 ¤;-#,##0.00 ¤";i:2;s:6:"#,##0%";i:3;s:3:"#E0";}s:7:"Version";a:1:{i:0;s:3:"1.2";}s:8:"calendar";a:1:{s:9:"gregorian";a:2:{s:26:"DateTimeElements:intvector";a:2:{i:0;i:2;i:1;i:4;}s:16:"DateTimePatterns";a:9:{i:0;s:12:"HH.mm' u. 'z";i:1;s:10:"HH:mm:ss z";i:2;s:8:"HH:mm:ss";i:3;s:5:"HH:mm";i:4;s:16:"EEEE d MMMM yyyy";i:5;s:11:"d MMMM yyyy";i:6;s:8:"d-MMM-yy";i:7;s:7:"d/MM/yy";i:8;s:7:"{1} {0}";}}}} 
     1a:3:{s:14:"NumberPatterns";a:4:{i:0;s:20:"#,##0.###;-#,##0.###";i:1;s:24:"¤ #,##0.00;¤ -#,##0.00";i:2;s:6:"#,##0%";i:3;s:3:"#E0";}s:7:"Version";a:1:{i:0;s:3:"1.2";}s:8:"calendar";a:1:{s:9:"gregorian";a:2:{s:26:"DateTimeElements:intvector";a:2:{i:0;i:2;i:1;i:4;}s:16:"DateTimePatterns";a:9:{i:0;s:12:"HH.mm' u. 'z";i:1;s:10:"HH:mm:ss z";i:2;s:8:"HH:mm:ss";i:3;s:5:"HH:mm";i:4;s:16:"EEEE d MMMM yyyy";i:5;s:11:"d MMMM yyyy";i:6;s:10:"d-MMM-yyyy";i:7;s:9:"d/MM/yyyy";i:8;s:7:"{1} {0}";}}}} 
  • trunk/data/skeleton/app/app/config/settings.yml

    r2919 r3525  
    9999#    path_info_key:          PATH_INFO 
    100100#    url_format:             PATH 
     101# 
     102#    # ORM 
     103#    orm:                    propel 
  • trunk/data/tasks/sfPakeMisc.php

    r3148 r3525  
    4545  pake_chmod(sfConfig::get('sf_cache_dir_name'), $sf_root_dir, 0777); 
    4646  pake_chmod(sfConfig::get('sf_log_dir_name'), $sf_root_dir, 0777); 
     47  pake_chmod(sfConfig::get('sf_web_dir_name').DIRECTORY_SEPARATOR.sfConfig::get('sf_upload_dir_name'), $sf_root_dir, 0777); 
    4748  pake_chmod('symfony', $sf_root_dir, 0777); 
    4849 
    49   $dirs = array('root_cache', 'upload', 'log'); 
     50  $dirs = array(sfConfig::get('sf_cache_dir_name'), sfConfig::get('sf_web_dir_name').DIRECTORY_SEPARATOR.sfConfig::get('sf_upload_dir_name'), sfConfig::get('sf_log_dir_name')); 
    5051  $dir_finder = pakeFinder::type('dir')->ignore_version_control(); 
    5152  $file_finder = pakeFinder::type('file')->ignore_version_control(); 
    5253  foreach ($dirs as $dir) 
    5354  { 
    54     pake_chmod($dir_finder, sfConfig::get('sf_'.$dir.'_dir'), 0777); 
    55     pake_chmod($file_finder, sfConfig::get('sf_'.$dir.'_dir'), 0666); 
     55    pake_chmod($dir_finder, $dir, 0777); 
     56    pake_chmod($file_finder, $dir, 0666); 
    5657  } 
    5758} 
  • trunk/data/tasks/sfPakePropel.php

    r3157 r3525  
    2727pake_task('propel-load-data', 'project_exists'); 
    2828 
     29pake_desc('dump data to fixtures directory'); 
     30pake_task('propel-dump-data', 'project_exists'); 
     31 
    2932pake_desc('create database for current model'); 
    3033pake_task('propel-build-db', 'project_exists'); 
     
    218221 
    219222/** 
    220  * loads yml data from fixtures directory and inserts into database 
     223 * Dumps yml database data to fixtures directory. 
     224 * 
     225 * @example symfony dump-data frontend data.yml 
     226 * @example symfony dump-data frontend data.yml dev 
     227 * 
     228 * @param object $task 
     229 * @param array $args 
     230 */ 
     231function run_propel_dump_data($task, $args) 
     232
     233  if (!count($args)) 
     234  { 
     235    throw new Exception('You must provide the app.'); 
     236  } 
     237 
     238  $app = $args[0]; 
     239 
     240  if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app)) 
     241  { 
     242    throw new Exception('The app "'.$app.'" does not exist.'); 
     243  } 
     244 
     245  if (!isset($args[1])) 
     246  { 
     247    throw new Exception('You must provide a filename.'); 
     248  } 
     249 
     250  $filename = $args[1]; 
     251 
     252  $env = empty($args[2]) ? 'dev' : $args[2]; 
     253 
     254  // define constants 
     255  define('SF_ROOT_DIR',    sfConfig::get('sf_root_dir')); 
     256  define('SF_APP',         $app); 
     257  define('SF_ENVIRONMENT', $env); 
     258  define('SF_DEBUG',       true); 
     259 
     260  // get configuration 
     261  require_once SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'; 
     262 
     263  $databaseManager = new sfDatabaseManager(); 
     264  $databaseManager->initialize(); 
     265 
     266  if (!sfToolkit::isPathAbsolute($filename)) 
     267  { 
     268    $dir = sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.'fixtures'; 
     269    pake_mkdirs($dir); 
     270    $filename = $dir.DIRECTORY_SEPARATOR.$filename; 
     271  } 
     272 
     273  pake_echo_action('propel', sprintf('dumping data to "%s"', $filename)); 
     274 
     275  $data = new sfPropelData(); 
     276  $data->dumpData($filename); 
     277
     278 
     279/** 
     280 * Loads yml data from fixtures directory and inserts into database. 
    221281 * 
    222282 * @example symfony load-data frontend 
  • trunk/data/tasks/sfPakeTest.php

    r2949 r3525  
    2626 
    2727  // register all tests 
    28   $finder = pakeFinder::type('file')->ignore_version_control()->name('*Test.php'); 
     28  $finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php'); 
    2929  $h->register($finder->in($h->base_dir)); 
    3030 
     
    5050    foreach (array_splice($args, 1) as $path) 
    5151    { 
    52       $files = pakeFinder::type('file')->ignore_version_control()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'functional'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.dirname($path)); 
     52      $files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'functional'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.dirname($path)); 
    5353      foreach ($files as $file) 
    5454      { 
     
    6565 
    6666    // register functional tests 
    67     $finder = pakeFinder::type('file')->ignore_version_control()->name('*Test.php'); 
     67    $finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php'); 
    6868    $h->register($finder->in($h->base_dir)); 
    6969 
     
    7878    foreach ($args as $path) 
    7979    { 
    80       $files = pakeFinder::type('file')->ignore_version_control()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'unit'.DIRECTORY_SEPARATOR.dirname($path)); 
     80      $files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'unit'.DIRECTORY_SEPARATOR.dirname($path)); 
    8181      foreach ($files as $file) 
    8282      { 
     
    9393 
    9494    // register unit tests 
    95     $finder = pakeFinder::type('file')->ignore_version_control()->name('*Test.php'); 
     95    $finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php'); 
    9696    $h->register($finder->in($h->base_dir)); 
    9797 
  • trunk/data/web/errors/error500.php

    r2710 r3525  
    2323<body> 
    2424<div class="sfTContainer"> 
    25   <a alt="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
     25  <a title="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
    2626  <div class="sfTMessageContainer sfTAlert"> 
    2727    <img alt="page not found" class="sfTMessageIcon" src="<?php echo $path ?>/sf/sf_default/images/icons/tools48.png" height="48" width="48" /> 
  • trunk/data/web/errors/unavailable.php

    r2710 r3525  
    2323<body> 
    2424<div class="sfTContainer"> 
    25   <a alt="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
     25  <a title="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
    2626  <div class="sfTMessageContainer sfTAlert"> 
    2727    <img alt="page not found" class="sfTMessageIcon" src="<?php echo $path ?>/sf/sf_default/images/icons/tools48.png" height="48" width="48" /> 
  • trunk/lib/VERSION

    r3314 r3525  
    1 1.0.0-rc1 
     11.0.0 
  • trunk/lib/action/sfComponent.class.php

    r3209 r3525  
    282282   * @see getVar() 
    283283   */ 
    284   public function __get($key) 
     284  public function & __get($key) 
    285285  { 
    286286    return $this->varHolder->get($key); 
  • trunk/lib/addon/creole/drivers/sfDebugConnection.php

    r2808 r3525  
    287287    } 
    288288  } 
     289 
     290  public function __call($method, $arguments) 
     291  { 
     292    return $this->childConnection->$method($arguments); 
     293  } 
    289294} 
  • trunk/lib/addon/propel/builder/SfObjectBuilder.php

    r2991 r3525  
    7777    $script .= " 
    7878 
    79   public function __call(\$method, \$parameters) 
     79  public function __call(\$method, \$arguments) 
    8080  { 
    8181    if (!\$callable = sfMixer::getCallable('{$this->getClassname()}:'.\$method)) 
     
    8989  } 
    9090 
    91 "; 
    92   } 
    93    
    94   protected function addConstants(&$script) 
    95   { 
    96     parent::addConstants($script); 
    97     $script .= " 
    98   /** the default database name for this class */ 
    99   const DATABASE_NAME = '{$this->getDatabase()->getName()}'; 
    10091"; 
    10192  } 
  • trunk/lib/addon/propel/database/sfPropelDatabase.class.php

    r3201 r3525  
    112112    $this->setParameter($key, $value); 
    113113  } 
    114  
    115   public function retrieveObjects($class, $peerMethod = null) 
    116   { 
    117     if (!$classPath = sfCore::getClassPath($class.'Peer')) 
    118     { 
    119       throw new sfException(sprintf('Unable to find path for class "%s".', $class.'Peer')); 
    120     } 
    121  
    122     require_once($classPath); 
    123  
    124     if (!$peerMethod) 
    125     { 
    126       $peerMethod = 'doSelect'; 
    127     } 
    128  
    129     $classPeer = $class.'Peer'; 
    130  
    131     if (!is_callable(array($classPeer, $peerMethod))) 
    132     { 
    133       throw new sfException(sprintf('Peer method "%s" not found for class "%s"', $peerMethod, $classPeer)); 
    134     } 
    135  
    136     $objects = call_user_func(array($classPeer, $peerMethod), new Criteria()); 
    137  
    138     return $objects; 
    139   } 
    140114} 
  • trunk/lib/addon/propel/sfPropelData.class.php

    r3153 r3525  
    1010 
    1111/** 
     12 * This class is the Propel implementation of sfData.  It interacts with the data source 
     13 * and loads data. 
    1214 * 
    1315 * @package    symfony 
     
    2224 
    2325  // symfony load-data (file|dir) 
     26  /** 
     27   * Loads data from a file or directory into a Propel data source 
     28   * 
     29   * @param mixed A file or directory path 
     30   * @param string The Propel connection name, default 'propel' 
     31   * 
     32   * @throws Exception If the database throws an error, rollback transaction and rethrows exception 
     33   */ 
    2434  public function loadData($directory_or_file = null, $connectionName = 'propel') 
    2535  { 
     
    4555  } 
    4656 
     57  /** 
     58   * Implements the abstract loadDataFromArray method and loads the data using the generated data model. 
     59   * 
     60   * @param array The data to be loaded into the data source 
     61   * 
     62   * @throws Exception If data is unnamed. 
     63   * @throws sfException If an object defined in the model does not exist in the data 
     64   * @throws sfException If a column that does not exist is referenced 
     65   */ 
    4766  public function loadDataFromArray($data) 
    4867  { 
     
    133152  } 
    134153 
     154  /** 
     155   * Clears existing data from the data source by reading the fixture files 
     156   * and deleting the existing data for only those classes that are mentioned 
     157   * in the fixtures. 
     158   * 
     159   * @param array The list of YAML files. 
     160   * 
     161   * @throws sfException If a class mentioned in a fixture can not be found 
     162   */ 
    135163  protected function doDeleteCurrentData($fixture_files) 
    136164  { 
     
    170198  } 
    171199 
     200  /** 
     201   * Loads the mappings for the classes 
     202   * 
     203   * @param string The name of a data object 
     204   * 
     205   * @throws sfException If the class cannot be found 
     206   */ 
    172207  protected function loadMapBuilder($class) 
    173208  { 
     
    228263    array_walk($tables, array($this, 'loadMapBuilder')); 
    229264 
    230     foreach ($tables as $table) 
    231     { 
    232       $tableMap = $this->maps[$table]->getDatabaseMap()->getTable(constant($table.'Peer::TABLE_NAME')); 
     265    // reordering tables to take foreign keys into account 
     266    $move = true; 
     267    while ($move) 
     268    { 
     269      foreach ($tables as $i => $tableName) 
     270      { 
     271        $tableMap = $this->maps[$tableName]->getDatabaseMap()->getTable(constant($tableName.'Peer::TABLE_NAME')); 
     272 
     273        foreach ($tableMap->getColumns() as $column) 
     274        { 
     275          if ($column->isForeignKey()) 
     276          { 
     277            $relatedTable = $this->maps[$tableName]->getDatabaseMap()->getTable($column->getRelatedTableName()); 
     278            if (array_search($relatedTable->getPhpName(), $tables) > $i) 
     279            { 
     280              unset($tables[$i]); 
     281              $tables[] = $tableName; 
     282              $move = true; 
     283              continue 2; 
     284            } 
     285          } 
     286        } 
     287 
     288        $move = false; 
     289      } 
     290    } 
     291 
     292    foreach ($tables as $tableName) 
     293    { 
     294      $tableMap = $this->maps[$tableName]->getDatabaseMap()->getTable(constant($tableName.'Peer::TABLE_NAME')); 
    233295 
    234296      // get db info 
    235       $rs = $con->executeQuery('SELECT * FROM '.constant($table.'Peer::TABLE_NAME')); 
    236  
    237       $dumpData[$table] = array(); 
    238  
    239       while ($rs->next()) { 
    240         $pk = ''; 
     297      $rs = $con->executeQuery('SELECT * FROM '.constant($tableName.'Peer::TABLE_NAME')); 
     298 
     299      $dumpData[$tableName] = array(); 
     300 
     301      while ($rs->next()) 
     302      { 
     303        $pk = $tableName; 
     304        $values = array(); 
    241305        foreach ($tableMap->getColumns() as $column) 
    242306        { 
    243307          $col = strtolower($column->getColumnName()); 
    244  
    245308          if ($column->isPrimaryKey()) 
    246309          { 
    247             $pk .= '_' .$rs->get($col); 
    248             continue; 
     310            $pk .= '_'.$rs->get($col); 
    249311          } 
    250312          else if ($column->isForeignKey()) 
    251313          { 
    252             $relatedTable = $this->maps[$table]->getDatabaseMap()->getTable($column->getRelatedTableName()); 
    253  
    254             $dumpData[$table][$table.$pk][$col] = $relatedTable->getPhpName().'_'.$rs->get($col); 
     314            $relatedTable = $this->maps[$tableName]->getDatabaseMap()->getTable($column->getRelatedTableName()); 
     315 
     316            $values[$col] = $relatedTable->getPhpName().'_'.$rs->get($col); 
    255317          } 
    256318          else 
    257319          { 
    258             $dumpData[$table][$table.$pk][$col] = $rs->get($col); 
    259           } 
    260         } 
     320            $values[$col] = $rs->get($col); 
     321          } 
     322        } 
     323 
     324        $dumpData[$tableName][$pk] = $values; 
    261325      } 
    262326    } 
  • trunk/lib/addon/propel/sfPropelDatabaseSchema.class.php

    r3159 r3525  
    9494 
    9595      // foreign-keys 
    96       if (isset($table['_foreign_keys'])) 
    97       { 
    98         foreach ($table['_foreign_keys'] as $fkey_name => $fkey) 
    99         { 
    100           $xml .= "    <foreign-key foreignTable=\"$fkey[foreign_table]\""; 
     96      if (isset($table['_foreignKeys'])) 
     97      { 
     98        foreach ($table['_foreignKeys'] as $fkey_name => $fkey) 
     99        { 
     100          $xml .= "    <foreign-key foreignTable=\"$fkey[foreignTable]\""; 
    101101 
    102102          // foreign key name 
     
    107107 
    108108          // onDelete 
    109           if (isset($fkey['on_delete'])) 
    110           { 
    111             $xml .= " onDelete=\"$fkey[on_delete]\""; 
     109          if (isset($fkey['onDelete'])) 
     110          { 
     111            $xml .= " onDelete=\"$fkey[onDelete]\""; 
    112112          } 
    113113 
    114114          // onUpdate 
    115           if (isset($fkey['on_update'])) 
    116           { 
    117             $xml .= " onUpdate=\"$fkey[on_update]\""; 
     115          if (isset($fkey['onUpdate'])) 
     116          { 
     117            $xml .= " onUpdate=\"$fkey[onUpdate]\""; 
    118118          } 
    119119          $xml .= ">\n"; 
     
    406406    if (in_array($key, $booleans)) 
    407407    { 
    408       return ($value == 1) ? 'true' : 'false'; 
     408      return $value == 1 ? 'true' : 'false'; 
    409409    } 
    410410    else 
    411411    { 
    412       return $value; 
     412      return is_null($value) ? 'null' : $value; 
    413413    } 
    414414  } 
  • trunk/lib/addon/sfData.class.php

    r3071 r3525  
    1010 
    1111/** 
     12 * This class defines the interface for interacting with data, as well 
     13 * as default implementations. 
    1214 * 
    1315 * @package    symfony 
     
    2325    $object_references = array(); 
    2426 
     27  /** 
     28   * Sets a flag to indicate if the current data in the database 
     29   * should be deleted before new data is loaded. 
     30   * 
     31   * @param boolean The flag value 
     32   */ 
    2533  public function setDeleteCurrentData($boolean) 
    2634  { 
     
    2836  } 
    2937 
     38  /** 
     39   * Gets the current value of the flag that indicates whether 
     40   * current data is to be deleted or not. 
     41   * 
     42   * @returns boolean 
     43   */ 
    3044  public function getDeleteCurrentData() 
    3145  { 
     
    3347  } 
    3448 
     49  /** 
     50   * Loads data for the database from a YAML file 
     51   * 
     52   * @param string The path to the YAML file. 
     53   */ 
    3554  protected function doLoadDataFromFile($fixture_file) 
    3655  { 
     
    4160  } 
    4261 
     62  /** 
     63   * Manages the insertion of data into the data source 
     64   * 
     65   * @param array The data to be inserted into the data source 
     66   */ 
    4367  abstract public function loadDataFromArray($data); 
    4468 
     69  /** 
     70   * Manages reading all of the fixture data files and 
     71   * loading them into the data source 
     72   * 
     73   * @param array The path names of the YAML data files 
     74   */ 
    4575  protected function doLoadData($fixture_files) 
    4676  { 
     
    5585  } 
    5686 
     87  /** 
     88   * Gets a list of one or more *.yml files and returns the list in an array 
     89   * 
     90   * @param string A directory or file name; if null, then defaults to 'sf_data_dir'/fixtures 
     91   * 
     92   * @returns array A list of *.yml files. 
     93   * 
     94   * @throws sfInitializationException If the directory or file does not exist. 
     95   */ 
    5796  protected function getFiles($directory_or_file = null) 
    5897  { 
  • trunk/lib/cache/sfFunctionCache.class.php

    r3235 r3525  
    5252      ob_start(); 
    5353      ob_implicit_flush(false); 
    54       if (strstr($target, '::')) 
     54      if (is_string($target) && strstr($target, '::')) 
    5555      { 
    5656        // classname::staticMethod 
     
    6666        } 
    6767      } 
    68       else if (strstr($target, '->')) 
     68      else if (is_string($target) && strstr($target, '->')) 
    6969      { 
    7070        // object->method 
  • trunk/lib/config/sfConfigCache.class.php

    r3203 r3525  
    6464    $handlerToCall = null; 
    6565 
     66    $handler = str_replace(DIRECTORY_SEPARATOR, '/', $handler); 
     67 
    6668    // grab the base name of the handler 
    6769    $basename = basename($handler); 
     
    131133  public function checkConfig($configPath, $optional = false) 
    132134  { 
     135    static $process_cache_cleared = false; 
     136 
    133137    if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    134138    { 
     
    187191 
    188192      // clear process cache 
    189       if ('config/config_handlers.yml' != $configPath
     193      if ('config/config_handlers.yml' != $configPath && sfConfig::has('sf_use_process_cache') && !$process_cache_cleared
    190194      { 
    191195        sfProcessCache::clear(); 
     196        $process_cache_cleared = true; 
    192197      } 
    193198    } 
  • trunk/lib/config/sfValidatorConfigHandler.class.php

    r3333 r3525  
    7070          $error = sprintf('Configuration file "%s" specifies unsupported request method "%s"', $configFiles[0], $method); 
    7171 
    72           throw new sfParseException($method); 
     72          throw new sfParseException($error); 
    7373        } 
    7474 
  • trunk/lib/controller/sfFrontWebController.class.php

    r3204 r3525  
    3737      } 
    3838 
     39      // reinitialize filters (needed for unit and functional tests) 
     40      sfFilter::$filterCalled = array(); 
     41 
    3942      // determine our module and action 
    4043      $request    = $this->getContext()->getRequest(); 
  • trunk/lib/debug/sfDebug.class.php

    r3211 r3525  
    117117        'parameterHolder' => self::flattenParameterHolder($response->getParameterHolder()), 
    118118      ); 
    119       foreach ($response->getHttpHeaders() as $key => $value
     119      if (method_exists($response, 'getHttpHeaders')
    120120      { 
    121         $values['httpHeaders'][$key] = $value; 
     121        foreach ($response->getHttpHeaders() as $key => $value) 
     122        { 
     123          $values['httpHeaders'][$key] = $value; 
     124        } 
    122125      } 
    123126 
  • trunk/lib/debug/sfTimer.class.php

    r3211 r3525  
    4646  /** 
    4747   * Stops the timer and add the amount of time since the start to the total time. 
     48   * 
     49   * @return integer Time spend for the last call 
    4850   */ 
    4951  public function addTime() 
    5052  { 
    51     $this->totalTime += microtime(true) - $this->startTime; 
     53    $spend = microtime(true) - $this->startTime; 
     54    $this->totalTime += $spend; 
    5255    ++$this->calls; 
     56 
     57    return $spend; 
    5358  } 
    5459 
  • trunk/lib/filter/sfCacheFilter.class.php

    r3244 r3525  
    5252  { 
    5353    // execute this filter only once, if cache is set and no GET or POST parameters 
    54     if (!$this->isFirstCall() || !sfConfig::get('sf_cache') || count($_GET) || count($_POST)) 
     54    if (!sfConfig::get('sf_cache') || count($_GET) || count($_POST)) 
    5555    { 
    5656      $filterChain->execute(); 
  • trunk/lib/filter/sfFilter.class.php

    r3244 r3525  
    2323  protected 
    2424    $parameterHolder = null, 
    25     $filterCalled    = array(), 
    2625    $context         = null; 
     26 
     27  public static 
     28    $filterCalled    = array(); 
    2729 
    2830  /** 
     
    3436  { 
    3537    $class = get_class($this); 
    36     if (isset($this->filterCalled[$class])) 
     38    if (isset(self::$filterCalled[$class])) 
    3739    { 
    3840      return false; 
     
    4042    else 
    4143    { 
    42       $this->filterCalled[$class] = true; 
     44      self::$filterCalled[$class] = true; 
    4345 
    4446      return true; 
  • trunk/lib/generator/sfAdminGenerator.class.php

    r3324 r3525  
    125125    $url_params = $pk_link ? '?'.$this->getPrimaryKeyUrlParams() : '\''; 
    126126 
    127     if (!isset($options['class']) && $default_class) 
    128     { 
    129       $options['class'] = $default_class; 
    130     } 
    131     else 
    132     { 
    133       $options['style'] = 'background: #ffc url('.$icon.') no-repeat 3px 2px'; 
     127    if (!isset($options['class'])) 
     128    { 
     129      if ($default_class) 
     130      { 
     131        $options['class'] = $default_class; 
     132      } 
     133      else 
     134      { 
     135        $options['style'] = 'background: #ffc url('.$icon.') no-repeat 3px 2px'; 
     136      } 
    134137    } 
    135138 
  • trunk/lib/generator/sfCrudGenerator.class.php

    r3331 r3525  
    8787 
    8888    $this->setTheme($theme); 
    89  
    90     $templateFiles = array_merge( 
    91       sfFinder::type('file')->name('*.php')->relative()->in(sfLoader::getGeneratorTemplate($this->getGeneratorClass(), 'default', '').'/templates'), 
    92       sfFinder::type('file')->name('*.php')->relative()->in($themeDir.'/templates') 
    93     ); 
    94  
    95     $configFiles = array_merge( 
    96       sfFinder::type('file')->name('*.yml')->relative()->in(sfLoader::getGeneratorTemplate($this->getGeneratorClass(), 'default', '').'/config'), 
    97       sfFinder::type('file')->name('*.yml')->relative()->in($themeDir.'/config') 
    98     ); 
     89    $templateFiles = sfFinder::type('file')->name('*.php')->relative()->in($themeDir.'/templates'); 
     90    $configFiles = sfFinder::type('file')->name('*.yml')->relative()->in($themeDir.'/config'); 
    9991 
    10092    $this->generatePhpFiles($this->generatedModuleName, $templateFiles, $configFiles); 
  • trunk/lib/generator/sfGenerator.class.php

    r3302 r3525