Changeset 3525
- Timestamp:
- 02/21/07 15:44:06 (2 years ago)
- Files:
-
- trunk/CHANGELOG (modified) (2 diffs)
- trunk/README (modified) (1 diff)
- trunk/data/bin/create_sandbox.sh (modified) (1 diff)
- trunk/data/config/settings.yml (modified) (1 diff)
- trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php (modified) (2 diffs)
- trunk/data/generator/sfPropelAdmin/default/template/templates/_edit_form.php (modified) (1 diff)
- trunk/data/i18n/nl_BE.dat (modified) (1 diff)
- trunk/data/skeleton/app/app/config/settings.yml (modified) (1 diff)
- trunk/data/tasks/sfPakeMisc.php (modified) (1 diff)
- trunk/data/tasks/sfPakePropel.php (modified) (2 diffs)
- trunk/data/tasks/sfPakeTest.php (modified) (5 diffs)
- trunk/data/web/errors/error500.php (modified) (1 diff)
- trunk/data/web/errors/unavailable.php (modified) (1 diff)
- trunk/lib/VERSION (modified) (1 diff)
- trunk/lib/action/sfComponent.class.php (modified) (1 diff)
- trunk/lib/addon/creole/drivers/sfDebugConnection.php (modified) (1 diff)
- trunk/lib/addon/propel/builder/SfObjectBuilder.php (modified) (2 diffs)
- trunk/lib/addon/propel/database/sfPropelDataRetriever.class.php (copied) (copied from branches/1.0/lib/addon/propel/database/sfPropelDataRetriever.class.php)
- trunk/lib/addon/propel/database/sfPropelDatabase.class.php (modified) (1 diff)
- trunk/lib/addon/propel/sfPropelData.class.php (modified) (6 diffs)
- trunk/lib/addon/propel/sfPropelDatabaseSchema.class.php (modified) (3 diffs)
- trunk/lib/addon/sfData.class.php (modified) (6 diffs)
- trunk/lib/cache/sfFunctionCache.class.php (modified) (2 diffs)
- trunk/lib/config/sfConfigCache.class.php (modified) (3 diffs)
- trunk/lib/config/sfValidatorConfigHandler.class.php (modified) (1 diff)
- trunk/lib/controller/sfFrontWebController.class.php (modified) (1 diff)
- trunk/lib/debug/sfDebug.class.php (modified) (1 diff)
- trunk/lib/debug/sfTimer.class.php (modified) (1 diff)
- trunk/lib/filter/sfCacheFilter.class.php (modified) (1 diff)
- trunk/lib/filter/sfFilter.class.php (modified) (3 diffs)
- trunk/lib/generator/sfAdminGenerator.class.php (modified) (1 diff)
- trunk/lib/generator/sfCrudGenerator.class.php (modified) (1 diff)
- trunk/lib/generator/sfGenerator.class.php (modified) (1 diff)
- trunk/lib/helper/DateHelper.php (modified) (1 diff)
- trunk/lib/helper/FormHelper.php (modified) (1 diff)
- trunk/lib/helper/JavascriptHelper.php (modified) (1 diff)
- trunk/lib/helper/NumberHelper.php (modified) (2 diffs)
- trunk/lib/helper/TextHelper.php (modified) (2 diffs)
- trunk/lib/helper/UrlHelper.php (modified) (3 diffs)
- trunk/lib/i18n/sfDateFormat.class.php (modified) (1 diff)
- trunk/lib/util/sfContext.class.php (modified) (1 diff)
- trunk/lib/util/sfYaml.class.php (modified) (2 diffs)
- trunk/package.xml.tmpl (modified) (1 diff)
- trunk/test/functional/fixtures/project/lib/model/om/BaseArticle.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/lib/model/om/BaseAuthor.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/lib/model/om/BaseAuthorArticle.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/lib/model/om/BaseBook.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/lib/model/om/BaseCategory.php (modified) (1 diff)
- trunk/test/unit/controller/sfWebControllerTest.php (modified) (2 diffs)
- trunk/test/unit/filter/sfFilterTest.php (modified) (2 diffs)
- trunk/test/unit/helper/FormHelperTest.php (modified) (3 diffs)
- trunk/test/unit/helper/TextHelperTest.php (modified) (2 diffs)
- trunk/test/unit/helper/UrlHelperTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CHANGELOG
r3316 r3525 1 Version 1.0.0 2 ------------- 3 4 No 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 11 Version 1.0.0-rc2 12 ----------------- 13 14 No 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 1 22 Version 1.0.0-rc1 2 23 ----------------- … … 4 25 No major changes since beta4. 5 26 27 * r3348: added "The Definitive guide to symfony" 28 * r3325: better inheritance for admin generator templates 6 29 * r3316: updated script.aculo.us to 1.7.0 and prototype to 1.5.0 7 30 * r3313: added a new decorate_with() helper 8 31 * r3312: added a new isForwardedTo() method to sfTestBrowser 9 32 * r3298: fixed tests on windows 33 10 34 * updated phpdoc comments 11 35 * added more unit tests (> 3800 now) trunk/README
r3264 r3525 18 18 ------------ 19 19 20 see doc/ book/03-Running-Symfony.txt20 see doc/03-Running-Symfony.txt trunk/data/bin/create_sandbox.sh
r3344 r3525 55 55 touch web/uploads/assets/.sf 56 56 57 touch data/sandbox.db 58 chmod 777 data 59 chmod 777 data/sandbox.db 60 57 61 echo ">>> create archive" 58 62 cd .. trunk/data/config/settings.yml
r3043 r3525 78 78 path_info_key: PATH_INFO 79 79 url_format: PATH 80 80 81 # ORM 82 orm: propel trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php
r3335 r3525 36 36 <?php if ($this->getParameterValue('list.peer_method')): ?> 37 37 $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') ?>'); 38 41 <?php endif ?> 39 42 $this->pager->init(); … … 393 396 else if (isset($this->filters['<?php echo $column->getName() ?>']) && $this->filters['<?php echo $column->getName() ?>'] !== '') 394 397 { 395 <?php if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR ): ?>398 <?php if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR || $type == CreoleTypes::LONGVARCHAR): ?> 396 399 $c->add(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, strtr($this->filters['<?php echo $column->getName() ?>'], '*', '%'), Criteria::LIKE); 397 400 <?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 )) ?] 2 14 3 15 <?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}";}}}}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: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 99 99 # path_info_key: PATH_INFO 100 100 # url_format: PATH 101 # 102 # # ORM 103 # orm: propel trunk/data/tasks/sfPakeMisc.php
r3148 r3525 45 45 pake_chmod(sfConfig::get('sf_cache_dir_name'), $sf_root_dir, 0777); 46 46 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); 47 48 pake_chmod('symfony', $sf_root_dir, 0777); 48 49 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')); 50 51 $dir_finder = pakeFinder::type('dir')->ignore_version_control(); 51 52 $file_finder = pakeFinder::type('file')->ignore_version_control(); 52 53 foreach ($dirs as $dir) 53 54 { 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); 56 57 } 57 58 } trunk/data/tasks/sfPakePropel.php
r3157 r3525 27 27 pake_task('propel-load-data', 'project_exists'); 28 28 29 pake_desc('dump data to fixtures directory'); 30 pake_task('propel-dump-data', 'project_exists'); 31 29 32 pake_desc('create database for current model'); 30 33 pake_task('propel-build-db', 'project_exists'); … … 218 221 219 222 /** 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 */ 231 function 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. 221 281 * 222 282 * @example symfony load-data frontend trunk/data/tasks/sfPakeTest.php
r2949 r3525 26 26 27 27 // 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'); 29 29 $h->register($finder->in($h->base_dir)); 30 30 … … 50 50 foreach (array_splice($args, 1) as $path) 51 51 { 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)); 53 53 foreach ($files as $file) 54 54 { … … 65 65 66 66 // 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'); 68 68 $h->register($finder->in($h->base_dir)); 69 69 … … 78 78 foreach ($args as $path) 79 79 { 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)); 81 81 foreach ($files as $file) 82 82 { … … 93 93 94 94 // 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'); 96 96 $h->register($finder->in($h->base_dir)); 97 97 trunk/data/web/errors/error500.php
r2710 r3525 23 23 <body> 24 24 <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> 26 26 <div class="sfTMessageContainer sfTAlert"> 27 27 <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 23 23 <body> 24 24 <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> 26 26 <div class="sfTMessageContainer sfTAlert"> 27 27 <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 -rc11 1.0.0 trunk/lib/action/sfComponent.class.php
r3209 r3525 282 282 * @see getVar() 283 283 */ 284 public function __get($key)284 public function & __get($key) 285 285 { 286 286 return $this->varHolder->get($key); trunk/lib/addon/creole/drivers/sfDebugConnection.php
r2808 r3525 287 287 } 288 288 } 289 290 public function __call($method, $arguments) 291 { 292 return $this->childConnection->$method($arguments); 293 } 289 294 } trunk/lib/addon/propel/builder/SfObjectBuilder.php
r2991 r3525 77 77 $script .= " 78 78 79 public function __call(\$method, \$ parameters)79 public function __call(\$method, \$arguments) 80 80 { 81 81 if (!\$callable = sfMixer::getCallable('{$this->getClassname()}:'.\$method)) … … 89 89 } 90 90 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()}';100 91 "; 101 92 } trunk/lib/addon/propel/database/sfPropelDatabase.class.php
r3201 r3525 112 112 $this->setParameter($key, $value); 113 113 } 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 }140 114 } trunk/lib/addon/propel/sfPropelData.class.php
r3153 r3525 10 10 11 11 /** 12 * This class is the Propel implementation of sfData. It interacts with the data source 13 * and loads data. 12 14 * 13 15 * @package symfony … … 22 24 23 25 // 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 */ 24 34 public function loadData($directory_or_file = null, $connectionName = 'propel') 25 35 { … … 45 55 } 46 56 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 */ 47 66 public function loadDataFromArray($data) 48 67 { … … 133 152 } 134 153 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 */ 135 163 protected function doDeleteCurrentData($fixture_files) 136 164 { … … 170 198 } 171 199 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 */ 172 207 protected function loadMapBuilder($class) 173 208 { … … 228 263 array_walk($tables, array($this, 'loadMapBuilder')); 229 264 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')); 233 295 234 296 // 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(); 241 305 foreach ($tableMap->getColumns() as $column) 242 306 { 243 307 $col = strtolower($column->getColumnName()); 244 245 308 if ($column->isPrimaryKey()) 246 309 { 247 $pk .= '_' .$rs->get($col); 248 continue; 310 $pk .= '_'.$rs->get($col); 249 311 } 250 312 else if ($column->isForeignKey()) 251 313 { 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); 255 317 } 256 318 else 257 319 { 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; 261 325 } 262 326 } trunk/lib/addon/propel/sfPropelDatabaseSchema.class.php
r3159 r3525 94 94 95 95 // 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]\""; 101 101 102 102 // foreign key name … … 107 107 108 108 // 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]\""; 112 112 } 113 113 114 114 // 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]\""; 118 118 } 119 119 $xml .= ">\n"; … … 406 406 if (in_array($key, $booleans)) 407 407 { 408 return ($value == 1)? 'true' : 'false';408 return $value == 1 ? 'true' : 'false'; 409 409 } 410 410 else 411 411 { 412 return $value;412 return is_null($value) ? 'null' : $value; 413 413 } 414 414 } trunk/lib/addon/sfData.class.php
r3071 r3525 10 10 11 11 /** 12 * This class defines the interface for interacting with data, as well 13 * as default implementations. 12 14 * 13 15 * @package symfony … … 23 25 $object_references = array(); 24 26 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 */ 25 33 public function setDeleteCurrentData($boolean) 26 34 { … … 28 36 } 29 37 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 */ 30 44 public function getDeleteCurrentData() 31 45 { … … 33 47 } 34 48 49 /** 50 * Loads data for the database from a YAML file 51 * 52 * @param string The path to the YAML file. 53 */ 35 54 protected function doLoadDataFromFile($fixture_file) 36 55 { … … 41 60 } 42 61 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 */ 43 67 abstract public function loadDataFromArray($data); 44 68 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 */ 45 75 protected function doLoadData($fixture_files) 46 76 { … … 55 85 } 56 86 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 */ 57 96 protected function getFiles($directory_or_file = null) 58 97 { trunk/lib/cache/sfFunctionCache.class.php
r3235 r3525 52 52 ob_start(); 53 53 ob_implicit_flush(false); 54 if ( strstr($target, '::'))54 if (is_string($target) && strstr($target, '::')) 55 55 { 56 56 // classname::staticMethod … … 66 66 } 67 67 } 68 else if ( strstr($target, '->'))68 else if (is_string($target) && strstr($target, '->')) 69 69 { 70 70 // object->method trunk/lib/config/sfConfigCache.class.php
r3203 r3525 64 64 $handlerToCall = null; 65 65 66 $handler = str_replace(DIRECTORY_SEPARATOR, '/', $handler); 67 66 68 // grab the base name of the handler 67 69 $basename = basename($handler); … … 131 133 public function checkConfig($configPath, $optional = false) 132 134 { 135 static $process_cache_cleared = false; 136 133 137 if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 134 138 { … … 187 191 188 192 // 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) 190 194 { 191 195 sfProcessCache::clear(); 196 $process_cache_cleared = true; 192 197 } 193 198 } trunk/lib/config/sfValidatorConfigHandler.class.php
r3333 r3525 70 70 $error = sprintf('Configuration file "%s" specifies unsupported request method "%s"', $configFiles[0], $method); 71 71 72 throw new sfParseException($ method);72 throw new sfParseException($error); 73 73 } 74 74 trunk/lib/controller/sfFrontWebController.class.php
r3204 r3525 37 37 } 38 38 39 // reinitialize filters (needed for unit and functional tests) 40 sfFilter::$filterCalled = array(); 41 39 42 // determine our module and action 40 43 $request = $this->getContext()->getRequest(); trunk/lib/debug/sfDebug.class.php
r3211 r3525 117 117 'parameterHolder' => self::flattenParameterHolder($response->getParameterHolder()), 118 118 ); 119 foreach ($response->getHttpHeaders() as $key => $value)119 if (method_exists($response, 'getHttpHeaders')) 120 120 { 121 $values['httpHeaders'][$key] = $value; 121 foreach ($response->getHttpHeaders() as $key => $value) 122 { 123 $values['httpHeaders'][$key] = $value; 124 } 122 125 } 123 126 trunk/lib/debug/sfTimer.class.php
r3211 r3525 46 46 /** 47 47 * 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 48 50 */ 49 51 public function addTime() 50 52 { 51 $this->totalTime += microtime(true) - $this->startTime; 53 $spend = microtime(true) - $this->startTime; 54 $this->totalTime += $spend; 52 55 ++$this->calls; 56 57 return $spend; 53 58 } 54 59 trunk/lib/filter/sfCacheFilter.class.php
r3244 r3525 52 52 { 53 53 // 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)) 55 55 { 56 56 $filterChain->execute(); trunk/lib/filter/sfFilter.class.php
r3244 r3525 23 23 protected 24 24 $parameterHolder = null, 25 $filterCalled = array(),26 25 $context = null; 26 27 public static 28 $filterCalled = array(); 27 29 28 30 /** … … 34 36 { 35 37 $class = get_class($this); 36 if (isset( $this->filterCalled[$class]))38 if (isset(self::$filterCalled[$class])) 37 39 { 38 40 return false; … … 40 42 else 41 43 { 42 $this->filterCalled[$class] = true;44 self::$filterCalled[$class] = true; 43 45 44 46 return true; trunk/lib/generator/sfAdminGenerator.class.php
r3324 r3525 125 125 $url_params = $pk_link ? '?'.$this->getPrimaryKeyUrlParams() : '\''; 126 126 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 } 134 137 } 135 138 trunk/lib/generator/sfCrudGenerator.class.php
r3331 r3525 87 87 88 88 $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'); 99 91 100 92 $this->generatePhpFiles($this->generatedModuleName, $templateFiles, $configFiles); trunk/lib/generator/sfGenerator.class.php
r3302 r3525