Changeset 10995
- Timestamp:
- 08/20/08 10:59:54 (3 months ago)
- Files:
-
- branches/dwhittle/1.1/lib/config/config/settings.yml (modified) (1 diff)
- branches/dwhittle/1.1/lib/helper/FormHelper.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/task/generator/skeleton/app/app/config/settings.yml (modified) (1 diff)
- branches/dwhittle/1.1/lib/widget/sfWidget.class.php (modified) (1 diff)
- branches/dwhittle/1.1/test/unit/widget/sfWidgetTest.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/action/sfAction.class.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/config/config/settings.yml (modified) (3 diffs)
- branches/dwhittle/1.2/lib/config/sfGeneratorConfigHandler.class.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/debug/sfWebDebug.class.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/helper/FormHelper.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/helper/ObjectHelper.php (modified) (3 diffs)
- branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/config/config.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/lib/vendor/phpmailer/language/phpmailer.lang-de.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/test/functional/fillInFilterTest.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/task/generator/skeleton/app/app/config/settings.yml (modified) (2 diffs)
- branches/dwhittle/1.2/lib/view/sfPHPView.class.php (modified) (1 diff)
- branches/dwhittle/1.2/lib/widget/sfWidget.class.php (modified) (1 diff)
- branches/dwhittle/1.2/test/other/fixtures/propel/databases.yml (modified) (1 diff)
- branches/dwhittle/1.2/test/other/fixtures/propel/propel.ini (modified) (3 diffs)
- branches/dwhittle/1.2/test/other/tasksTest.php (modified) (7 diffs)
- branches/dwhittle/1.2/test/unit/widget/sfWidgetTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/1.1/lib/config/config/settings.yml
r8315 r10995 19 19 check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. 20 20 compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. 21 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_ data_dir/web/errors/unavailable.php page.21 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_lib_dir/exception/data/unavailable.php page. 22 22 23 23 # Form security secret (CSRF protection) branches/dwhittle/1.1/lib/helper/FormHelper.php
r10004 r10995 745 745 // register our javascripts and stylesheets 746 746 $langFile = sfConfig::get('sf_calendar_web_dir').'/lang/calendar-'.$culture; 747 if((!is_readable(sfConfig::get('sf_symfony_ data_dir').'/web/'.$langFile.'.js')) &&747 if((!is_readable(sfConfig::get('sf_symfony_lib_dir').'/../data/web/'.$langFile.'.js')) && 748 748 (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 749 749 { 750 750 $langFile = sfConfig::get('sf_calendar_web_dir').'/lang/calendar-'.substr($culture,0,2); 751 if((!is_readable(sfConfig::get('sf_symfony_ data_dir').'/web/'.$langFile.'.js')) &&751 if((!is_readable(sfConfig::get('sf_symfony_lib_dir').'/../data/web/'.$langFile.'.js')) && 752 752 (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 753 753 { branches/dwhittle/1.1/lib/task/generator/skeleton/app/app/config/settings.yml
r9803 r10995 48 48 check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. 49 49 compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. 50 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_ data_dir/web/arrors/unavailable.php page.50 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_lib_dir/exception/data/unavailable.php. 51 51 52 52 # Form security secret (CSRF protection) branches/dwhittle/1.1/lib/widget/sfWidget.class.php
r9056 r10995 276 276 } 277 277 278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : sprintf('></%s>', $tag));278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : ('input' != $tag ? sprintf('></%s>', $tag) : '>')); 279 279 } 280 280 branches/dwhittle/1.1/test/unit/widget/sfWidgetTest.php
r10639 r10995 159 159 $t->is(sfWidget::isXhtml(), true, '::isXhtml() return true if the widget must returns XHTML tags'); 160 160 sfWidget::setXhtml(false); 161 $t->is($w->renderTag('input', array('value' => 'Test')), '<input value="Test"> </input>', '::setXhtml() changesthe value of the XHTML tag');161 $t->is($w->renderTag('input', array('value' => 'Test')), '<input value="Test">', '::setXhtml() changesthe value of the XHTML tag'); branches/dwhittle/1.2/lib/action/sfAction.class.php
r10879 r10995 345 345 346 346 /** 347 * Retrieves the default view to be executed when a given request is not served by this action. 348 * 349 * @return string A string containing the view name associated with this action 350 */ 351 public function getDefaultView() 352 { 353 if (!sfConfig::get('sf_compat_10')) 354 { 355 throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 356 } 357 358 return sfView::INPUT; 359 } 360 361 /** 362 * Retrieves the request methods on which this action will process validation and execution. 363 * 364 * @return int One of the following values: 365 * 366 * - sfRequest::GET 367 * - sfRequest::POST 368 * - sfRequest::PUT 369 * - sfRequest::DELETE 370 * - sfRequest::HEAD 371 * - sfRequest::NONE 372 * 373 * @see sfRequest 374 */ 375 public function getRequestMethods() 376 { 377 if (!sfConfig::get('sf_compat_10')) 378 { 379 throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 380 } 381 382 return sfRequest::GET 383 | sfRequest::POST 384 | sfRequest::PUT 385 | sfRequest::DELETE 386 | sfRequest::HEAD 387 | sfRequest::NONE; 388 } 389 390 /** 391 * Executes any post-validation error application logic. 392 * 393 * @return string A string containing the view name associated with this action 394 */ 395 public function handleError() 396 { 397 if (!sfConfig::get('sf_compat_10')) 398 { 399 throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 400 } 401 402 return sfView::ERROR; 403 } 404 405 /** 406 * Validates manually files and parameters. 407 * 408 * @return bool true, if validation completes successfully, otherwise false. 409 */ 410 public function validate() 411 { 412 if (!sfConfig::get('sf_compat_10')) 413 { 414 throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 415 } 416 417 return true; 418 } 419 420 /** 347 421 * Returns the security configuration for this module. 348 422 * branches/dwhittle/1.2/lib/config/config/settings.yml
r10639 r10995 19 19 check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. 20 20 compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. 21 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_ data_dir/web/errors/unavailable.php page.21 check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_lib_dir/exception/data/unavailable.php page. 22 22 23 23 # Form security secret (CSRF protection) … … 31 31 relative_url_root: ~ # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. 32 32 no_script_name: off # Enable the front controller name in generated URLs 33 34 # Validation settings, used for error generation by the Validation helper 35 validation_error_prefix: ' ↓ ' 36 validation_error_suffix: ' ↓' 37 validation_error_class: form_error 38 validation_error_id_prefix: error_for_ 33 39 34 40 # Cache settings … … 68 74 # i18n 69 75 default_culture: en # Default user culture 76 77 # enable 1.0 compatibility 78 compat_10: off branches/dwhittle/1.2/lib/config/sfGeneratorConfigHandler.class.php
r10148 r10995 80 80 static public function getContent(sfGeneratorManager $generatorManager, $class, $parameters) 81 81 { 82 return $generatorManager->generate($class, $parameters); 82 $data = ''; 83 84 // TODO: remove when the admin generator is moved to the new form framework 85 $r = new ReflectionClass($class); 86 if ('sfPropelAdminGenerator' == $class || $r->isSubclassOf(new ReflectionClass('sfPropelAdminGenerator'))) 87 { 88 $data .= <<<EOF 89 sfConfig::set('sf_compat_10', true); 90 require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php'; 91 92 EOF; 93 } 94 95 $data .= $generatorManager->generate($class, $parameters); 96 97 return $data; 83 98 } 84 99 branches/dwhittle/1.2/lib/debug/sfWebDebug.class.php
r9459 r10995 179 179 180 180 // sql queries log 181 if (preg_match('/ execute(?:Query|Update).+?\:\s+(.+)$/', $log, $match))181 if (preg_match('/\b(SELECT|INSERT|UPDATE|DELETE)\b/', $log, $match)) 182 182 { 183 183 $sqlLogs[] .= $match[1]; branches/dwhittle/1.2/lib/helper/FormHelper.php
r9967 r10995 743 743 // register our javascripts and stylesheets 744 744 $langFile = sfConfig::get('sf_calendar_web_dir').'/lang/calendar-'.$culture; 745 if((!is_readable(sfConfig::get('sf_symfony_ data_dir').'/web/'.$langFile.'.js')) &&745 if((!is_readable(sfConfig::get('sf_symfony_lib_dir').'/../data/web/'.$langFile.'.js')) && 746 746 (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 747 747 { 748 748 $langFile = sfConfig::get('sf_calendar_web_dir').'/lang/calendar-'.substr($culture,0,2); 749 if((!is_readable(sfConfig::get('sf_symfony_ data_dir').'/web/'.$langFile.'.js')) &&749 if((!is_readable(sfConfig::get('sf_symfony_lib_dir').'/../data/web/'.$langFile.'.js')) && 750 750 (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 751 751 { branches/dwhittle/1.2/lib/helper/ObjectHelper.php
r10979 r10995 73 73 { 74 74 // text method exists? 75 if ($text_method && !method_exists( array($option, $text_method)))75 if ($text_method && !method_exists($option, $text_method)) 76 76 { 77 77 throw new sfViewException(sprintf('Method "%s" doesn\'t exist for object of class "%s".', $text_method, _get_class_decorated($option))); … … 168 168 foreach (array($text_method, '__toString', 'toString', $key_method) as $method) 169 169 { 170 if (method_exists( array($tmp_object, $method)))170 if (method_exists($tmp_object, $method)) 171 171 { 172 172 $methodToCall = $method; … … 298 298 299 299 // method exists? 300 if (!method_exists( array($object, $method[0])))300 if (!method_exists($object, $method[0])) 301 301 { 302 302 throw new sfViewException(sprintf('Method "%s" doesn\'t exist for object of class "%s".', $method[0], _get_class_decorated($object))); branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/config/config.php
r10639 r10995 1 <?php 2 3 if (sfConfig::get('sf_compat_10')) 4 { 5 if (!class_exists('sfCompatAutoload', false)) 6 { 7 class sfCompatAutoload extends sfSimpleAutoload 8 { 9 } 10 11 // autoload classes 12 $autoload = sfCompatAutoload::getInstance(sfConfig::get('sf_app_cache_dir').'/sf_compat_autoloader.txt'); 13 $autoload->addDirectory(dirname(__FILE__).'/../lib'); 14 $autoload->register(); 15 } 16 17 // register config handler for validate/*.yml files 18 sfProjectConfiguration::getActive()->getConfigCache()->registerConfigHandler('modules/*/validate/*.yml', 'sfValidatorConfigHandler'); 19 20 // register config handler for config/mailer.yml files 21 sfProjectConfiguration::getActive()->getConfigCache()->registerConfigHandler('modules/*/config/mailer.yml', 'sfDefineEnvironmentConfigHandler', array('prefix' => 'sf_mailer_', 'module' => 'yes')); 22 23 // register request compat methods 24 if ($this instanceof sfConfigCache) 25 { 26 // here if we are included from an admin generator module (for 1.0) 27 sfProjectConfiguration::getActive()->getEventDispatcher()->connect('request.method_not_found', array('sfRequestCompat10', 'call')); 28 } 29 else 30 { 31 $this->dispatcher->connect('request.method_not_found', array('sfRequestCompat10', 'call')); 32 } 33 34 // register the validation execution filter 35 sfConfig::set('sf_execution_filter', array('sfValidationExecutionFilter', array())); 36 } branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/lib/vendor/phpmailer/language/phpmailer.lang-de.php
r10639 r10995 1 <?php 2 /** 3 * PHPMailer language file. 4 * German Version 5 */ 6 7 $PHPMAILER_LANG = array(); 8 9 $PHPMAILER_LANG["provide_address"] = 'Bitte geben Sie mindestens eine ' . 10 'Empfänger Emailadresse an.'; 11 $PHPMAILER_LANG["mailer_not_supported"] = ' mailer wird nicht unterstützt.'; 12 $PHPMAILER_LANG["execute"] = 'Konnte folgenden Befehl nicht ausführen: '; 13 $PHPMAILER_LANG["instantiate"] = 'Mail Funktion konnte nicht initialisiert werden.'; 14 $PHPMAILER_LANG["authenticate"] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.'; 15 $PHPMAILER_LANG["from_failed"] = 'Die folgende Absenderadresse ist nicht korrekt: '; 16 $PHPMAILER_LANG["recipients_failed"] = 'SMTP Fehler: Die folgenden ' . 17 'Empfänger sind nicht korrekt: '; 18 $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Fehler: Daten werden nicht akzeptiert.'; 19 $PHPMAILER_LANG["connect_host"] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.'; 20 $PHPMAILER_LANG["file_access"] = 'Zugriff auf folgende Datei fehlgeschlagen: '; 21 $PHPMAILER_LANG["file_open"] = 'Datei Fehler: konnte folgende Datei nicht öffnen: '; 22 $PHPMAILER_LANG["encoding"] = 'Unbekanntes Encoding-Format: '; branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/test/functional/fillInFilterTest.php
r10639 r10995 32 32 checkResponseElement('input[name="first_name"][value="fabien"]') 33 33 ; 34 branches/dwhittle/1.2/lib/task/generator/skeleton/app/app/config/settings.yml
r10639 r10995 49 49 # check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade. 50 50 # compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler. 51 # check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_ data_dir/web/errors/unavailable.php page.51 # check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_lib_dir/exception/data/unavailable.php page. 52 52 # 53 53 # # Routing settings 54 54 # relative_url_root: # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. 55 55 # no_script_name: off # Enable the front controller name in generated URLs 56 # 57 # # Validation settings, used for error generation by the Validation helper 58 # validation_error_prefix: ' ↓ ' 59 # validation_error_suffix: ' ↓' 60 # validation_error_class: form_error 61 # validation_error_id_prefix: error_for_ 56 62 # 57 63 # # Cache settings … … 91 97 # # i18n 92 98 # default_culture: en # Default user culture 99 # 100 # # enable 1.0 compatibility 101 # compat_10: off branches/dwhittle/1.2/lib/view/sfPHPView.class.php
r10148 r10995 43 43 44 44 $helpers = array_unique(array_merge(array('Helper', 'Url', 'Asset', 'Tag', 'Escaping'), sfConfig::get('sf_standard_helpers'))); 45 46 // remove default Form helper if compat_10 is false 47 if (!sfConfig::get('sf_compat_10') && false !== $i = array_search('Form', $helpers)) 48 { 49 unset($helpers[$i]); 50 } 45 51 46 52 sfLoader::loadHelpers($helpers); branches/dwhittle/1.2/lib/widget/sfWidget.class.php
r10639 r10995 276 276 } 277 277 278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : sprintf('></%s>', $tag));278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : ('input' != $tag ? sprintf('></%s>', $tag) : '>')); 279 279 } 280 280 branches/dwhittle/1.2/test/other/fixtures/propel/databases.yml
r6551 r10995 3 3 class: sfPropelDatabase 4 4 param: 5 phptype: sqlite 6 database: %SF_DATA_DIR%/database.sqlite 5 dsn: sqlite:%SF_DATA_DIR%/database.sqlite branches/dwhittle/1.2/test/other/fixtures/propel/propel.ini
r6551 r10995 2 2 propel.project = project 3 3 propel.database = sqlite 4 propel.database.createUrl = sqlite: //./database.sqlite5 propel.database.url = sqlite: //./database.sqlite4 propel.database.createUrl = sqlite:%SF_DATA_DIR%/database.sqlite 5 propel.database.url = sqlite:%SF_DATA_DIR%/database.sqlite 6 6 7 7 propel.addGenericAccessors = true … … 13 13 ; directories 14 14 propel.home = . 15 propel.output.dir = /tmp15 propel.output.dir = %SF_ROOT_DIR% 16 16 propel.schema.dir = ${propel.output.dir}/config 17 17 propel.conf.dir = ${propel.output.dir}/config … … 38 38 propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder 39 39 40 propel.builder.addIncludes = false41 propel.builder.addComments = false40 propel.builder.addIncludes = true 41 propel.builder.addComments = true 42 42 propel.packageObjectModel = true 43 43 branches/dwhittle/1.2/test/other/tasksTest.php
r9921 r10995 7 7 define('DS', DIRECTORY_SEPARATOR); 8 8 9 class s ymfony_cmd9 class sf_test_project 10 10 { 11 11 public $php_cli = null; … … 18 18 $this->t = $t; 19 19 20 $this->tmp_dir = sfToolkit::getTmpDir().D IRECTORY_SEPARATOR.'symfony_cmd';20 $this->tmp_dir = sfToolkit::getTmpDir().DS.'sf_test_project'; 21 21 22 22 if (is_dir($this->tmp_dir)) … … 49 49 public function execute_command($cmd, $awaited_return=0) 50 50 { 51 chdir($this->tmp_dir); 51 52 $symfony = file_exists('symfony') ? 'symfony' : dirname(__FILE__).'/../../data/bin/symfony'; 52 53 53 54 ob_start(); 54 passthru(sprintf('%s -d html_errors=off -d open_basedir= -q"%s" %s 2>&1', $this->php_cli, $symfony, $cmd), $return);55 passthru(sprintf('%s "%s" %s 2>&1', $this->php_cli, $symfony, $cmd), $return); 55 56 $content = ob_get_clean(); 56 57 $this->t->cmp_ok($return, '==', $awaited_return, sprintf('"symfony %s" returns awaited value (%d)', $cmd, $awaited_return)); … … 65 66 } 66 67 67 $t = new lime_test(33, new lime_output_color());68 69 68 if (!extension_loaded('SQLite')) 70 69 { … … 74 73 } 75 74 76 $c = new symfony_cmd(); 75 $t = new lime_test(33, new lime_output_color()); 76 $c = new sf_test_project(); 77 77 $c->initialize($t); 78 78 … … 94 94 copy(dirname(__FILE__).'/fixtures/propel/propel.ini', $c->tmp_dir.DS.'config'.DS.'propel.ini'); 95 95 96 // update propel configuration paths 97 file_put_contents($c->tmp_dir.DS.'config'.DS.'propel.ini', str_replace('%SF_ROOT_DIR%', $c->tmp_dir, str_replace('%SF_DATA_DIR%', $c->tmp_dir.'/data', file_get_contents($c->tmp_dir.DS.'config'.DS.'propel.ini')))); 98 96 99 // propel:* 97 100 $content = $c->execute_command('propel:build-sql'); … … 102 105 103 106 $content = $c->execute_command('propel:build-form'); 104 $t->ok(file_exists($c->tmp_dir.DS.'lib'.DS.'form'.DS.' BaseFormPropel.class.php'), '"propel:build-form" creates form classes under "lib/form" directory');107 $t->ok(file_exists($c->tmp_dir.DS.'lib'.DS.'form'.DS.'base'.DS.'BaseFormPropel.class.php'), '"propel:build-form" creates form classes under "lib/form" directory'); 105 108 106 109 $c->execute_command('propel:insert-sql'); 107 $file = dirname(__FILE__).DS.'..'.DS.'..'.DS.'lib'.DS.'plugins'.DS.'sfPropelPlugin'.DS.'lib'.DS.'vendor'.DS.'propel-generator'.DS.'database.sqlite'; 108 $t->ok(file_exists($file), '"propel:insert-sql" creates tables in the database'); 109 rename($file, $c->tmp_dir.'/data/database.sqlite'); 110 $t->ok(file_exists($c->tmp_dir.DS.'data'.DS.'database.sqlite'), '"propel:insert-sql" creates tables in the database'); 110 111 111 112 $content = $c->execute_command('propel:generate-crud --generate-in-cache frontend articleInitCrud Article'); branches/dwhittle/1.2/test/unit/widget/sfWidgetTest.php
r10639 r10995 159 159 $t->is(sfWidget::isXhtml(), true, '::isXhtml() return true if the widget must returns XHTML tags'); 160 160 sfWidget::setXhtml(false); 161 $t->is($w->renderTag('input', array('value' => 'Test')), '<input value="Test"> </input>', '::setXhtml() changes the value of the XHTML tag');161 $t->is($w->renderTag('input', array('value' => 'Test')), '<input value="Test">', '::setXhtml() changes the value of the XHTML tag');