Development

Changeset 7131

You must first sign up to be able to contribute.

Changeset 7131

Show
Ignore:
Timestamp:
01/21/08 15:48:28 (10 months ago)
Author:
fabien
Message:

merged 1.1 branch changes (to r7127)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/LICENSE

    r355 r7131  
    1 Copyright (c) 2004-2006 Fabien Potencier 
     1Copyright (c) 2004-2008 Fabien Potencier 
    22 
    3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 
     3Permission is hereby granted, free of charge, to any person obtaining a copy 
     4of this software and associated documentation files (the "Software"), to deal 
     5in the Software without restriction, including without limitation the rights 
     6to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
     7copies of the Software, and to permit persons to whom the Software is furnished 
     8to do so, subject to the following conditions: 
    49 
    5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 
     10The above copyright notice and this permission notice shall be included in all 
     11copies or substantial portions of the Software. 
    612 
    7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
     13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
     14IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
     15FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
     16AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
     17LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
     18OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
     19THE SOFTWARE. 
  • trunk/UPGRADE

    r6779 r7131  
    388388        param: 
    389389          timeout:     1800     # session timeout in seconds 
     390 
     391`php.yml` configuration file 
     392---------------------------- 
     393 
     394The `php.yml` configuration file has been removed. 
     395 
     396The only setting you will have to check by hand is `log_errors`, which was set to `on` by `php.yml`. 
     397 
     398`php.yml` is replaced by the `check_configuration.php` utility you can find in `data/bin`. 
     399It checks your environment against symfony requirements. You can launch it from anywhere: 
     400 
     401   $ php /path/to/symfony/data/bin/check_configuration.php 
     402 
     403Even if you can use this utility from the command line, it's strongly recommended to launch it 
     404from the web by copying it under your web root directory as PHP can use different php.ini configuration 
     405files for the CLI and the web. 
  • trunk/data/bin/symfony.bat

    r3129 r7131  
    2121 
    2222IF EXIST ".\symfony" ( 
    23   %PHP_COMMAND% -d html_errors=off -d open_basedir= -q ".\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9 
     23  %PHP_COMMAND% ".\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9 
    2424) ELSE ( 
    25   %PHP_COMMAND% -d html_errors=off -d open_basedir= -q "%SCRIPT_DIR%\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9 
     25  %PHP_COMMAND% "%SCRIPT_DIR%\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9 
    2626) 
    2727goto cleanup 
  • trunk/data/config/config_handlers.yml

    r5384 r7131  
    11config/autoload.yml: 
    22  class:    sfAutoloadConfigHandler 
    3  
    4 config/php.yml: 
    5   class:    sfPhpConfigHandler 
    63 
    74config/databases.yml: 
     
    3027  class:    sfRoutingConfigHandler 
    3128 
    32 config/i18n.yml: 
    33   class:    sfDefineEnvironmentConfigHandler 
    34   param: 
    35     prefix: sf_i18n_ 
    36  
    3729modules/*/config/generator.yml: 
    3830  class:    sfGeneratorConfigHandler 
     
    4032modules/*/config/view.yml: 
    4133  class:    sfViewConfigHandler 
    42  
    43 modules/*/config/mailer.yml: 
    44   class:    sfDefineEnvironmentConfigHandler 
    45   param: 
    46     prefix: sf_mailer_ 
    47     module: yes 
    4834 
    4935modules/*/config/security.yml: 
  • trunk/data/skeleton/module/test/actionsTest.php

    r6224 r7131  
    55// create a new test browser 
    66$browser = new sfTestBrowser(); 
    7 $browser->initialize(); 
    87 
    98$browser-> 
  • trunk/data/skeleton/project/web/.htaccess

    r3246 r7131  
    99 
    1010  # we skip all files with .something 
    11   RewriteCond %{REQUEST_URI} \..+$ 
    12   RewriteCond %{REQUEST_URI} !\.html$ 
    13   RewriteRule .* - [L] 
     11  #RewriteCond %{REQUEST_URI} \..+$ 
     12  #RewriteCond %{REQUEST_URI} !\.html$ 
     13  #RewriteRule .* - [L] 
    1414 
    1515  # we check if the .html version is here (caching) 
  • trunk/lib/action/sfComponent.class.php

    r6509 r7131  
    237237   * Sets a variable for the template. 
    238238   * 
    239    * @param  string The variable name 
    240    * @param  mixed  The variable value 
    241    */ 
    242   public function setVar($name, $value) 
    243   { 
    244     $this->varHolder->set($name, $value); 
     239   * If you add a safe value, the variable won't be output escaped 
     240   * by symfony, so this is your responsability to ensure that the 
     241   * value is escaped properly. 
     242   * 
     243   * @param string  The variable name 
     244   * @param mixed   The variable value 
     245   * @param Boolean true if the value is safe for output (false by default) 
     246   */ 
     247  public function setVar($name, $value, $safe = false) 
     248  { 
     249    $this->varHolder->set($name, $safe ? new sfOutputEscaperSafe($value) : $value); 
    245250  } 
    246251 
  • trunk/lib/config/sfDatabaseConfigHandler.class.php

    r6779 r7131  
    5050 
    5151    // get a list of database connections 
    52     foreach ($myConfig as $key => $dbConfig) 
     52    foreach ($myConfig as $name => $dbConfig) 
    5353    { 
    5454      // is this category already registered? 
    55       if (in_array($key, $databases)) 
     55      if (in_array($name, $databases)) 
    5656      { 
    5757        // this category is already registered 
    58         throw new sfParseException(sprintf('Configuration file "%s" specifies previously registered category "%s".', $configFiles[0], $key)); 
     58        throw new sfParseException(sprintf('Configuration file "%s" specifies previously registered category "%s".', $configFiles[0], $name)); 
    5959      } 
    6060 
    6161      // add this database 
    62       $databases[] = $key
     62      $databases[] = $name
    6363 
    6464      // let's do our fancy work 
     
    6666      { 
    6767        // missing class key 
    68         throw new sfParseException(sprintf('Configuration file "%s" specifies category "%s" with missing class key.', $configFiles[0], $key)); 
     68        throw new sfParseException(sprintf('Configuration file "%s" specifies category "%s" with missing class key.', $configFiles[0], $name)); 
    6969      } 
    7070 
     
    7272      { 
    7373        // we have a file to include 
    74         $file = $this->replaceConstants($dbConfig['file']); 
    75         $file = $this->replacePath($file); 
     74        $file = $this->replacePath($this->replaceConstants($dbConfig['file'])); 
    7675 
    7776        if (!is_readable($file)) 
     
    8685 
    8786      // parse parameters 
     87      $parameters = array(); 
    8888      if (isset($dbConfig['param'])) 
    8989      { 
    90         foreach ($dbConfig['param'] as &$value) 
     90        foreach ($dbConfig['param'] as $key => $value) 
    9191        { 
    92           $value = $this->replaceConstants($value); 
     92          $parameters[$key] = $this->replaceConstants($value); 
    9393        } 
    94  
    95         $parameters = var_export($dbConfig['param'], true); 
    9694      } 
    97       else 
    98       { 
    99         $parameters = 'null'; 
    100       } 
     95      $parameters['name'] = $name; 
    10196 
    10297      // append new data 
    103       $data[] = sprintf("\n\$database = new %s(%s, '%s');\n". 
    104                         "\$this->databases['%s'] = \$database;", 
    105                         $dbConfig['class'], $parameters, $key, $key); 
     98      $data[] = sprintf("\n\$this->databases['%s'] = new %s(%s);", $name, $dbConfig['class'], var_export($parameters, true)); 
    10699    } 
    107100 
    108101    // compile data 
    109     $retval = sprintf("<?php\n". 
     102    return sprintf("<?php\n". 
    110103                      "// auto-generated by sfDatabaseConfigHandler\n". 
    111104                      "// date: %s%s\n%s\n", 
    112105                      date('Y/m/d H:i:s'), implode("\n", $includes), implode("\n", $data)); 
    113  
    114     return $retval; 
    115106  } 
    116107} 
  • trunk/lib/config/sfLoader.class.php

    r6779 r7131  
    414414  } 
    415415 
     416  /** 
     417   * Loads config.php files from plugins 
     418   * 
     419   * @return void 
     420   */ 
    416421  static public function loadPluginConfig() 
    417422  { 
    418423    if ($pluginConfigs = glob(sfConfig::get('sf_symfony_lib_dir').'/plugins/*/config/config.php')) 
    419424    { 
     425      foreach($pluginConfigs as $config) 
     426      { 
     427        require_once($config); 
     428      } 
     429    } 
     430 
     431    if ($pluginConfigs = glob(sfConfig::get('sf_plugins_dir').'/*/config/config.php')) 
     432    { 
    420433      foreach ($pluginConfigs as $config) 
    421434      { 
    422         include($config); 
    423       } 
    424     } 
    425  
    426     if ($pluginConfigs = glob(sfConfig::get('sf_plugins_dir').'/*/config/config.php')) 
    427     { 
    428       foreach ($pluginConfigs as $config) 
    429       { 
    430         include($config); 
     435        require_once($config); 
    431436      } 
    432437    } 
  • trunk/lib/controller/sfController.class.php

    r6779 r7131  
    205205      } 
    206206 
    207       // track the requested module so we have access to the data in the error 404 page 
    208       $this->context->getRequest()->setAttribute('requested_action', $actionName); 
    209       $this-