Development

Changeset 10995

You must first sign up to be able to contribute.

Changeset 10995

Show
Ignore:
Timestamp:
08/20/08 10:59:54 (3 months ago)
Author:
dwhittle
Message:

dwhittle: merged changes to branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.1/lib/config/config/settings.yml

    r8315 r10995  
    1919    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. 
    2020    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. 
    2222 
    2323    # Form security secret (CSRF protection) 
  • branches/dwhittle/1.1/lib/helper/FormHelper.php

    r10004 r10995  
    745745  // register our javascripts and stylesheets 
    746746  $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')) && 
    748748     (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 
    749749  { 
    750750   $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')) && 
    752752      (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 
    753753   { 
  • branches/dwhittle/1.1/lib/task/generator/skeleton/app/app/config/settings.yml

    r9803 r10995  
    4848    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. 
    4949    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
    5151 
    5252    # Form security secret (CSRF protection) 
  • branches/dwhittle/1.1/lib/widget/sfWidget.class.php

    r9056 r10995  
    276276    } 
    277277 
    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) : '>')); 
    279279  } 
    280280 
  • branches/dwhittle/1.1/test/unit/widget/sfWidgetTest.php

    r10639 r10995  
    159159$t->is(sfWidget::isXhtml(), true, '::isXhtml() return true if the widget must returns XHTML tags'); 
    160160sfWidget::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() changesthe value of the XHTML tag'); 
  • branches/dwhittle/1.2/lib/action/sfAction.class.php

    r10879 r10995  
    345345 
    346346  /** 
     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  /** 
    347421   * Returns the security configuration for this module. 
    348422   * 
  • branches/dwhittle/1.2/lib/config/config/settings.yml

    r10639 r10995  
    1919    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. 
    2020    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. 
    2222 
    2323    # Form security secret (CSRF protection) 
     
    3131    relative_url_root:      ~         # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. 
    3232    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:    ' &darr;&nbsp;' 
     36    validation_error_suffix:    ' &nbsp;&darr;' 
     37    validation_error_class:     form_error 
     38    validation_error_id_prefix: error_for_ 
    3339 
    3440    # Cache settings 
     
    6874    # i18n 
    6975    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  
    8080  static public function getContent(sfGeneratorManager $generatorManager, $class, $parameters) 
    8181  { 
    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 
     89sfConfig::set('sf_compat_10', true); 
     90require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php'; 
     91 
     92EOF; 
     93    } 
     94 
     95    $data .= $generatorManager->generate($class, $parameters); 
     96 
     97    return $data; 
    8398  } 
    8499 
  • branches/dwhittle/1.2/lib/debug/sfWebDebug.class.php

    r9459 r10995  
    179179 
    180180        // 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)) 
    182182        { 
    183183          $sqlLogs[] .= $match[1]; 
  • branches/dwhittle/1.2/lib/helper/FormHelper.php

    r9967 r10995  
    743743  // register our javascripts and stylesheets 
    744744  $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')) && 
    746746     (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 
    747747  { 
    748748   $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')) && 
    750750      (!is_readable(sfConfig::get('sf_web_dir').'/'.$langFile.'.js'))) 
    751751   { 
  • branches/dwhittle/1.2/lib/helper/ObjectHelper.php

    r10979 r10995  
    7373  { 
    7474    // text method exists? 
    75     if ($text_method && !method_exists(array($option, $text_method))) 
     75    if ($text_method && !method_exists($option, $text_method)) 
    7676    { 
    7777      throw new sfViewException(sprintf('Method "%s" doesn\'t exist for object of class "%s".', $text_method, _get_class_decorated($option))); 
     
    168168        foreach (array($text_method, '__toString', 'toString', $key_method) as $method) 
    169169        { 
    170           if (method_exists(array($tmp_object, $method))) 
     170          if (method_exists($tmp_object, $method)) 
    171171          { 
    172172            $methodToCall = $method; 
     
    298298 
    299299  // method exists? 
    300   if (!method_exists(array($object, $method[0]))) 
     300  if (!method_exists($object, $method[0])) 
    301301  { 
    302302    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 
     3if (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&auml;nger Emailadresse an.'; 
     11$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wird nicht unterst&uuml;tzt.'; 
     12$PHPMAILER_LANG["execute"] = 'Konnte folgenden Befehl nicht ausf&uuml;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&auml;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 &ouml;ffnen: '; 
     22$PHPMAILER_LANG["encoding"] = 'Unbekanntes Encoding-Format: '; 
  • branches/dwhittle/1.2/lib/plugins/sfCompat10Plugin/test/functional/fillInFilterTest.php

    r10639 r10995  
    3232  checkResponseElement('input[name="first_name"][value="fabien"]') 
    3333; 
    34  
  • branches/dwhittle/1.2/lib/task/generator/skeleton/app/app/config/settings.yml

    r10639 r10995  
    4949#    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. 
    5050#    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. 
    5252# 
    5353#    # Routing settings 
    5454#    relative_url_root:                # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root. 
    5555#    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:    ' &darr;&nbsp;' 
     59#    validation_error_suffix:    ' &nbsp;&darr;' 
     60#    validation_error_class:     form_error 
     61#    validation_error_id_prefix: error_for_ 
    5662# 
    5763#    # Cache settings 
     
    9197#    # i18n 
    9298#    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  
    4343 
    4444    $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    } 
    4551 
    4652    sfLoader::loadHelpers($helpers); 
  • branches/dwhittle/1.2/lib/widget/sfWidget.class.php

    r10639 r10995  
    276276    } 
    277277 
    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) : '>')); 
    279279  } 
    280280 
  • branches/dwhittle/1.2/test/other/fixtures/propel/databases.yml

    r6551 r10995  
    33    class:      sfPropelDatabase 
    44    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  
    22propel.project             = project 
    33propel.database            = sqlite 
    4 propel.database.createUrl  = sqlite://./database.sqlite 
    5 propel.database.url        = sqlite://./database.sqlite 
     4propel.database.createUrl  = sqlite:%SF_DATA_DIR%/database.sqlite 
     5propel.database.url        = sqlite:%SF_DATA_DIR%/database.sqlite 
    66 
    77propel.addGenericAccessors = true 
     
    1313; directories 
    1414propel.home                    = . 
    15 propel.output.dir              = /tmp 
     15propel.output.dir              = %SF_ROOT_DIR% 
    1616propel.schema.dir              = ${propel.output.dir}/config 
    1717propel.conf.dir                = ${propel.output.dir}/config 
     
    3838propel.builder.nodepeerstub.class      = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder 
    3939 
    40 propel.builder.addIncludes = fals
    41 propel.builder.addComments = fals
     40propel.builder.addIncludes = tru
     41propel.builder.addComments = tru
    4242propel.packageObjectModel = true 
    4343 
  • branches/dwhittle/1.2/test/other/tasksTest.php

    r9921 r10995  
    77define('DS', DIRECTORY_SEPARATOR); 
    88 
    9 class symfony_cmd 
     9class sf_test_project 
    1010{ 
    1111  public $php_cli = null; 
     
    1818    $this->t = $t; 
    1919 
    20     $this->tmp_dir = sfToolkit::getTmpDir().DIRECTORY_SEPARATOR.'symfony_cmd'; 
     20    $this->tmp_dir = sfToolkit::getTmpDir().DS.'sf_test_project'; 
    2121 
    2222    if (is_dir($this->tmp_dir)) 
     
    4949  public function execute_command($cmd, $awaited_return=0) 
    5050  { 
     51    chdir($this->tmp_dir); 
    5152    $symfony = file_exists('symfony') ? 'symfony' : dirname(__FILE__).'/../../data/bin/symfony'; 
    5253 
    5354    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); 
    5556    $content = ob_get_clean(); 
    5657    $this->t->cmp_ok($return, '==', $awaited_return, sprintf('"symfony %s" returns awaited value (%d)', $cmd, $awaited_return)); 
     
    6566} 
    6667 
    67 $t = new lime_test(33, new lime_output_color()); 
    68  
    6968if (!extension_loaded('SQLite')) 
    7069{ 
     
    7473} 
    7574 
    76 $c = new symfony_cmd(); 
     75$t = new lime_test(33, new lime_output_color()); 
     76$c = new sf_test_project(); 
    7777$c->initialize($t); 
    7878 
     
    9494copy(dirname(__FILE__).'/fixtures/propel/propel.ini', $c->tmp_dir.DS.'config'.DS.'propel.ini'); 
    9595 
     96// update propel configuration paths 
     97file_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 
    9699// propel:* 
    97100$content = $c->execute_command('propel:build-sql'); 
     
    102105 
    103106$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'); 
    105108 
    106109$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'); 
    110111 
    111112$content = $c->execute_command('propel:generate-crud --generate-in-cache frontend articleInitCrud Article'); 
  • branches/dwhittle/1.2/test/unit/widget/sfWidgetTest.php

    r10639 r10995  
    159159$t->is(sfWidget::isXhtml(), true, '::isXhtml() return true if the widget must returns XHTML tags'); 
    160160sfWidget::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');