3.1 changelog improvements

This commit is contained in:
Ingo Schommer 2013-03-25 09:52:55 +01:00
parent 3334eafcb1
commit c8f26e673a

View File

@ -40,9 +40,8 @@ The configuration system added in SilverStripe 3.0 builds on this by using this
of defining the default value. of defining the default value.
In SilverStripe 3.0, it was possible to edit this value at run-time and have the change propagate into the In SilverStripe 3.0, it was possible to edit this value at run-time and have the change propagate into the
configuration system. This is no longer the case, for performance reasons. If you change a static value configuration system. This is no longer the case, for performance reasons. We've marked all "configurable"
through direct assignment, then the configuration system will silently ignore it. statics as `private`, so you can't set or retrieve their value directly.
Reading a static value directly will give you stale data.
When using static setters or getters, the system throws a deprecation warning. When using static setters or getters, the system throws a deprecation warning.
Notable exceptions to this rule are all static setters which accept objects, such as `SS_Cache::add_backend()`. Notable exceptions to this rule are all static setters which accept objects, such as `SS_Cache::add_backend()`.
@ -60,12 +59,12 @@ Here's an example on how to rewrite a common `_config.php` configuration:
global $database; global $database;
$database = 'SS_mydb'; $database = 'SS_mydb';
require_once('conf/ConfigureFromEnv.php'); require_once('conf/ConfigureFromEnv.php');
SSViewer::set_theme('simple'); SSViewer::set_theme('simple');
if(class_exists('SiteTree')) SiteTree::enable_nested_urls(); if(class_exists('SiteTree')) SiteTree::enable_nested_urls();
if(Director::isLive()) Email::setAdminEmail('support@mydomain.com'); if(Director::isLive()) Email::setAdminEmail('support@mydomain.com');
if(is_defined('MY_REDIRECT_EMAILS')) Email::send_all_emails_to('developer@mydomain.com'); if(is_defined('MY_REDIRECT_EMAILS')) Email::send_all_emails_to('developer@mydomain.com');
@ -76,7 +75,7 @@ Here's an example on how to rewrite a common `_config.php` configuration:
SSViewer::set_theme('basic'); SSViewer::set_theme('basic');
} }
The ugpraded `_config.php`: The ugpraded `_config.php`:
:::php :::php
<?php <?php
@ -85,11 +84,11 @@ Here's an example on how to rewrite a common `_config.php` configuration:
global $database; global $database;
$database = 'SS_mydb'; $database = 'SS_mydb';
require_once('conf/ConfigureFromEnv.php'); require_once('conf/ConfigureFromEnv.php');
// Removed SiteTree::enable_nested_urls() since its configured by default // Removed SiteTree::enable_nested_urls() since its configured by default
// Requires PHP objects, keep in PHP config // Requires PHP objects, keep in PHP config
SS_Log::add_writer(new SS_LogFileWriter(BASE_PATH . '/mylog.log'), SS_Log::WARN); SS_Log::add_writer(new SS_LogFileWriter(BASE_PATH . '/mylog.log'), SS_Log::WARN);
// Non-trivial conditional, keep in PHP config // Non-trivial conditional, keep in PHP config
@ -98,7 +97,7 @@ Here's an example on how to rewrite a common `_config.php` configuration:
Config::inst()->update('SSViewer'. 'theme', 'basic'); Config::inst()->update('SSViewer'. 'theme', 'basic');
} }
The upgraded `config.yml`: The upgraded `config.yml`:
:::yml :::yml
--- ---
@ -122,6 +121,11 @@ Some examples of changed notations (not exhaustive, there's over a hundred in to
* `Director::setBaseURL`: Use `Director.alternate_base_url` instead * `Director::setBaseURL`: Use `Director.alternate_base_url` instead
* `SSViewer::setOption('rewriteHashlinks', ...)`: Use `SSViewer.rewrite_hashlinks` instead * `SSViewer::setOption('rewriteHashlinks', ...)`: Use `SSViewer.rewrite_hashlinks` instead
**Important**: Please remember to upgrade the installer project as well, particularly
your `.htaccess` or `web.config` files. Web access to these sensitive YAML configuration files
needs to be explicitly denied through these configuration files (see the [3.0.5 security release](/changelogs/3.0.4))
for details.
For more information about how to use the config system, see the ["Configuration" topic](/topic/configuration). For more information about how to use the config system, see the ["Configuration" topic](/topic/configuration).
### default_cast is now Text ### default_cast is now Text