Set deprecation level for all changes in 3.x to 4.0

This commit is contained in:
Damian Mooyman 2015-06-19 11:59:27 +12:00
parent 1d122803cc
commit e14f743bf0
39 changed files with 336 additions and 312 deletions

View File

@ -1623,10 +1623,12 @@ class LeftAndMain extends Controller implements PermissionProvider {
/** /**
* Sets the href for the anchor on the Silverstripe logo in the menu * Sets the href for the anchor on the Silverstripe logo in the menu
* *
* @deprecated since version 4.0
*
* @param String $link * @param String $link
*/ */
public static function set_application_link($link) { public static function set_application_link($link) {
Deprecation::notice('3.2', 'Use the "LeftAndMain.application_link" config setting instead'); Deprecation::notice('4.0', 'Use the "LeftAndMain.application_link" config setting instead');
Config::inst()->update('LeftAndMain', 'application_link', $link); Config::inst()->update('LeftAndMain', 'application_link', $link);
} }
@ -1648,9 +1650,10 @@ class LeftAndMain extends Controller implements PermissionProvider {
/** /**
* @param String $name * @param String $name
* @deprecated since version 4.0
*/ */
public static function setApplicationName($name) { public static function setApplicationName($name) {
Deprecation::notice('3.2', 'Use the "LeftAndMain.application_name" config setting instead'); Deprecation::notice('4.0', 'Use the "LeftAndMain.application_name" config setting instead');
Config::inst()->update('LeftAndMain', 'application_name', $name); Config::inst()->update('LeftAndMain', 'application_name', $name);
} }
@ -1747,21 +1750,24 @@ class LeftAndMain extends Controller implements PermissionProvider {
/** /**
* Register the given javascript file as required in the CMS. * Register the given javascript file as required in the CMS.
* Filenames should be relative to the base, eg, FRAMEWORK_DIR . '/javascript/loader.js' * Filenames should be relative to the base, eg, FRAMEWORK_DIR . '/javascript/loader.js'
*
* @deprecated since version 4.0
*/ */
public static function require_javascript($file) { public static function require_javascript($file) {
Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_javascript" config setting instead'); Deprecation::notice('4.0', 'Use "LeftAndMain.extra_requirements_javascript" config setting instead');
Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', array($file => array())); Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', array($file => array()));
} }
/** /**
* Register the given stylesheet file as required. * Register the given stylesheet file as required.
* @deprecated since version 4.0
* *
* @param $file String Filenames should be relative to the base, eg, THIRDPARTY_DIR . '/tree/tree.css' * @param $file String Filenames should be relative to the base, eg, THIRDPARTY_DIR . '/tree/tree.css'
* @param $media String Comma-separated list of media-types (e.g. "screen,projector") * @param $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html * @see http://www.w3.org/TR/REC-CSS2/media.html
*/ */
public static function require_css($file, $media = null) { public static function require_css($file, $media = null) {
Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_css" config setting instead'); Deprecation::notice('4.0', 'Use "LeftAndMain.extra_requirements_css" config setting instead');
Config::inst()->update('LeftAndMain', 'extra_requirements_css', array($file => array('media' => $media))); Config::inst()->update('LeftAndMain', 'extra_requirements_css', array($file => array('media' => $media)));
} }
@ -1770,11 +1776,13 @@ class LeftAndMain extends Controller implements PermissionProvider {
* Themeable stylesheets have globally unique names, just like templates and PHP files. * Themeable stylesheets have globally unique names, just like templates and PHP files.
* Because of this, they can be replaced by similarly named CSS files in the theme directory. * Because of this, they can be replaced by similarly named CSS files in the theme directory.
* *
* @deprecated since version 4.0
*
* @param $name String The identifier of the file. For example, css/MyFile.css would have the identifier "MyFile" * @param $name String The identifier of the file. For example, css/MyFile.css would have the identifier "MyFile"
* @param $media String Comma-separated list of media-types (e.g. "screen,projector") * @param $media String Comma-separated list of media-types (e.g. "screen,projector")
*/ */
public static function require_themed_css($name, $media = null) { public static function require_themed_css($name, $media = null) {
Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_themedCss" config setting instead'); Deprecation::notice('4.0', 'Use "LeftAndMain.extra_requirements_themedCss" config setting instead');
Config::inst()->update('LeftAndMain', 'extra_requirements_themedCss', array($name => array('media' => $media))); Config::inst()->update('LeftAndMain', 'extra_requirements_themedCss', array($name => array('media' => $media)));
} }

View File

@ -465,20 +465,20 @@ abstract class ModelAdmin extends LeftAndMain {
* overwrite the static page_length of the admin panel, * overwrite the static page_length of the admin panel,
* should be called in the project _config file. * should be called in the project _config file.
* *
* @deprecated 3.2 Use "ModelAdmin.page_length" config setting * @deprecated 4.0 Use "ModelAdmin.page_length" config setting
*/ */
public static function set_page_length($length){ public static function set_page_length($length){
Deprecation::notice('3.2', 'Use "ModelAdmin.page_length" config setting'); Deprecation::notice('4.0', 'Use "ModelAdmin.page_length" config setting');
self::config()->page_length = $length; self::config()->page_length = $length;
} }
/** /**
* Return the static page_length of the admin, default as 30 * Return the static page_length of the admin, default as 30
* *
* @deprecated 3.2 Use "ModelAdmin.page_length" config setting * @deprecated 4.0 Use "ModelAdmin.page_length" config setting
*/ */
public static function get_page_length(){ public static function get_page_length(){
Deprecation::notice('3.2', 'Use "ModelAdmin.page_length" config setting'); Deprecation::notice('4.0', 'Use "ModelAdmin.page_length" config setting');
return self::config()->page_length; return self::config()->page_length;
} }

View File

@ -334,41 +334,41 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
* The permissions represented in the $codes will not appearing in the form * The permissions represented in the $codes will not appearing in the form
* containing {@link PermissionCheckboxSetField} so as not to be checked / unchecked. * containing {@link PermissionCheckboxSetField} so as not to be checked / unchecked.
* *
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @param $codes String|Array * @param $codes String|Array
*/ */
public static function add_hidden_permission($codes){ public static function add_hidden_permission($codes){
if(is_string($codes)) $codes = array($codes); if(is_string($codes)) $codes = array($codes);
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->update('Permission', 'hidden_permissions', $codes); Config::inst()->update('Permission', 'hidden_permissions', $codes);
} }
/** /**
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @param $codes String|Array * @param $codes String|Array
*/ */
public static function remove_hidden_permission($codes){ public static function remove_hidden_permission($codes){
if(is_string($codes)) $codes = array($codes); if(is_string($codes)) $codes = array($codes);
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->remove('Permission', 'hidden_permissions', $codes); Config::inst()->remove('Permission', 'hidden_permissions', $codes);
} }
/** /**
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @return Array * @return Array
*/ */
public static function get_hidden_permissions(){ public static function get_hidden_permissions(){
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->get('Permission', 'hidden_permissions', Config::FIRST_SET); Config::inst()->get('Permission', 'hidden_permissions', Config::FIRST_SET);
} }
/** /**
* Clear all permissions previously hidden with {@link add_hidden_permission} * Clear all permissions previously hidden with {@link add_hidden_permission}
* *
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
*/ */
public static function clear_hidden_permissions(){ public static function clear_hidden_permissions(){
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->remove('Permission', 'hidden_permissions', Config::anything()); Config::inst()->remove('Permission', 'hidden_permissions', Config::anything());
} }
} }

View File

@ -47,22 +47,22 @@ class RestfulService extends ViewableData implements Flushable {
* set a curl option that will be applied to all requests as default * set a curl option that will be applied to all requests as default
* {@see http://php.net/manual/en/function.curl-setopt.php#refsect1-function.curl-setopt-parameters} * {@see http://php.net/manual/en/function.curl-setopt.php#refsect1-function.curl-setopt-parameters}
* *
* @deprecated 3.2 Use the "RestfulService.default_curl_options" config setting instead * @deprecated 4.0 Use the "RestfulService.default_curl_options" config setting instead
* @param int $option The cURL opt Constant * @param int $option The cURL opt Constant
* @param mixed $value The cURL opt value * @param mixed $value The cURL opt value
*/ */
public static function set_default_curl_option($option, $value) { public static function set_default_curl_option($option, $value) {
Deprecation::notice('3.2', 'Use the "RestfulService.default_curl_options" config setting instead'); Deprecation::notice('4.0', 'Use the "RestfulService.default_curl_options" config setting instead');
Config::inst()->update('RestfulService', 'default_curl_options', array($option => $value)); Config::inst()->update('RestfulService', 'default_curl_options', array($option => $value));
} }
/** /**
* set many defauly curl options at once * set many defauly curl options at once
* *
* @deprecated 3.2 Use the "RestfulService.default_curl_options" config setting instead * @deprecated 4.0 Use the "RestfulService.default_curl_options" config setting instead
*/ */
public static function set_default_curl_options($optionArray) { public static function set_default_curl_options($optionArray) {
Deprecation::notice('3.2', 'Use the "RestfulService.default_curl_options" config setting instead'); Deprecation::notice('4.0', 'Use the "RestfulService.default_curl_options" config setting instead');
Config::inst()->update('RestfulService', 'default_curl_options', $optionArray); Config::inst()->update('RestfulService', 'default_curl_options', $optionArray);
} }
@ -74,12 +74,12 @@ class RestfulService extends ViewableData implements Flushable {
* @param string $user The proxy auth user name * @param string $user The proxy auth user name
* @param string $password The proxy auth password * @param string $password The proxy auth password
* @param boolean $socks Set true to use socks5 proxy instead of http * @param boolean $socks Set true to use socks5 proxy instead of http
* @deprecated 3.2 Use the "RestfulService.default_curl_options" config setting instead, * @deprecated 4.0 Use the "RestfulService.default_curl_options" config setting instead,
* with direct reference to the CURL_* options * with direct reference to the CURL_* options
*/ */
public static function set_default_proxy($proxy, $port = 80, $user = "", $password = "", $socks = false) { public static function set_default_proxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
Deprecation::notice( Deprecation::notice(
'3.1', '4.0',
'Use the "RestfulService.default_curl_options" config setting instead, ' 'Use the "RestfulService.default_curl_options" config setting instead, '
. 'with direct reference to the CURL_* options' . 'with direct reference to the CURL_* options'
); );
@ -144,8 +144,11 @@ class RestfulService extends ViewableData implements Flushable {
$this->customHeaders[] = $header; $this->customHeaders[] = $header;
} }
/**
* @deprecated since version 4.0
*/
protected function constructURL(){ protected function constructURL(){
Deprecation::notice('3.2', 'constructURL is deprecated, please use `getAbsoluteRequestURL` instead'); Deprecation::notice('4.0', 'constructURL is deprecated, please use `getAbsoluteRequestURL` instead');
return Controller::join_links($this->baseURL, '?' . $this->queryString); return Controller::join_links($this->baseURL, '?' . $this->queryString);
} }
@ -616,9 +619,10 @@ class RestfulService_Response extends SS_HTTPResponse {
/** /**
* @param string * @param string
* @deprecated since version 4.0
*/ */
public function setCachedBody($content) { public function setCachedBody($content) {
Deprecation::notice('3.2', 'Setting the response body is now deprecated, set the cached request instead'); Deprecation::notice('4.0', 'Setting the response body is now deprecated, set the cached request instead');
if (!$this->cachedResponse) { if (!$this->cachedResponse) {
$this->cachedResponse = new RestfulService_Response($content); $this->cachedResponse = new RestfulService_Response($content);
} }

View File

@ -56,10 +56,10 @@ class ContentNegotiator extends Object {
* Set the character set encoding for this page. By default it's utf-8, but you could change it to, say, * Set the character set encoding for this page. By default it's utf-8, but you could change it to, say,
* windows-1252, to improve interoperability with extended characters being imported from windows excel. * windows-1252, to improve interoperability with extended characters being imported from windows excel.
* *
* @deprecated 3.2 Use the "ContentNegotiator.encoding" config setting instead * @deprecated 4.0 Use the "ContentNegotiator.encoding" config setting instead
*/ */
public static function set_encoding($encoding) { public static function set_encoding($encoding) {
Deprecation::notice('3.2', 'Use the "ContentNegotiator.encoding" config setting instead'); Deprecation::notice('4.0', 'Use the "ContentNegotiator.encoding" config setting instead');
Config::inst()->update('ContentNegotiator', 'encoding', $encoding); Config::inst()->update('ContentNegotiator', 'encoding', $encoding);
} }
@ -67,30 +67,30 @@ class ContentNegotiator extends Object {
* Return the character encoding set bhy ContentNegotiator::set_encoding(). It's recommended that all classes * Return the character encoding set bhy ContentNegotiator::set_encoding(). It's recommended that all classes
* that need to specify the character set make use of this function. * that need to specify the character set make use of this function.
* *
* @deprecated 3.2 Use the "ContentNegotiator.encoding" config setting instead * @deprecated 4.0 Use the "ContentNegotiator.encoding" config setting instead
*/ */
public static function get_encoding() { public static function get_encoding() {
Deprecation::notice('3.2', 'Use the "ContentNegotiator.encoding" config setting instead'); Deprecation::notice('4.0', 'Use the "ContentNegotiator.encoding" config setting instead');
return Config::inst()->get('ContentNegotiator', 'encoding'); return Config::inst()->get('ContentNegotiator', 'encoding');
} }
/** /**
* Enable content negotiation for all templates, not just those with the xml header. * Enable content negotiation for all templates, not just those with the xml header.
* *
* @deprecated 3.2 Use the "ContentNegotiator.enabled" config setting instead * @deprecated 4.0 Use the "ContentNegotiator.enabled" config setting instead
*/ */
public static function enable() { public static function enable() {
Deprecation::notice('3.2', 'Use the "ContentNegotiator.enabled" config setting instead'); Deprecation::notice('4.0', 'Use the "ContentNegotiator.enabled" config setting instead');
Config::inst()->update('ContentNegotiator', 'enabled', true); Config::inst()->update('ContentNegotiator', 'enabled', true);
} }
/** /**
* Disable content negotiation for all templates, not just those with the xml header. * Disable content negotiation for all templates, not just those with the xml header.
* *
* @deprecated 3.2 Use the "ContentNegotiator.enabled" config setting instead * @deprecated 4.0 Use the "ContentNegotiator.enabled" config setting instead
*/ */
public static function disable() { public static function disable() {
Deprecation::notice('3.2', 'Use the "ContentNegotiator.enabled" config setting instead'); Deprecation::notice('4.0', 'Use the "ContentNegotiator.enabled" config setting instead');
Config::inst()->update('ContentNegotiator', 'enabled', false); Config::inst()->update('ContentNegotiator', 'enabled', false);
} }

View File

@ -69,13 +69,13 @@ class Director implements TemplateGlobalProvider {
* *
* The director is responsible for turning URLs into Controller objects. * The director is responsible for turning URLs into Controller objects.
* *
* @deprecated 3.2 Use the "Director.rules" config setting instead * @deprecated 4.0 Use the "Director.rules" config setting instead
* @param $priority The priority of the rules; higher values will get your rule checked first. We recommend * @param $priority The priority of the rules; higher values will get your rule checked first. We recommend
* priority 100 for your site's rules. The built-in rules are priority 10, standard modules are * priority 100 for your site's rules. The built-in rules are priority 10, standard modules are
* priority 50. * priority 50.
*/ */
public static function addRules($priority, $rules) { public static function addRules($priority, $rules) {
Deprecation::notice('3.2', 'Use the "Director.rules" config setting instead'); Deprecation::notice('4.0', 'Use the "Director.rules" config setting instead');
Config::inst()->update('Director', 'rules', $rules); Config::inst()->update('Director', 'rules', $rules);
} }
@ -575,10 +575,10 @@ class Director implements TemplateGlobalProvider {
* Sets the root URL for the website. * Sets the root URL for the website.
* If the site isn't accessible from the URL you provide, weird things will happen. * If the site isn't accessible from the URL you provide, weird things will happen.
* *
* @deprecated 3.2 Use the "Director.alternate_base_url" config setting instead * @deprecated 4.0 Use the "Director.alternate_base_url" config setting instead
*/ */
public static function setBaseURL($baseURL) { public static function setBaseURL($baseURL) {
Deprecation::notice('3.2', 'Use the "Director.alternate_base_url" config setting instead'); Deprecation::notice('4.0', 'Use the "Director.alternate_base_url" config setting instead');
Config::inst()->update('Director', 'alternate_base_url', $baseURL); Config::inst()->update('Director', 'alternate_base_url', $baseURL);
} }
@ -595,10 +595,10 @@ class Director implements TemplateGlobalProvider {
* Sets the root folder for the website. * Sets the root folder for the website.
* If the site isn't accessible from the folder you provide, weird things will happen. * If the site isn't accessible from the folder you provide, weird things will happen.
* *
* @deprecated 3.2 Use the "Director.alternate_base_folder" config setting instead * @deprecated 4.0 Use the "Director.alternate_base_folder" config setting instead
*/ */
public static function setBaseFolder($baseFolder) { public static function setBaseFolder($baseFolder) {
Deprecation::notice('3.2', 'Use the "Director.alternate_base_folder" config setting instead'); Deprecation::notice('4.0', 'Use the "Director.alternate_base_folder" config setting instead');
Config::inst()->update('Director', 'alternate_base_folder', $baseFolder); Config::inst()->update('Director', 'alternate_base_folder', $baseFolder);
} }
@ -971,7 +971,7 @@ class Director implements TemplateGlobalProvider {
* Once the environment type is set, it can be checked with {@link Director::isDev()}, {@link Director::isTest()}, * Once the environment type is set, it can be checked with {@link Director::isDev()}, {@link Director::isTest()},
* and {@link Director::isLive()}. * and {@link Director::isLive()}.
* *
* @deprecated 3.2 Use the "Director.environment_type" config setting instead * @deprecated 4.0 Use the "Director.environment_type" config setting instead
* @param $et string The environment type: dev, test, or live. * @param $et string The environment type: dev, test, or live.
*/ */
public static function set_environment_type($et) { public static function set_environment_type($et) {
@ -979,7 +979,7 @@ class Director implements TemplateGlobalProvider {
user_error("Director::set_environment_type passed '$et'. It should be passed dev, test, or live", user_error("Director::set_environment_type passed '$et'. It should be passed dev, test, or live",
E_USER_WARNING); E_USER_WARNING);
} else { } else {
Deprecation::notice('3.2', 'Use the "Director.environment_type" config setting instead'); Deprecation::notice('4.0', 'Use the "Director.environment_type" config setting instead');
Config::inst()->update('Director', 'environment_type', $et); Config::inst()->update('Director', 'environment_type', $et);
} }
} }

View File

@ -103,7 +103,7 @@ class HTTP {
*/ */
public static function urlRewriter($content, $code) { public static function urlRewriter($content, $code) {
if(!is_callable($code)) { if(!is_callable($code)) {
Deprecation::notice(3.1, 'HTTP::urlRewriter expects a callable as the second parameter'); Deprecation::notice('4.0', 'HTTP::urlRewriter expects a callable as the second parameter');
} }
// Replace attributes // Replace attributes

View File

@ -162,24 +162,24 @@ class Session {
* To make cookies visible on all subdomains then the domain * To make cookies visible on all subdomains then the domain
* must be prefixed with a dot like '.php.net'. * must be prefixed with a dot like '.php.net'.
* *
* @deprecated 3.2 Use the "Session.cookie_domain" config setting instead * @deprecated 4.0 Use the "Session.cookie_domain" config setting instead
* *
* @param string $domain The domain to set * @param string $domain The domain to set
*/ */
public static function set_cookie_domain($domain) { public static function set_cookie_domain($domain) {
Deprecation::notice('3.2', 'Use the "Session.cookie_domain" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_domain" config setting instead');
Config::inst()->update('Session', 'cookie_domain', $domain); Config::inst()->update('Session', 'cookie_domain', $domain);
} }
/** /**
* Get the cookie domain. * Get the cookie domain.
* *
* @deprecated 3.2 Use the "Session.cookie_domain" config setting instead * @deprecated 4.0 Use the "Session.cookie_domain" config setting instead
* *
* @return string * @return string
*/ */
public static function get_cookie_domain() { public static function get_cookie_domain() {
Deprecation::notice('3.2', 'Use the "Session.cookie_domain" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_domain" config setting instead');
return Config::inst()->get('Session', 'cookie_domain'); return Config::inst()->get('Session', 'cookie_domain');
} }
@ -187,24 +187,24 @@ class Session {
* Path to set on the domain where the session cookie will work. * Path to set on the domain where the session cookie will work.
* Use a single slash ('/') for all paths on the domain. * Use a single slash ('/') for all paths on the domain.
* *
* @deprecated 3.2 Use the "Session.cookie_path" config setting instead * @deprecated 4.0 Use the "Session.cookie_path" config setting instead
* *
* @param string $path The path to set * @param string $path The path to set
*/ */
public static function set_cookie_path($path) { public static function set_cookie_path($path) {
Deprecation::notice('3.2', 'Use the "Session.cookie_path" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_path" config setting instead');
Config::inst()->update('Session', 'cookie_path', $path); Config::inst()->update('Session', 'cookie_path', $path);
} }
/** /**
* Get the path on the domain where the session cookie will work. * Get the path on the domain where the session cookie will work.
* *
* @deprecated 3.2 Use the "Session.cookie_path" config setting instead * @deprecated 4.0 Use the "Session.cookie_path" config setting instead
* *
* @return string * @return string
*/ */
public static function get_cookie_path() { public static function get_cookie_path() {
Deprecation::notice('3.2', 'Use the "Session.cookie_path" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_path" config setting instead');
if(Config::inst()->get('Session', 'cookie_path')) { if(Config::inst()->get('Session', 'cookie_path')) {
return Config::inst()->get('Session', 'cookie_path'); return Config::inst()->get('Session', 'cookie_path');
} else { } else {
@ -215,45 +215,46 @@ class Session {
/** /**
* Secure cookie, tells the browser to only send it over SSL. * Secure cookie, tells the browser to only send it over SSL.
* *
* @deprecated 3.2 Use the "Session.cookie_secure" config setting instead * @deprecated 4.0 Use the "Session.cookie_secure" config setting instead
* *
* @param boolean $secure * @param boolean $secure
*/ */
public static function set_cookie_secure($secure) { public static function set_cookie_secure($secure) {
Deprecation::notice('3.2', 'Use the "Session.cookie_secure" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_secure" config setting instead');
Config::inst()->update('Session', 'cookie_secure', (bool)$secure); Config::inst()->update('Session', 'cookie_secure', (bool)$secure);
} }
/** /**
* Get if the cookie is secure * Get if the cookie is secure
* *
* @deprecated 3.2 Use the "Session.cookie_secure" config setting instead * @deprecated 4.0 Use the "Session.cookie_secure" config setting instead
* *
* @return boolean * @return boolean
*/ */
public static function get_cookie_secure() { public static function get_cookie_secure() {
Deprecation::notice('3.2', 'Use the "Session.cookie_secure" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.cookie_secure" config setting instead');
return Config::inst()->get('Session', 'cookie_secure'); return Config::inst()->get('Session', 'cookie_secure');
} }
/** /**
* Set the session store path * Set the session store path
* *
* @deprecated 3.2 Use the "Session.session_store_path" config setting instead * @deprecated 4.0 Use the "Session.session_store_path" config setting instead
* *
* @param string $path Filesystem path to the session store * @param string $path Filesystem path to the session store
*/ */
public static function set_session_store_path($path) { public static function set_session_store_path($path) {
Deprecation::notice('3.2', 'Use the "Session.session_store_path" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.session_store_path" config setting instead');
Config::inst()->update('Session', 'session_store_path', $path); Config::inst()->update('Session', 'session_store_path', $path);
} }
/** /**
* Get the session store path * Get the session store path
* @return string * @return string
* @deprecated since version 4.0
*/ */
public static function get_session_store_path() { public static function get_session_store_path() {
Deprecation::notice('3.2', 'Use the "Session.session_store_path" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.session_store_path" config setting instead');
return Config::inst()->get('Session', 'session_store_path'); return Config::inst()->get('Session', 'session_store_path');
} }
@ -270,12 +271,12 @@ class Session {
* *
* Session::set_timeout is used to set the timeout value for any users whose address is not in the given IP range. * Session::set_timeout is used to set the timeout value for any users whose address is not in the given IP range.
* *
* @deprecated 3.2 Use the "Session.timeout_ips" config setting instead * @deprecated 4.0 Use the "Session.timeout_ips" config setting instead
* *
* @param array $session_ips Array of IPv4 rules. * @param array $session_ips Array of IPv4 rules.
*/ */
public static function set_timeout_ips($ips) { public static function set_timeout_ips($ips) {
Deprecation::notice('3.2', 'Use the "Session.timeout_ips" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.timeout_ips" config setting instead');
Config::inst()->update('Session', 'timeout_ips', $ips); Config::inst()->update('Session', 'timeout_ips', $ips);
} }
@ -605,20 +606,20 @@ class Session {
/** /**
* Set the timeout of a Session value * Set the timeout of a Session value
* *
* @deprecated 3.2 Use the "Session.timeout" config setting instead * @deprecated 4.0 Use the "Session.timeout" config setting instead
* *
* @param int $timeout Time until a session expires in seconds. Defaults to expire when browser is closed. * @param int $timeout Time until a session expires in seconds. Defaults to expire when browser is closed.
*/ */
public static function set_timeout($timeout) { public static function set_timeout($timeout) {
Deprecation::notice('3.2', 'Use the "Session.timeout" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead');
Config::inst()->update('Session', 'timeout', (int)$timeout); Config::inst()->update('Session', 'timeout', (int)$timeout);
} }
/** /**
* @deprecated 3.2 Use the "Session.timeout" config setting instead * @deprecated 4.0 Use the "Session.timeout" config setting instead
*/ */
public static function get_timeout() { public static function get_timeout() {
Deprecation::notice('3.2', 'Use the "Session.timeout" config setting instead'); Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead');
return Config::inst()->get('Session', 'timeout'); return Config::inst()->get('Session', 'timeout');
} }
} }

View File

@ -750,10 +750,10 @@ class Injector {
/** /**
* Register a service with an explicit name * Register a service with an explicit name
* *
* @deprecated since 3.1.1 * @deprecated since 4.0
*/ */
public function registerNamedService($name, $service) { public function registerNamedService($name, $service) {
Deprecation::notice('3.1.1', 'registerNamedService is deprecated, use registerService instead'); Deprecation::notice('4.0', 'registerNamedService is deprecated, use registerService instead');
return $this->registerService($service, $name); return $this->registerService($service, $name);
} }

View File

@ -681,7 +681,7 @@ class Config {
/** /**
* @package framework * @package framework
* @subpackage core * @subpackage core
* @deprecated 3.2 * @deprecated 4.0
*/ */
class Config_LRU { class Config_LRU {
const SIZE = 1000; const SIZE = 1000;
@ -693,7 +693,7 @@ class Config_LRU {
protected $c = 0; protected $c = 0;
public function __construct() { public function __construct() {
Deprecation::notice('3.2', 'Please use Config_MemCache instead', Deprecation::SCOPE_CLASS); Deprecation::notice('4.0', 'Please use Config_MemCache instead', Deprecation::SCOPE_CLASS);
if (version_compare(PHP_VERSION, '5.3.7', '<')) { if (version_compare(PHP_VERSION, '5.3.7', '<')) {
// SplFixedArray causes seg faults before PHP 5.3.7 // SplFixedArray causes seg faults before PHP 5.3.7
$this->cache = array(); $this->cache = array();

View File

@ -584,7 +584,7 @@ abstract class Object {
$sources[] = $extensionClass; $sources[] = $extensionClass;
if(!ClassInfo::has_method_from($extensionClass, 'add_to_class', 'Extension')) { if(!ClassInfo::has_method_from($extensionClass, 'add_to_class', 'Extension')) {
Deprecation::notice('3.2.0', Deprecation::notice('4.0',
"add_to_class deprecated on $extensionClass. Use get_extra_config instead"); "add_to_class deprecated on $extensionClass. Use get_extra_config instead");
} }

View File

@ -79,7 +79,7 @@ class SS_ConfigStaticManifest {
$static = $this->statics[$class][$name]; $static = $this->statics[$class][$name];
if ($static['access'] != T_PRIVATE) { if ($static['access'] != T_PRIVATE) {
Deprecation::notice('3.2.0', "Config static $class::\$$name must be marked as private", Deprecation::notice('4.0', "Config static $class::\$$name must be marked as private",
Deprecation::SCOPE_GLOBAL); Deprecation::SCOPE_GLOBAL);
// Don't warn more than once per static // Don't warn more than once per static
$this->statics[$class][$name]['access'] = T_PRIVATE; $this->statics[$class][$name]['access'] = T_PRIVATE;

View File

@ -31,18 +31,18 @@ class SS_LogEmailWriter extends Zend_Log_Writer_Abstract {
} }
/** /**
* @deprecated 3.2 Use the "SS_LogEmailWriter.send_from" config setting instead * @deprecated 4.0 Use the "SS_LogEmailWriter.send_from" config setting instead
*/ */
public static function set_send_from($address) { public static function set_send_from($address) {
Deprecation::notice('3.2', 'Use the "SS_LogEmailWriter.send_from" config setting instead'); Deprecation::notice('4.0', 'Use the "SS_LogEmailWriter.send_from" config setting instead');
Config::inst()->update('SS_LogEmailWriter', 'send_from', $address); Config::inst()->update('SS_LogEmailWriter', 'send_from', $address);
} }
/** /**
* @deprecated 3.2 Use the "SS_LogEmailWriter.send_from" config setting instead * @deprecated 4.0 Use the "SS_LogEmailWriter.send_from" config setting instead
*/ */
public static function get_send_from() { public static function get_send_from() {
Deprecation::notice('3.2', 'Use the "SS_LogEmailWriter.send_from" config setting instead'); Deprecation::notice('4.0', 'Use the "SS_LogEmailWriter.send_from" config setting instead');
return Config::inst()->get('SS_LogEmailWriter', 'send_from'); return Config::inst()->get('SS_LogEmailWriter', 'send_from');
} }

View File

@ -43,7 +43,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
*/ */
protected $usesDatabase = null; protected $usesDatabase = null;
/**
* @deprecated since version 4.0
*/
protected $originalMailer; protected $originalMailer;
protected $originalMemberPasswordValidator; protected $originalMemberPasswordValidator;
protected $originalRequirements; protected $originalRequirements;
protected $originalIsRunningTest; protected $originalIsRunningTest;
@ -221,7 +225,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
// Set up email // Set up email
$this->originalMailer = Email::mailer(); $this->originalMailer = Email::mailer();
$this->mailer = new TestMailer(); $this->mailer = new TestMailer();
Email::set_mailer($this->mailer); Injector::inst()->registerService($this->mailer, 'Mailer');
Config::inst()->remove('Email', 'send_all_emails_to'); Config::inst()->remove('Email', 'send_all_emails_to');
// Todo: this could be a special test model // Todo: this could be a special test model
@ -471,10 +475,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
ini_set('memory_limit', ($this->originalMemoryLimit) ? $this->originalMemoryLimit : -1); ini_set('memory_limit', ($this->originalMemoryLimit) ? $this->originalMemoryLimit : -1);
// Restore email configuration // Restore email configuration
if($this->originalMailer) { $this->originalMailer = null;
Email::set_mailer($this->originalMailer);
$this->originalMailer = null;
}
$this->mailer = null; $this->mailer = null;
// Restore password validation // Restore password validation

View File

@ -62,10 +62,10 @@ class Email extends ViewableData {
protected $bcc; protected $bcc;
/** /**
* @deprecated since version 3.3 * @deprecated since version 4.0
*/ */
public static function set_mailer(Mailer $mailer) { public static function set_mailer(Mailer $mailer) {
Deprecation::notice('3.3.0', 'Use Injector to override the Mailer service'); Deprecation::notice('4.0', 'Use Injector to override the Mailer service');
Injector::inst()->registerService($mailer, 'Mailer'); Injector::inst()->registerService($mailer, 'Mailer');
} }
@ -162,7 +162,7 @@ class Email extends ViewableData {
if($bcc != null) $this->bcc = $bcc; if($bcc != null) $this->bcc = $bcc;
if($bounceHandlerURL != null) { if($bounceHandlerURL != null) {
Deprecation::notice('3.1', 'Use "emailbouncehandler" module'); Deprecation::notice('4.0', 'Use "emailbouncehandler" module');
} }
parent::__construct(); parent::__construct();
@ -177,8 +177,11 @@ class Email extends ViewableData {
return $this; return $this;
} }
/**
* @deprecated since version 4.0
*/
public function setBounceHandlerURL($bounceHandlerURL) { public function setBounceHandlerURL($bounceHandlerURL) {
Deprecation::notice('3.1', 'Use "emailbouncehandler" module'); Deprecation::notice('4.0', 'Use "emailbouncehandler" module');
} }
public function attachFile($filename, $attachedFilename = null, $mimetype = null) { public function attachFile($filename, $attachedFilename = null, $mimetype = null) {
@ -538,20 +541,20 @@ class Email extends ViewableData {
* *
* Used by {@link Email->send()}, {@link Email->sendPlain()}, {@link Debug->friendlyError()}. * Used by {@link Email->send()}, {@link Email->sendPlain()}, {@link Debug->friendlyError()}.
* *
* @deprecated 3.2 Use the "Email.admin_email" config setting instead * @deprecated 4.0 Use the "Email.admin_email" config setting instead
* @param string $newEmail * @param string $newEmail
*/ */
public static function setAdminEmail($newEmail) { public static function setAdminEmail($newEmail) {
Deprecation::notice('3.2', 'Use the "Email.admin_email" config setting instead'); Deprecation::notice('4.0', 'Use the "Email.admin_email" config setting instead');
Config::inst()->update('Email', 'admin_email', $newEmail); Config::inst()->update('Email', 'admin_email', $newEmail);
} }
/** /**
* @deprecated 3.2 Use the "Email.admin_email" config setting instead * @deprecated 4.0 Use the "Email.admin_email" config setting instead
* @return string * @return string
*/ */
public static function getAdminEmail() { public static function getAdminEmail() {
Deprecation::notice('3.2', 'Use the "Email.admin_email" config setting instead'); Deprecation::notice('4.0', 'Use the "Email.admin_email" config setting instead');
return Config::inst()->get('Email', 'admin_email'); return Config::inst()->get('Email', 'admin_email');
} }
@ -562,10 +565,10 @@ class Email extends ViewableData {
* *
* if(!Director::isLive()) Email::send_all_emails_to("someone@example.com") * if(!Director::isLive()) Email::send_all_emails_to("someone@example.com")
* *
* @deprecated 3.2 Use the "Email.send_all_emails_to" config setting instead * @deprecated 4.0 Use the "Email.send_all_emails_to" config setting instead
*/ */
public static function send_all_emails_to($emailAddress) { public static function send_all_emails_to($emailAddress) {
Deprecation::notice('3.2', 'Use the "Email.send_all_emails_to" config setting instead'); Deprecation::notice('4.0', 'Use the "Email.send_all_emails_to" config setting instead');
Config::inst()->update('Email', 'send_all_emails_to', $emailAddress); Config::inst()->update('Email', 'send_all_emails_to', $emailAddress);
} }
@ -580,10 +583,10 @@ class Email extends ViewableData {
* *
* if(Director::isLive()) Email::cc_all_emails_to("supportperson@example.com") * if(Director::isLive()) Email::cc_all_emails_to("supportperson@example.com")
* *
* @deprecated 3.2 Use the "Email.cc_all_emails_to" config setting instead * @deprecated 4.0 Use the "Email.cc_all_emails_to" config setting instead
*/ */
public static function cc_all_emails_to($emailAddress) { public static function cc_all_emails_to($emailAddress) {
Deprecation::notice('3.2', 'Use the "Email.cc_all_emails_to" config setting instead'); Deprecation::notice('4.0', 'Use the "Email.cc_all_emails_to" config setting instead');
Config::inst()->update('Email', 'cc_all_emails_to', $emailAddress); Config::inst()->update('Email', 'cc_all_emails_to', $emailAddress);
} }
@ -598,10 +601,10 @@ class Email extends ViewableData {
* *
* if(Director::isLive()) Email::cc_all_emails_to("supportperson@example.com") * if(Director::isLive()) Email::cc_all_emails_to("supportperson@example.com")
* *
* @deprecated 3.2 Use the "Email.bcc_all_emails_to" config setting instead * @deprecated 4.0 Use the "Email.bcc_all_emails_to" config setting instead
*/ */
public static function bcc_all_emails_to($emailAddress) { public static function bcc_all_emails_to($emailAddress) {
Deprecation::notice('3.2', 'Use the "Email.bcc_all_emails_to" config setting instead'); Deprecation::notice('4.0', 'Use the "Email.bcc_all_emails_to" config setting instead');
Config::inst()->update('Email', 'bcc_all_emails_to', $emailAddress); Config::inst()->update('Email', 'bcc_all_emails_to', $emailAddress);
} }

View File

@ -477,17 +477,17 @@ class Mailer extends Object {
} }
/** /**
* @deprecated since version 3.2.0 * @deprecated since version 4.0
*/ */
public function wrapImagesInline($htmlContent) { public function wrapImagesInline($htmlContent) {
Deprecation::notice('3.2.0', 'wrapImagesInline is deprecated'); Deprecation::notice('4.0', 'wrapImagesInline is deprecated');
} }
/** /**
* @deprecated since version 3.2.0 * @deprecated since version 4.0
*/ */
public function wrapImagesInline_rewriter($url) { public function wrapImagesInline_rewriter($url) {
Deprecation::notice('3.2.0', 'wrapImagesInline_rewriter is deprecated'); Deprecation::notice('4.0', 'wrapImagesInline_rewriter is deprecated');
} }
} }

View File

@ -25,11 +25,11 @@ class GDBackend extends Object implements Image_Backend {
/** /**
* Set the default image quality. * Set the default image quality.
* *
* @deprecated 3.2 Use the "GDBackend.default_quality" config setting instead * @deprecated 4.0 Use the "GDBackend.default_quality" config setting instead
* @param quality int A number from 0 to 100, 100 being the best quality. * @param quality int A number from 0 to 100, 100 being the best quality.
*/ */
public static function set_default_quality($quality) { public static function set_default_quality($quality) {
Deprecation::notice('3.2', 'Use the "GDBackend.default_quality" config setting instead'); Deprecation::notice('4.0', 'Use the "GDBackend.default_quality" config setting instead');
if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) { if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) {
config::inst()->update('GDBackend', 'default_quality', (int) $quality); config::inst()->update('GDBackend', 'default_quality', (int) $quality);
} }
@ -562,10 +562,10 @@ class GDBackend extends Object implements Image_Backend {
class GD extends GDBackend { class GD extends GDBackend {
/** /**
* @deprecated 3.2 Use the "GDBackend.default_quality" config setting instead * @deprecated 4.0 Use the "GDBackend.default_quality" config setting instead
*/ */
public static function set_default_quality($quality) { public static function set_default_quality($quality) {
Deprecation::notice('3.2', 'Use the "GDBackend.default_quality" config setting instead'); Deprecation::notice('4.0', 'Use the "GDBackend.default_quality" config setting instead');
GDBackend::set_default_quality($quality); GDBackend::set_default_quality($quality);
} }
} }

View File

@ -42,12 +42,12 @@ class ImagickBackend extends Imagick implements Image_Backend {
/** /**
* set_default_quality * set_default_quality
* *
* @deprecated 3.2 Use the "ImagickBackend.default_quality" config setting instead * @deprecated 4.0 Use the "ImagickBackend.default_quality" config setting instead
* @param int $quality * @param int $quality
* @return void * @return void
*/ */
public static function set_default_quality($quality) { public static function set_default_quality($quality) {
Deprecation::notice('3.2', 'Use the "ImagickBackend.default_quality" config setting instead'); Deprecation::notice('4.0', 'Use the "ImagickBackend.default_quality" config setting instead');
if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) { if(is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) {
Config::inst()->update('ImagickBackend', 'default_quality', (int) $quality); Config::inst()->update('ImagickBackend', 'default_quality', (int) $quality);
} }

View File

@ -323,13 +323,13 @@ class DateField extends TextField {
} }
/** /**
* @deprecated 3.2 Use the "DateField.default_config" config setting instead * @deprecated 4.0 Use the "DateField.default_config" config setting instead
* @param String $k * @param String $k
* @param mixed $v * @param mixed $v
* @return boolean * @return boolean
*/ */
public static function set_default_config($k, $v) { public static function set_default_config($k, $v) {
Deprecation::notice('3.2', 'Use the "DateField.default_config" config setting instead'); Deprecation::notice('4.0', 'Use the "DateField.default_config" config setting instead');
return Config::inst()->update('DateField', 'default_config', array($k => $v)); return Config::inst()->update('DateField', 'default_config', array($k => $v));
} }

View File

@ -100,7 +100,7 @@ class FormAction extends FormField {
// Remove this method override in 4.0 // Remove this method override in 4.0
$decoded = Convert::xml2raw($title); $decoded = Convert::xml2raw($title);
if($decoded !== $title) { if($title && $decoded !== $title) {
Deprecation::notice( Deprecation::notice(
'4.0', '4.0',
'The FormAction title field should not be html encoded. Use buttonContent to set custom html instead' 'The FormAction title field should not be html encoded. Use buttonContent to set custom html instead'

View File

@ -908,12 +908,12 @@ class FormField extends RequestHandler {
} }
/** /**
* @deprecated 3.2 Use FormField::create_tag() * @deprecated 4.0 Use FormField::create_tag()
*/ */
public function createTag($tag, $attributes, $content = null) { public function createTag($tag, $attributes, $content = null) {
Deprecation::notice('3.2', 'Use FormField::create_tag()'); Deprecation::notice('4.0', 'Use FormField::create_tag()');
return self::create_tag($tag, $attributes, $content); return self::create_tag($tag, $attributes, $content);
} }
/** /**
* Validation method each {@link FormField} subclass should implement, * Validation method each {@link FormField} subclass should implement,

View File

@ -29,7 +29,7 @@ class HtmlEditorField extends TextareaField {
protected $rows = 30; protected $rows = 30;
/** /**
* @deprecated since version 3.2 * @deprecated since version 4.0
*/ */
public static function include_js() { public static function include_js() {
Deprecation::notice('4.0', 'Use HtmlEditorConfig::require_js() instead'); Deprecation::notice('4.0', 'Use HtmlEditorConfig::require_js() instead');

View File

@ -34,8 +34,11 @@ class RequiredFields extends Validator {
parent::__construct(); parent::__construct();
} }
/**
* @deprecated since version 4.0
*/
public function useLabels($flag) { public function useLabels($flag) {
Deprecation::notice('3.2', 'useLabels will be removed from 3.2, please do not use it or implement it yourself'); Deprecation::notice('4.0', 'useLabels will be removed from 4.0, please do not use it or implement it yourself');
$this->useLabels = $flag; $this->useLabels = $flag;
return $this; return $this;
} }

View File

@ -137,54 +137,56 @@ class i18n extends Object implements TemplateGlobalProvider, Flushable {
* *
* @see Requirements::process_i18n_javascript() * @see Requirements::process_i18n_javascript()
* *
* @deprecated 3.2 Use the "i18n.js_i18n" config setting instead * @deprecated 4.0 Use the "i18n.js_i18n" config setting instead
* @param bool $bool * @param bool $bool
*/ */
public static function set_js_i18n($bool) { public static function set_js_i18n($bool) {
Deprecation::notice('3.2', 'Use the "i18n.js_i18n" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.js_i18n" config setting instead');
Config::inst()->update('i18n', 'js_i18n', $bool); Config::inst()->update('i18n', 'js_i18n', $bool);
} }
/** /**
* @deprecated 3.2 Use the "i18n.js_i18n" config setting instead * @deprecated 4.0 Use the "i18n.js_i18n" config setting instead
* @return bool * @return bool
*/ */
public static function get_js_i18n() { public static function get_js_i18n() {
Deprecation::notice('3.2', 'Use the "i18n.js_i18n" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.js_i18n" config setting instead');
return Config::inst()->get('i18n', 'js_i18n'); return Config::inst()->get('i18n', 'js_i18n');
} }
/** /**
* @deprecated 3.2 Use the "i18n.date_format" config setting instead * @deprecated 4.0 Use the "i18n.date_format" config setting instead
* @param string ISO date format * @param string ISO date format
*/ */
public static function set_date_format($format) { public static function set_date_format($format) {
Deprecation::notice('3.2', 'Use the "i18n.date_format" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.date_format" config setting instead');
Config::inst()->update('i18n', 'date_format', $format); Config::inst()->update('i18n', 'date_format', $format);
} }
/** /**
* @deprecated since version 4.0
* @return string ISO date format * @return string ISO date format
*/ */
public static function get_date_format() { public static function get_date_format() {
Deprecation::notice('3.2', 'Use the "i18n.date_format" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.date_format" config setting instead');
return Config::inst()->get('i18n', 'date_format'); return Config::inst()->get('i18n', 'date_format');
} }
/** /**
* @deprecated 3.2 Use the "i18n.time_format" config setting instead * @deprecated 4.0 Use the "i18n.time_format" config setting instead
* @param string ISO time format * @param string ISO time format
*/ */
public static function set_time_format($format) { public static function set_time_format($format) {
Deprecation::notice('3.2', 'Use the "i18n.time_format" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.time_format" config setting instead');
Config::inst()->update('i18n', 'time_format', $format); Config::inst()->update('i18n', 'time_format', $format);
} }
/** /**
* @deprecated since version 4.0
* @return string ISO time format * @return string ISO time format
*/ */
public static function get_time_format() { public static function get_time_format() {
Deprecation::notice('3.2', 'Use the "i18n.time_format" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.time_format" config setting instead');
return Config::inst()->get('i18n', 'time_format'); return Config::inst()->get('i18n', 'time_format');
} }
@ -2224,10 +2226,11 @@ class i18n extends Object implements TemplateGlobalProvider, Flushable {
/** /**
* Get a list of locales (code => language and country) * Get a list of locales (code => language and country)
* *
* @deprecated since version 4.0
* @return list of languages in the form 'code' => 'name' * @return list of languages in the form 'code' => 'name'
*/ */
public static function get_locale_list() { public static function get_locale_list() {
Deprecation::notice('3.2', 'Use the "i18n.all_locales" config setting instead'); Deprecation::notice('4.0', 'Use the "i18n.all_locales" config setting instead');
return (array)Config::inst()->get('i18n', 'all_locales'); return (array)Config::inst()->get('i18n', 'all_locales');
} }

View File

@ -50,10 +50,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::set_conn instead * @deprecated since version 4.0 Use DB::set_conn instead
*/ */
public static function setConn(SS_Database $connection, $name = 'default') { public static function setConn(SS_Database $connection, $name = 'default') {
Deprecation::notice('3.3', 'Use DB::set_conn instead'); Deprecation::notice('4.0', 'Use DB::set_conn instead');
self::set_conn($connection, $name); self::set_conn($connection, $name);
} }
@ -71,10 +71,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::get_conn instead * @deprecated since version 4.0 Use DB::get_conn instead
*/ */
public static function getConn($name = 'default') { public static function getConn($name = 'default') {
Deprecation::notice('3.3', 'Use DB::get_conn instead'); Deprecation::notice('4.0', 'Use DB::get_conn instead');
return self::get_conn($name); return self::get_conn($name);
} }
@ -254,10 +254,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.2 DB::getConnect was never implemented and is obsolete * @deprecated since version 4.0 DB::getConnect was never implemented and is obsolete
*/ */
public static function getConnect($parameters) { public static function getConnect($parameters) {
Deprecation::notice('3.2', 'DB::getConnect was never implemented and is obsolete'); Deprecation::notice('4.0', 'DB::getConnect was never implemented and is obsolete');
} }
/** /**
@ -363,10 +363,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::get_generated_id instead * @deprecated since version 4.0 Use DB::get_generated_id instead
*/ */
public static function getGeneratedID($table) { public static function getGeneratedID($table) {
Deprecation::notice('3.3', 'Use DB::get_generated_id instead'); Deprecation::notice('4.0', 'Use DB::get_generated_id instead');
return self::get_generated_id($table); return self::get_generated_id($table);
} }
@ -380,10 +380,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::is_active instead * @deprecated since version 4.0 Use DB::is_active instead
*/ */
public static function isActive() { public static function isActive() {
Deprecation::notice('3.3', 'Use DB::is_active instead'); Deprecation::notice('4.0', 'Use DB::is_active instead');
return self::is_active(); return self::is_active();
} }
@ -400,10 +400,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::create_database instead * @deprecated since version 4.0 Use DB::create_database instead
*/ */
public static function createDatabase($connect, $username, $password, $database) { public static function createDatabase($connect, $username, $password, $database) {
Deprecation::notice('3.3', 'Use DB::create_database instead'); Deprecation::notice('4.0', 'Use DB::create_database instead');
return self::create_database($database); return self::create_database($database);
} }
@ -426,10 +426,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::create_table instead * @deprecated since version 4.0 Use DB::create_table instead
*/ */
public static function createTable($table, $fields = null, $indexes = null, $options = null) { public static function createTable($table, $fields = null, $indexes = null, $options = null) {
Deprecation::notice('3.3', 'Use DB::create_table instead'); Deprecation::notice('4.0', 'Use DB::create_table instead');
return self::create_table($table, $fields, $indexes, $options); return self::create_table($table, $fields, $indexes, $options);
} }
@ -444,10 +444,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::create_field instead * @deprecated since version 4.0 Use DB::create_field instead
*/ */
public static function createField($table, $field, $spec) { public static function createField($table, $field, $spec) {
Deprecation::notice('3.3', 'Use DB::create_field instead'); Deprecation::notice('4.0', 'Use DB::create_field instead');
return self::create_field($table, $field, $spec); return self::create_field($table, $field, $spec);
} }
@ -474,12 +474,12 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::require_table instead * @deprecated since version 4.0 Use DB::require_table instead
*/ */
public static function requireTable($table, $fieldSchema = null, $indexSchema = null, $hasAutoIncPK = true, public static function requireTable($table, $fieldSchema = null, $indexSchema = null, $hasAutoIncPK = true,
$options = null, $extensions = null $options = null, $extensions = null
) { ) {
Deprecation::notice('3.3', 'Use DB::require_table instead'); Deprecation::notice('4.0', 'Use DB::require_table instead');
return self::require_table($table, $fieldSchema, $indexSchema, $hasAutoIncPK, $options, $extensions); return self::require_table($table, $fieldSchema, $indexSchema, $hasAutoIncPK, $options, $extensions);
} }
@ -495,10 +495,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::require_field instead * @deprecated since version 4.0 Use DB::require_field instead
*/ */
public static function requireField($table, $field, $spec) { public static function requireField($table, $field, $spec) {
Deprecation::notice('3.3', 'Use DB::require_field instead'); Deprecation::notice('4.0', 'Use DB::require_field instead');
return self::require_field($table, $field, $spec); return self::require_field($table, $field, $spec);
} }
@ -514,10 +514,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::require_index instead * @deprecated since version 4.0 Use DB::require_index instead
*/ */
public static function requireIndex($table, $index, $spec) { public static function requireIndex($table, $index, $spec) {
Deprecation::notice('3.3', 'Use DB::require_index instead'); Deprecation::notice('4.0', 'Use DB::require_index instead');
self::require_index($table, $index, $spec); self::require_index($table, $index, $spec);
} }
@ -531,10 +531,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::dont_require_table instead * @deprecated since version 4.0 Use DB::dont_require_table instead
*/ */
public static function dontRequireTable($table) { public static function dontRequireTable($table) {
Deprecation::notice('3.3', 'Use DB::dont_require_table instead'); Deprecation::notice('4.0', 'Use DB::dont_require_table instead');
self::dont_require_table($table); self::dont_require_table($table);
} }
@ -549,10 +549,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::dont_require_field instead * @deprecated since version 4.0 Use DB::dont_require_field instead
*/ */
public static function dontRequireField($table, $fieldName) { public static function dontRequireField($table, $fieldName) {
Deprecation::notice('3.3', 'Use DB::dont_require_field instead'); Deprecation::notice('4.0', 'Use DB::dont_require_field instead');
self::dont_require_field($table, $fieldName); self::dont_require_field($table, $fieldName);
} }
@ -567,10 +567,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::check_and_repair_table instead * @deprecated since version 4.0 Use DB::check_and_repair_table instead
*/ */
public static function checkAndRepairTable($table) { public static function checkAndRepairTable($table) {
Deprecation::notice('3.3', 'Use DB::check_and_repair_table instead'); Deprecation::notice('4.0', 'Use DB::check_and_repair_table instead');
self::check_and_repair_table($table); self::check_and_repair_table($table);
} }
@ -584,10 +584,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::affected_rows instead * @deprecated since version 4.0 Use DB::affected_rows instead
*/ */
public static function affectedRows() { public static function affectedRows() {
Deprecation::notice('3.3', 'Use DB::affected_rows instead'); Deprecation::notice('4.0', 'Use DB::affected_rows instead');
return self::affected_rows(); return self::affected_rows();
} }
@ -602,10 +602,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::table_list instead * @deprecated since version 4.0 Use DB::table_list instead
*/ */
public static function tableList() { public static function tableList() {
Deprecation::notice('3.3', 'Use DB::table_list instead'); Deprecation::notice('4.0', 'Use DB::table_list instead');
return self::table_list(); return self::table_list();
} }
@ -621,10 +621,10 @@ class DB {
} }
/** /**
* @deprecated since version 3.3 Use DB::field_list instead * @deprecated since version 4.0 Use DB::field_list instead
*/ */
public static function fieldList($table) { public static function fieldList($table) {
Deprecation::notice('3.3', 'Use DB::field_list instead'); Deprecation::notice('4.0', 'Use DB::field_list instead');
return self::field_list($table); return self::field_list($table);
} }

View File

@ -265,10 +265,10 @@ class DatabaseAdmin extends Controller {
/** /**
* Clear all data out of the database * Clear all data out of the database
* *
* @deprecated since version 3.2 * @deprecated since version 4.0
*/ */
public function clearAllData() { public function clearAllData() {
Deprecation::notice('3.2', 'Use DB::get_conn()->clearAllData() instead'); Deprecation::notice('4.0', 'Use DB::get_conn()->clearAllData() instead');
DB::get_conn()->clearAllData(); DB::get_conn()->clearAllData();
} }

View File

@ -168,10 +168,10 @@ class Image extends File implements Flushable {
* File names are filtered through {@link FileNameFilter}, see class documentation * File names are filtered through {@link FileNameFilter}, see class documentation
* on how to influence this behaviour. * on how to influence this behaviour.
* *
* @deprecated 3.2 * @deprecated 4.0
*/ */
public function loadUploadedImage($tmpFile) { public function loadUploadedImage($tmpFile) {
Deprecation::notice('3.2', 'Use the Upload::loadIntoFile()'); Deprecation::notice('4.0', 'Use the Upload::loadIntoFile()');
if(!is_array($tmpFile)) { if(!is_array($tmpFile)) {
user_error("Image::loadUploadedImage() Not passed an array. Most likely, the form hasn't got the right" user_error("Image::loadUploadedImage() Not passed an array. Most likely, the form hasn't got the right"

View File

@ -681,70 +681,70 @@ abstract class SS_Database {
abstract public function random(); abstract public function random();
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->dbDataType($type) instead * @deprecated since version 4.0 Use DB::get_schema()->dbDataType($type) instead
*/ */
public function dbDataType($type){ public function dbDataType($type){
Deprecation::notice('3.3', 'Use DB::get_schema()->dbDataType($type) instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->dbDataType($type) instead');
return $this->getSchemaManager()->dbDataType($type); return $this->getSchemaManager()->dbDataType($type);
} }
/** /**
* @deprecated since version 3.3 Use selectDatabase('dbname', true) instead * @deprecated since version 4.0 Use selectDatabase('dbname', true) instead
*/ */
public function createDatabase() { public function createDatabase() {
Deprecation::notice('3.3', 'Use selectDatabase(\'dbname\',true) instead'); Deprecation::notice('4.0', 'Use selectDatabase(\'dbname\',true) instead');
$database = $this->connector->getSelectedDatabase(); $database = $this->connector->getSelectedDatabase();
$this->selectDatabase($database, true); $this->selectDatabase($database, true);
return $this->isActive(); return $this->isActive();
} }
/** /**
* @deprecated since version 3.3 SS_Database::getConnect was never implemented and is obsolete * @deprecated since version 4.0 SS_Database::getConnect was never implemented and is obsolete
*/ */
public function getConnect($parameters) { public function getConnect($parameters) {
Deprecation::notice('3.3', 'SS_Database::getConnect was never implemented and is obsolete'); Deprecation::notice('4.0', 'SS_Database::getConnect was never implemented and is obsolete');
} }
/** /**
* @deprecated since version 3.3 Use Convert::raw2sql($string, true) instead * @deprecated since version 4.0 Use Convert::raw2sql($string, true) instead
*/ */
public function prepStringForDB($string) { public function prepStringForDB($string) {
Deprecation::notice('3.3', 'Use Convert::raw2sql($string, true) instead'); Deprecation::notice('4.0', 'Use Convert::raw2sql($string, true) instead');
return $this->quoteString($string); return $this->quoteString($string);
} }
/** /**
* @deprecated since version 3.3 Use dropSelectedDatabase instead * @deprecated since version 4.0 Use dropSelectedDatabase instead
*/ */
public function dropDatabase() { public function dropDatabase() {
Deprecation::notice('3.3', 'Use dropSelectedDatabase instead'); Deprecation::notice('4.0', 'Use dropSelectedDatabase instead');
$this->dropSelectedDatabase(); $this->dropSelectedDatabase();
} }
/** /**
* @deprecated since version 3.3 Use databaseList instead * @deprecated since version 4.0 Use databaseList instead
*/ */
public function allDatabaseNames() { public function allDatabaseNames() {
Deprecation::notice('3.3', 'Use databaseList instead'); Deprecation::notice('4.0', 'Use databaseList instead');
return $this->databaseList(); return $this->databaseList();
} }
/** /**
* @deprecated since version 3.3 Use DB::create_table instead * @deprecated since version 4.0 Use DB::create_table instead
*/ */
public function createTable($table, $fields = null, $indexes = null, $options = null, $advancedOptions = null) { public function createTable($table, $fields = null, $indexes = null, $options = null, $advancedOptions = null) {
Deprecation::notice('3.3', 'Use DB::create_table instead'); Deprecation::notice('4.0', 'Use DB::create_table instead');
return $this->getSchemaManager()->createTable($table, $fields, $indexes, $options, $advancedOptions); return $this->getSchemaManager()->createTable($table, $fields, $indexes, $options, $advancedOptions);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->alterTable() instead * @deprecated since version 4.0 Use DB::get_schema()->alterTable() instead
*/ */
public function alterTable($table, $newFields = null, $newIndexes = null, public function alterTable($table, $newFields = null, $newIndexes = null,
$alteredFields = null, $alteredIndexes = null, $alteredOptions = null, $alteredFields = null, $alteredIndexes = null, $alteredOptions = null,
$advancedOptions = null $advancedOptions = null
) { ) {
Deprecation::notice('3.3', 'Use DB::get_schema()->alterTable() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->alterTable() instead');
return $this->getSchemaManager()->alterTable( return $this->getSchemaManager()->alterTable(
$table, $newFields, $newIndexes, $alteredFields, $table, $newFields, $newIndexes, $alteredFields,
$alteredIndexes, $alteredOptions, $advancedOptions $alteredIndexes, $alteredOptions, $advancedOptions
@ -752,74 +752,74 @@ abstract class SS_Database {
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->renameTable() instead * @deprecated since version 4.0 Use DB::get_schema()->renameTable() instead
*/ */
public function renameTable($oldTableName, $newTableName) { public function renameTable($oldTableName, $newTableName) {
Deprecation::notice('3.3', 'Use DB::get_schema()->renameTable() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->renameTable() instead');
$this->getSchemaManager()->renameTable($oldTableName, $newTableName); $this->getSchemaManager()->renameTable($oldTableName, $newTableName);
} }
/** /**
* @deprecated since version 3.3 Use DB::create_field() instead * @deprecated since version 4.0 Use DB::create_field() instead
*/ */
public function createField($table, $field, $spec) { public function createField($table, $field, $spec) {
Deprecation::notice('3.3', 'Use DB::create_field() instead'); Deprecation::notice('4.0', 'Use DB::create_field() instead');
$this->getSchemaManager()->createField($table, $field, $spec); $this->getSchemaManager()->createField($table, $field, $spec);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->renameField() instead * @deprecated since version 4.0 Use DB::get_schema()->renameField() instead
*/ */
public function renameField($tableName, $oldName, $newName) { public function renameField($tableName, $oldName, $newName) {
Deprecation::notice('3.3', 'Use DB::get_schema()->renameField() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->renameField() instead');
$this->getSchemaManager()->renameField($tableName, $oldName, $newName); $this->getSchemaManager()->renameField($tableName, $oldName, $newName);
} }
/** /**
* @deprecated since version 3.3 Use getSelectedDatabase instead * @deprecated since version 4.0 Use getSelectedDatabase instead
*/ */
public function currentDatabase() { public function currentDatabase() {
Deprecation::notice('3.3', 'Use getSelectedDatabase instead'); Deprecation::notice('4.0', 'Use getSelectedDatabase instead');
return $this->getSelectedDatabase(); return $this->getSelectedDatabase();
} }
/** /**
* @deprecated since version 3.3 Use DB::field_list instead * @deprecated since version 4.0 Use DB::field_list instead
*/ */
public function fieldList($table) { public function fieldList($table) {
Deprecation::notice('3.3', 'Use DB::field_list instead'); Deprecation::notice('4.0', 'Use DB::field_list instead');
return $this->getSchemaManager()->fieldList($table); return $this->getSchemaManager()->fieldList($table);
} }
/** /**
* @deprecated since version 3.3 Use DB::table_list instead * @deprecated since version 4.0 Use DB::table_list instead
*/ */
public function tableList() { public function tableList() {
Deprecation::notice('3.3', 'Use DB::table_list instead'); Deprecation::notice('4.0', 'Use DB::table_list instead');
return $this->getSchemaManager()->tableList(); return $this->getSchemaManager()->tableList();
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->hasTable() instead * @deprecated since version 4.0 Use DB::get_schema()->hasTable() instead
*/ */
public function hasTable($tableName) { public function hasTable($tableName) {
Deprecation::notice('3.3', 'Use DB::get_schema()->hasTable() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->hasTable() instead');
return $this->getSchemaManager()->hasTable($tableName); return $this->getSchemaManager()->hasTable($tableName);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->enumValuesForField() instead * @deprecated since version 4.0 Use DB::get_schema()->enumValuesForField() instead
*/ */
public function enumValuesForField($tableName, $fieldName) { public function enumValuesForField($tableName, $fieldName) {
Deprecation::notice('3.3', 'Use DB::get_schema()->enumValuesForField() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->enumValuesForField() instead');
return $this->getSchemaManager()->enumValuesForField($tableName, $fieldName); return $this->getSchemaManager()->enumValuesForField($tableName, $fieldName);
} }
/** /**
* @deprecated since version 3.3 Use Convert::raw2sql instead * @deprecated since version 4.0 Use Convert::raw2sql instead
*/ */
public function addslashes($value) { public function addslashes($value) {
Deprecation::notice('3.3', 'Use Convert::raw2sql instead'); Deprecation::notice('4.0', 'Use Convert::raw2sql instead');
return $this->escapeString($value); return $this->escapeString($value);
} }
@ -842,134 +842,134 @@ abstract class SS_Database {
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->cancelSchemaUpdate instead * @deprecated since version 4.0 Use DB::get_schema()->cancelSchemaUpdate instead
*/ */
public function cancelSchemaUpdate() { public function cancelSchemaUpdate() {
Deprecation::notice('3.3', 'Use DB::get_schema()->cancelSchemaUpdate instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->cancelSchemaUpdate instead');
$this->getSchemaManager()->cancelSchemaUpdate(); $this->getSchemaManager()->cancelSchemaUpdate();
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->isSchemaUpdating() instead * @deprecated since version 4.0 Use DB::get_schema()->isSchemaUpdating() instead
*/ */
public function isSchemaUpdating() { public function isSchemaUpdating() {
Deprecation::notice('3.3', 'Use DB::get_schema()->isSchemaUpdating() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->isSchemaUpdating() instead');
return $this->getSchemaManager()->isSchemaUpdating(); return $this->getSchemaManager()->isSchemaUpdating();
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->doesSchemaNeedUpdating() instead * @deprecated since version 4.0 Use DB::get_schema()->doesSchemaNeedUpdating() instead
*/ */
public function doesSchemaNeedUpdating() { public function doesSchemaNeedUpdating() {
Deprecation::notice('3.3', 'Use DB::get_schema()->doesSchemaNeedUpdating() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->doesSchemaNeedUpdating() instead');
return $this->getSchemaManager()->doesSchemaNeedUpdating(); return $this->getSchemaManager()->doesSchemaNeedUpdating();
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transCreateTable() instead * @deprecated since version 4.0 Use DB::get_schema()->transCreateTable() instead
*/ */
public function transCreateTable($table, $options = null, $advanced_options = null) { public function transCreateTable($table, $options = null, $advanced_options = null) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transCreateTable() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transCreateTable() instead');
$this->getSchemaManager()->transCreateTable($table, $options, $advanced_options); $this->getSchemaManager()->transCreateTable($table, $options, $advanced_options);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transAlterTable() instead * @deprecated since version 4.0 Use DB::get_schema()->transAlterTable() instead
*/ */
public function transAlterTable($table, $options, $advanced_options) { public function transAlterTable($table, $options, $advanced_options) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transAlterTable() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transAlterTable() instead');
$this->getSchemaManager()->transAlterTable($table, $index, $schema); $this->getSchemaManager()->transAlterTable($table, $index, $schema);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transCreateField() instead * @deprecated since version 4.0 Use DB::get_schema()->transCreateField() instead
*/ */
public function transCreateField($table, $field, $schema) { public function transCreateField($table, $field, $schema) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transCreateField() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transCreateField() instead');
$this->getSchemaManager()->transCreateField($table, $index, $schema); $this->getSchemaManager()->transCreateField($table, $index, $schema);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transCreateIndex() instead * @deprecated since version 4.0 Use DB::get_schema()->transCreateIndex() instead
*/ */
public function transCreateIndex($table, $index, $schema) { public function transCreateIndex($table, $index, $schema) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transCreateIndex() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transCreateIndex() instead');
$this->getSchemaManager()->transCreateIndex($table, $index, $schema); $this->getSchemaManager()->transCreateIndex($table, $index, $schema);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transAlterField() instead * @deprecated since version 4.0 Use DB::get_schema()->transAlterField() instead
*/ */
public function transAlterField($table, $field, $schema) { public function transAlterField($table, $field, $schema) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transAlterField() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transAlterField() instead');
$this->getSchemaManager()->transAlterField($table, $index, $schema); $this->getSchemaManager()->transAlterField($table, $index, $schema);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->transAlterIndex() instead * @deprecated since version 4.0 Use DB::get_schema()->transAlterIndex() instead
*/ */
public function transAlterIndex($table, $index, $schema) { public function transAlterIndex($table, $index, $schema) {
Deprecation::notice('3.3', 'Use DB::get_schema()->transAlterIndex() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->transAlterIndex() instead');
$this->getSchemaManager()->transAlterIndex($table, $index, $schema); $this->getSchemaManager()->transAlterIndex($table, $index, $schema);
} }
/** /**
* @deprecated since version 3.3 Use DB::require_table() instead * @deprecated since version 4.0 Use DB::require_table() instead
*/ */
public function requireTable($table, $fieldSchema = null, $indexSchema = null, public function requireTable($table, $fieldSchema = null, $indexSchema = null,
$hasAutoIncPK = true, $options = array(), $extensions = false $hasAutoIncPK = true, $options = array(), $extensions = false
) { ) {
Deprecation::notice('3.3', 'Use DB::require_table() instead'); Deprecation::notice('4.0', 'Use DB::require_table() instead');
return $this->getSchemaManager()->requireTable( return $this->getSchemaManager()->requireTable(
$table, $fieldSchema, $indexSchema, $hasAutoIncPK, $options, $extensions $table, $fieldSchema, $indexSchema, $hasAutoIncPK, $options, $extensions
); );
} }
/** /**
* @deprecated since version 3.3 Use DB::dont_require_table() instead * @deprecated since version 4.0 Use DB::dont_require_table() instead
*/ */
public function dontRequireTable($table) { public function dontRequireTable($table) {
Deprecation::notice('3.3', 'Use DB::dont_require_table() instead'); Deprecation::notice('4.0', 'Use DB::dont_require_table() instead');
$this->getSchemaManager()->dontRequireTable($table); $this->getSchemaManager()->dontRequireTable($table);
} }
/** /**
* @deprecated since version 3.3 Use DB::require_index() instead * @deprecated since version 4.0 Use DB::require_index() instead
*/ */
public function requireIndex($table, $index, $spec) { public function requireIndex($table, $index, $spec) {
Deprecation::notice('3.3', 'Use DB::require_index() instead'); Deprecation::notice('4.0', 'Use DB::require_index() instead');
$this->getSchemaManager()->requireIndex($table, $index, $spec); $this->getSchemaManager()->requireIndex($table, $index, $spec);
} }
/** /**
* @deprecated since version 3.3 Use DB::get_schema()->hasField() instead * @deprecated since version 4.0 Use DB::get_schema()->hasField() instead
*/ */
public function hasField($tableName, $fieldName) { public function hasField($tableName, $fieldName) {
Deprecation::notice('3.3', 'Use DB::get_schema()->hasField() instead'); Deprecation::notice('4.0', 'Use DB::get_schema()->hasField() instead');
return $this->getSchemaManager()->hasField($tableName, $fieldName); return $this->getSchemaManager()->hasField($tableName, $fieldName);
} }
/** /**
* @deprecated since version 3.3 Use DB::require_field() instead * @deprecated since version 4.0 Use DB::require_field() instead
*/ */
public function requireField($table, $field, $spec) { public function requireField($table, $field, $spec) {
Deprecation::notice('3.3', 'Use DB::require_field() instead'); Deprecation::notice('4.0', 'Use DB::require_field() instead');
$this->getSchemaManager()->requireField($table, $field, $spec); $this->getSchemaManager()->requireField($table, $field, $spec);
} }
/** /**
* @deprecated since version 3.3 Use DB::dont_require_field() instead * @deprecated since version 4.0 Use DB::dont_require_field() instead
*/ */
public function dontRequireField($table, $fieldName) { public function dontRequireField($table, $fieldName) {
Deprecation::notice('3.3', 'Use DB::dont_require_field() instead'); Deprecation::notice('4.0', 'Use DB::dont_require_field() instead');
$this->getSchemaManager()->dontRequireField($table, $fieldName); $this->getSchemaManager()->dontRequireField($table, $fieldName);
} }
/** /**
* @deprecated since version 3.3 Use DB::build_sql() instead * @deprecated since version 4.0 Use DB::build_sql() instead
*/ */
public function sqlQueryToString(SQLExpression $query, &$parameters = array()) { public function sqlQueryToString(SQLExpression $query, &$parameters = array()) {
Deprecation::notice('3.3', 'Use DB::build_sql() instead'); Deprecation::notice('4.0', 'Use DB::build_sql() instead');
return $this->getQueryBuilder()->buildSQL($query, $parameters); return $this->getQueryBuilder()->buildSQL($query, $parameters);
} }
} }

View File

@ -60,12 +60,12 @@ class Currency extends Decimal {
} }
/** /**
* @deprecated 3.2 Use the "Currency.currency_symbol" config setting instead * @deprecated 4.0 Use the "Currency.currency_symbol" config setting instead
* @param [type] $value [description] * @param [type] $value [description]
*/ */
public static function setCurrencySymbol($value) { public static function setCurrencySymbol($value) {
Deprecation::notice('3.2', 'Use the "Currency.currency_symbol" config setting instead'); Deprecation::notice('4.0', 'Use the "Currency.currency_symbol" config setting instead');
Currency::config()->currency_symbol = $value; Currency::config()->currency_symbol = $value;
} }
} }

View File

@ -246,7 +246,7 @@ abstract class SQLConditionalExpression extends SQLExpression {
public function getJoins(&$parameters = array()) { public function getJoins(&$parameters = array()) {
if(func_num_args() == 0) { if(func_num_args() == 0) {
Deprecation::notice( Deprecation::notice(
'3.2', '4.0',
'SQLConditionalExpression::getJoins() now may produce parameters which are necessary to 'SQLConditionalExpression::getJoins() now may produce parameters which are necessary to
execute this query' execute this query'
); );

View File

@ -24,18 +24,18 @@ abstract class SQLExpression {
protected $replacementsNew = array(); protected $replacementsNew = array();
/** /**
* @deprecated since version 3.2 * @deprecated since version 4.0
*/ */
public function __get($field) { public function __get($field) {
Deprecation::notice('3.2', 'use get{Field} to get the necessary protected field\'s value'); Deprecation::notice('4.0', 'use get{Field} to get the necessary protected field\'s value');
return $this->$field; return $this->$field;
} }
/** /**
* @deprecated since version 3.2 * @deprecated since version 4.0
*/ */
public function __set($field, $value) { public function __set($field, $value) {
Deprecation::notice('3.2', 'use set{Field} to set the necessary protected field\'s value'); Deprecation::notice('4.0', 'use set{Field} to set the necessary protected field\'s value');
return $this->$field = $value; return $this->$field = $value;
} }

View File

@ -36,10 +36,10 @@ class BBCodeParser extends TextParser {
private static $smilies_location = null; private static $smilies_location = null;
/** /**
* @deprecated 3.2 Use the "BBCodeParser.smilies_location" config setting instead * @deprecated 4.0 Use the "BBCodeParser.smilies_location" config setting instead
*/ */
public static function smilies_location() { public static function smilies_location() {
Deprecation::notice('3.2', 'Use the "BBCodeParser.smilies_location" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.smilies_location" config setting instead');
if(!BBCodeParser::$smilies_location) { if(!BBCodeParser::$smilies_location) {
return FRAMEWORK_DIR . '/images/smilies'; return FRAMEWORK_DIR . '/images/smilies';
} }
@ -47,42 +47,42 @@ class BBCodeParser extends TextParser {
} }
/** /**
* @deprecated 3.2 Use the "BBCodeParser.smilies_location" config setting instead * @deprecated 4.0 Use the "BBCodeParser.smilies_location" config setting instead
*/ */
public static function set_icon_folder($path) { public static function set_icon_folder($path) {
Deprecation::notice('3.2', 'Use the "BBCodeParser.smilies_location" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.smilies_location" config setting instead');
static::config()->smilies_location = $path; static::config()->smilies_location = $path;
} }
/** /**
* @deprecated 3.2 Use the "BBCodeParser.autolink_urls" config setting instead * @deprecated 4.0 Use the "BBCodeParser.autolink_urls" config setting instead
*/ */
public static function autolinkUrls() { public static function autolinkUrls() {
Deprecation::notice('3.2', 'Use the "BBCodeParser.autolink_urls" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.autolink_urls" config setting instead');
return static::config()->autolink_urls; return static::config()->autolink_urls;
} }
/** /**
* @deprecated 3.2 Use the "BBCodeParser.autolink_urls" config setting instead * @deprecated 4.0 Use the "BBCodeParser.autolink_urls" config setting instead
*/ */
public static function disable_autolink_urls($autolink = false) { public static function disable_autolink_urls($autolink = false) {
Deprecation::notice('3.2', 'Use the "BBCodeParser.autolink_urls" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.autolink_urls" config setting instead');
static::config()->autolink_urls = $autolink; static::config()->autolink_urls = $autolink;
} }
/** /**
* @deprecated 3.2 Use the "BBCodeParser.allow_smilies" config setting instead * @deprecated 4.0 Use the "BBCodeParser.allow_smilies" config setting instead
*/ */
public static function smiliesAllowed() { public static function smiliesAllowed() {
Deprecation::notice('3.2', 'Use the "BBCodeParser.allow_smilies" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.allow_smilies" config setting instead');
return static::config()->allow_smilies; return static::config()->allow_smilies;
} }
/** /**
* @deprecated 3.2 Use the "BBCodeParser.allow_smilies" config setting instead * @deprecated 4.0 Use the "BBCodeParser.allow_smilies" config setting instead
*/ */
public static function enable_smilies() { public static function enable_smilies() {
Deprecation::notice('3.2', 'Use the "BBCodeParser.allow_smilies" config setting instead'); Deprecation::notice('4.0', 'Use the "BBCodeParser.allow_smilies" config setting instead');
static::config()->allow_similies = true; static::config()->allow_similies = true;
} }

View File

@ -202,10 +202,10 @@ class Member extends DataObject implements TemplateGlobalProvider {
private static $temp_id_lifetime = 259200; private static $temp_id_lifetime = 259200;
/** /**
* @deprecated 3.2 Use the "Member.session_regenerate_id" config setting instead * @deprecated 4.0 Use the "Member.session_regenerate_id" config setting instead
*/ */
public static function set_session_regenerate_id($bool) { public static function set_session_regenerate_id($bool) {
Deprecation::notice('3.2', 'Use the "Member.session_regenerate_id" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.session_regenerate_id" config setting instead');
self::config()->session_regenerate_id = $bool; self::config()->session_regenerate_id = $bool;
} }
@ -275,11 +275,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* RewriteCond %{HTTP_COOKIE} !SS_LOGGED_IN=1 * RewriteCond %{HTTP_COOKIE} !SS_LOGGED_IN=1
* </pre> * </pre>
* *
* @deprecated 3.2 Use the "Member.login_marker_cookie" config setting instead * @deprecated 4.0 Use the "Member.login_marker_cookie" config setting instead
* @param $cookieName string The name of the cookie to set. * @param $cookieName string The name of the cookie to set.
*/ */
public static function set_login_marker_cookie($cookieName) { public static function set_login_marker_cookie($cookieName) {
Deprecation::notice('3.2', 'Use the "Member.login_marker_cookie" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.login_marker_cookie" config setting instead');
self::config()->login_marker_cookie = $cookieName; self::config()->login_marker_cookie = $cookieName;
} }
@ -369,11 +369,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Get the field used for uniquely identifying a member * Get the field used for uniquely identifying a member
* in the database. {@see Member::$unique_identifier_field} * in the database. {@see Member::$unique_identifier_field}
* *
* @deprecated 3.2 Use the "Member.unique_identifier_field" config setting instead * @deprecated 4.0 Use the "Member.unique_identifier_field" config setting instead
* @return string * @return string
*/ */
public static function get_unique_identifier_field() { public static function get_unique_identifier_field() {
Deprecation::notice('3.2', 'Use the "Member.unique_identifier_field" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.unique_identifier_field" config setting instead');
return Member::config()->unique_identifier_field; return Member::config()->unique_identifier_field;
} }
@ -381,11 +381,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Set the field used for uniquely identifying a member * Set the field used for uniquely identifying a member
* in the database. {@see Member::$unique_identifier_field} * in the database. {@see Member::$unique_identifier_field}
* *
* @deprecated 3.2 Use the "Member.unique_identifier_field" config setting instead * @deprecated 4.0 Use the "Member.unique_identifier_field" config setting instead
* @param $field The field name to set as the unique field * @param $field The field name to set as the unique field
*/ */
public static function set_unique_identifier_field($field) { public static function set_unique_identifier_field($field) {
Deprecation::notice('3.2', 'Use the "Member.unique_identifier_field" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.unique_identifier_field" config setting instead');
Member::config()->unique_identifier_field = $field; Member::config()->unique_identifier_field = $field;
} }
@ -407,20 +407,20 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Set the number of days that a password should be valid for. * Set the number of days that a password should be valid for.
* Set to null (the default) to have passwords never expire. * Set to null (the default) to have passwords never expire.
* *
* @deprecated 3.2 Use the "Member.password_expiry_days" config setting instead * @deprecated 4.0 Use the "Member.password_expiry_days" config setting instead
*/ */
public static function set_password_expiry($days) { public static function set_password_expiry($days) {
Deprecation::notice('3.2', 'Use the "Member.password_expiry_days" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.password_expiry_days" config setting instead');
self::config()->password_expiry_days = $days; self::config()->password_expiry_days = $days;
} }
/** /**
* Configure the security system to lock users out after this many incorrect logins * Configure the security system to lock users out after this many incorrect logins
* *
* @deprecated 3.2 Use the "Member.lock_out_after_incorrect_logins" config setting instead * @deprecated 4.0 Use the "Member.lock_out_after_incorrect_logins" config setting instead
*/ */
public static function lock_out_after_incorrect_logins($numLogins) { public static function lock_out_after_incorrect_logins($numLogins) {
Deprecation::notice('3.2', 'Use the "Member.lock_out_after_incorrect_logins" config setting instead'); Deprecation::notice('4.0', 'Use the "Member.lock_out_after_incorrect_logins" config setting instead');
self::config()->lock_out_after_incorrect_logins = $numLogins; self::config()->lock_out_after_incorrect_logins = $numLogins;
} }

View File

@ -558,26 +558,26 @@ class Permission extends DataObject implements TemplateGlobalProvider {
/** /**
* add a permission represented by the $code to the {@link slef::$hidden_permissions} list * add a permission represented by the $code to the {@link slef::$hidden_permissions} list
* *
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @param $code string - the permissions code * @param $code string - the permissions code
* @return void * @return void
*/ */
public static function add_to_hidden_permissions($code){ public static function add_to_hidden_permissions($code){
if(is_string($codes)) $codes = array($codes); if(is_string($codes)) $codes = array($codes);
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->update('Permission', 'hidden_permissions', $codes); Config::inst()->update('Permission', 'hidden_permissions', $codes);
} }
/** /**
* remove a permission represented by the $code from the {@link slef::$hidden_permissions} list * remove a permission represented by the $code from the {@link slef::$hidden_permissions} list
* *
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead * @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @param $code string - the permissions code * @param $code string - the permissions code
* @return void * @return void
*/ */
public static function remove_from_hidden_permissions($code){ public static function remove_from_hidden_permissions($code){
if(is_string($codes)) $codes = array($codes); if(is_string($codes)) $codes = array($codes);
Deprecation::notice('3.2', 'Use "Permission.hidden_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.hidden_permissions" config setting instead');
Config::inst()->remove('Permission', 'hidden_permissions', $codes); Config::inst()->remove('Permission', 'hidden_permissions', $codes);
} }
@ -587,12 +587,12 @@ class Permission extends DataObject implements TemplateGlobalProvider {
* Permissions can be grouped by nesting arrays. Scalar values are always * Permissions can be grouped by nesting arrays. Scalar values are always
* treated as permissions. * treated as permissions.
* *
* @deprecated 3.2 Use "Permission.declared_permissions" config setting instead * @deprecated 4.0 Use "Permission.declared_permissions" config setting instead
* @param array $permArray A (possibly nested) array of permissions to * @param array $permArray A (possibly nested) array of permissions to
* declare for the system. * declare for the system.
*/ */
public static function declare_permissions($permArray) { public static function declare_permissions($permArray) {
Deprecation::notice('3.2', 'Use "Permission.declared_permissions" config setting instead'); Deprecation::notice('4.0', 'Use "Permission.declared_permissions" config setting instead');
self::config()->declared_permissions = $permArray; self::config()->declared_permissions = $permArray;
} }

View File

@ -132,10 +132,10 @@ class Security extends Controller implements TemplateGlobalProvider {
/** /**
* Get location of word list file * Get location of word list file
* *
* @deprecated 3.2 Use the "Security.word_list" config setting instead * @deprecated 4.0 Use the "Security.word_list" config setting instead
*/ */
public static function get_word_list() { public static function get_word_list() {
Deprecation::notice('3.2', 'Use the "Security.word_list" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.word_list" config setting instead');
return self::config()->word_list; return self::config()->word_list;
} }
@ -165,22 +165,22 @@ class Security extends Controller implements TemplateGlobalProvider {
/** /**
* Set location of word list file * Set location of word list file
* *
* @deprecated 3.2 Use the "Security.word_list" config setting instead * @deprecated 4.0 Use the "Security.word_list" config setting instead
* @param string $wordListFile Location of word list file * @param string $wordListFile Location of word list file
*/ */
public static function set_word_list($wordListFile) { public static function set_word_list($wordListFile) {
Deprecation::notice('3.2', 'Use the "Security.word_list" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.word_list" config setting instead');
self::config()->word_list = $wordListFile; self::config()->word_list = $wordListFile;
} }
/** /**
* Set the default message set used in permissions failures. * Set the default message set used in permissions failures.
* *
* @deprecated 3.2 Use the "Security.default_message_set" config setting instead * @deprecated 4.0 Use the "Security.default_message_set" config setting instead
* @param string|array $messageSet * @param string|array $messageSet
*/ */
public static function set_default_message_set($messageSet) { public static function set_default_message_set($messageSet) {
Deprecation::notice('3.2', 'Use the "Security.default_message_set" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.default_message_set" config setting instead');
self::config()->default_message_set = $messageSet; self::config()->default_message_set = $messageSet;
} }
@ -888,12 +888,12 @@ class Security extends Controller implements TemplateGlobalProvider {
* This prevents sharing of the session across several sites in the * This prevents sharing of the session across several sites in the
* domain. * domain.
* *
* @deprecated 3.2 Use the "Security.strict_path_checking" config setting instead * @deprecated 4.0 Use the "Security.strict_path_checking" config setting instead
* @param boolean $strictPathChecking To enable or disable strict patch * @param boolean $strictPathChecking To enable or disable strict patch
* checking. * checking.
*/ */
public static function setStrictPathChecking($strictPathChecking) { public static function setStrictPathChecking($strictPathChecking) {
Deprecation::notice('3.2', 'Use the "Security.strict_path_checking" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.strict_path_checking" config setting instead');
self::config()->strict_path_checking = $strictPathChecking; self::config()->strict_path_checking = $strictPathChecking;
} }
@ -901,11 +901,11 @@ class Security extends Controller implements TemplateGlobalProvider {
/** /**
* Get strict path checking * Get strict path checking
* *
* @deprecated 3.2 Use the "Security.strict_path_checking" config setting instead * @deprecated 4.0 Use the "Security.strict_path_checking" config setting instead
* @return boolean Status of strict path checking * @return boolean Status of strict path checking
*/ */
public static function getStrictPathChecking() { public static function getStrictPathChecking() {
Deprecation::notice('3.2', 'Use the "Security.strict_path_checking" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.strict_path_checking" config setting instead');
return self::config()->strict_path_checking; return self::config()->strict_path_checking;
} }
@ -913,23 +913,23 @@ class Security extends Controller implements TemplateGlobalProvider {
/** /**
* Set the password encryption algorithm * Set the password encryption algorithm
* *
* @deprecated 3.2 Use the "Security.password_encryption_algorithm" config setting instead * @deprecated 4.0 Use the "Security.password_encryption_algorithm" config setting instead
* @param string $algorithm One of the available password encryption * @param string $algorithm One of the available password encryption
* algorithms determined by {@link Security::get_encryption_algorithms()} * algorithms determined by {@link Security::get_encryption_algorithms()}
* @return bool Returns TRUE if the passed algorithm was valid, otherwise FALSE. * @return bool Returns TRUE if the passed algorithm was valid, otherwise FALSE.
*/ */
public static function set_password_encryption_algorithm($algorithm) { public static function set_password_encryption_algorithm($algorithm) {
Deprecation::notice('3.2', 'Use the "Security.password_encryption_algorithm" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.password_encryption_algorithm" config setting instead');
self::config()->password_encryption_algorithm = $algorithm; self::config()->password_encryption_algorithm = $algorithm;
} }
/** /**
* @deprecated 3.2 Use the "Security.password_encryption_algorithm" config setting instead * @deprecated 4.0 Use the "Security.password_encryption_algorithm" config setting instead
* @return String * @return String
*/ */
public static function get_password_encryption_algorithm() { public static function get_password_encryption_algorithm() {
Deprecation::notice('3.2', 'Use the "Security.password_encryption_algorithm" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.password_encryption_algorithm" config setting instead');
return self::config()->password_encryption_algorithm; return self::config()->password_encryption_algorithm;
} }
@ -1022,20 +1022,20 @@ class Security extends Controller implements TemplateGlobalProvider {
* Enable or disable recording of login attempts * Enable or disable recording of login attempts
* through the {@link LoginRecord} object. * through the {@link LoginRecord} object.
* *
* @deprecated 3.2 Use the "Security.login_recording" config setting instead * @deprecated 4.0 Use the "Security.login_recording" config setting instead
* @param boolean $bool * @param boolean $bool
*/ */
public static function set_login_recording($bool) { public static function set_login_recording($bool) {
Deprecation::notice('3.2', 'Use the "Security.login_recording" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.login_recording" config setting instead');
self::$login_recording = (bool)$bool; self::$login_recording = (bool)$bool;
} }
/** /**
* @deprecated 3.2 Use the "Security.login_recording" config setting instead * @deprecated 4.0 Use the "Security.login_recording" config setting instead
* @return boolean * @return boolean
*/ */
public static function login_recording() { public static function login_recording() {
Deprecation::notice('3.2', 'Use the "Security.login_recording" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.login_recording" config setting instead');
return self::$login_recording; return self::$login_recording;
} }
@ -1049,20 +1049,20 @@ class Security extends Controller implements TemplateGlobalProvider {
private static $default_login_dest = ""; private static $default_login_dest = "";
/** /**
* @deprecated 3.2 Use the "Security.default_login_dest" config setting instead * @deprecated 4.0 Use the "Security.default_login_dest" config setting instead
*/ */
public static function set_default_login_dest($dest) { public static function set_default_login_dest($dest) {
Deprecation::notice('3.2', 'Use the "Security.default_login_dest" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.default_login_dest" config setting instead');
self::config()->default_login_dest = $dest; self::config()->default_login_dest = $dest;
} }
/** /**
* Get the default login dest. * Get the default login dest.
* *
* @deprecated 3.2 Use the "Security.default_login_dest" config setting instead * @deprecated 4.0 Use the "Security.default_login_dest" config setting instead
*/ */
public static function default_login_dest() { public static function default_login_dest() {
Deprecation::notice('3.2', 'Use the "Security.default_login_dest" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.default_login_dest" config setting instead');
return self::config()->default_login_dest; return self::config()->default_login_dest;
} }
@ -1085,10 +1085,10 @@ class Security extends Controller implements TemplateGlobalProvider {
/** /**
* Set a custom log-in URL if you have built your own log-in page. * Set a custom log-in URL if you have built your own log-in page.
* *
* @deprecated 3.2 Use the "Security.login_url" config setting instead. * @deprecated 4.0 Use the "Security.login_url" config setting instead.
*/ */
public static function set_login_url($loginUrl) { public static function set_login_url($loginUrl) {
Deprecation::notice('3.2', 'Use the "Security.login_url" config setting instead'); Deprecation::notice('4.0', 'Use the "Security.login_url" config setting instead');
self::config()->update("login_url", $loginUrl); self::config()->update("login_url", $loginUrl);
} }

View File

@ -111,7 +111,7 @@ class EmailTest extends SapphireTest {
$oldProject = $project; $oldProject = $project;
$project = 'emailtest'; $project = 'emailtest';
Email::set_mailer(new EmailTest_Mailer()); Injector::inst()->registerService(new EmailTest_Mailer(), 'Mailer');
$email = new Email( $email = new Email(
'from@example.com', 'from@example.com',
'to@example.com', 'to@example.com',
@ -160,7 +160,7 @@ class EmailTest extends SapphireTest {
$oldProject = $project; $oldProject = $project;
$project = 'emailtest'; $project = 'emailtest';
Email::set_mailer(new EmailTest_Mailer()); Injector::inst()->registerService(new EmailTest_Mailer(), 'Mailer');
$email = new Email( $email = new Email(
'from@example.com', 'from@example.com',
'to@example.com', 'to@example.com',

View File

@ -199,7 +199,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseInt() { public function testComparisonClauseInt() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"SortOrder\") VALUES (2)"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"SortOrder\") VALUES (2)");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"SortOrder"', '2')); $query->where(DB::get_conn()->comparisonClause('"SortOrder"', '2'));
$this->assertGreaterThan(0, $query->count(), "Couldn't find SortOrder"); $this->assertGreaterThan(0, $query->count(), "Couldn't find SortOrder");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }
@ -207,7 +207,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateFull() { public function testComparisonClauseDateFull() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"MyDate"', '1988-03-04%')); $query->where(DB::get_conn()->comparisonClause('"MyDate"', '1988-03-04%'));
$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate"); $this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }
@ -215,7 +215,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateStartsWith() { public function testComparisonClauseDateStartsWith() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"MyDate"', '1988%')); $query->where(DB::get_conn()->comparisonClause('"MyDate"', '1988%'));
$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate"); $this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }
@ -223,7 +223,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateStartsPartial() { public function testComparisonClauseDateStartsPartial() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"MyDate"', '%03-04%')); $query->where(DB::get_conn()->comparisonClause('"MyDate"', '%03-04%'));
$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate"); $this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }
@ -231,7 +231,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseTextCaseInsensitive() { public function testComparisonClauseTextCaseInsensitive() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"MyString"', 'helloworld')); $query->where(DB::get_conn()->comparisonClause('"MyString"', 'helloworld'));
$this->assertGreaterThan(0, $query->count(), "Couldn't find MyString"); $this->assertGreaterThan(0, $query->count(), "Couldn't find MyString");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }
@ -239,11 +239,11 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseTextCaseSensitive() { public function testComparisonClauseTextCaseSensitive() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')"); DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
$query = new DataQuery('DataQueryTest_F'); $query = new DataQuery('DataQueryTest_F');
$query->where(DB::getConn()->comparisonClause('"MyString"', 'HelloWorld', false, false, true)); $query->where(DB::get_conn()->comparisonClause('"MyString"', 'HelloWorld', false, false, true));
$this->assertGreaterThan(0, $query->count(), "Couldn't find MyString"); $this->assertGreaterThan(0, $query->count(), "Couldn't find MyString");
$query2 = new DataQuery('DataQueryTest_F'); $query2 = new DataQuery('DataQueryTest_F');
$query2->where(DB::getConn()->comparisonClause('"MyString"', 'helloworld', false, false, true)); $query2->where(DB::get_conn()->comparisonClause('"MyString"', 'helloworld', false, false, true));
$this->assertEquals(0, $query2->count(), "Found mystring. Shouldn't be able too."); $this->assertEquals(0, $query2->count(), "Found mystring. Shouldn't be able too.");
$this->resetDBSchema(true); $this->resetDBSchema(true);
} }

View File

@ -250,13 +250,13 @@ class ManyManyListTest extends SapphireTest {
// ensure that ManyManyListTest_ExtraFields_Clients.ValueCurrency is // ensure that ManyManyListTest_ExtraFields_Clients.ValueCurrency is
// selected. // selected.
$db = DB::getConn(); $db = DB::get_conn();
$expected = 'SELECT DISTINCT "ManyManyListTest_ExtraFields_Clients"."WorthCurrency",' $expected = 'SELECT DISTINCT "ManyManyListTest_ExtraFields_Clients"."WorthCurrency",'
.' "ManyManyListTest_ExtraFields_Clients"."WorthAmount", "ManyManyListTest_ExtraFields_Clients"."Reference",' .' "ManyManyListTest_ExtraFields_Clients"."WorthAmount", "ManyManyListTest_ExtraFields_Clients"."Reference",'
.' "ManyManyListTest_ExtraFields"."ClassName", "ManyManyListTest_ExtraFields"."LastEdited",' .' "ManyManyListTest_ExtraFields"."ClassName", "ManyManyListTest_ExtraFields"."LastEdited",'
.' "ManyManyListTest_ExtraFields"."Created", "ManyManyListTest_ExtraFields"."ID",' .' "ManyManyListTest_ExtraFields"."Created", "ManyManyListTest_ExtraFields"."ID",'
.' CASE WHEN "ManyManyListTest_ExtraFields"."ClassName" IS NOT NULL THEN' .' CASE WHEN "ManyManyListTest_ExtraFields"."ClassName" IS NOT NULL THEN'
.' "ManyManyListTest_ExtraFields"."ClassName" ELSE '. $db->prepStringForDB('ManyManyListTest_ExtraFields') .' "ManyManyListTest_ExtraFields"."ClassName" ELSE '. Convert::raw2sql('ManyManyListTest_ExtraFields', true)
.' END AS "RecordClassName" FROM "ManyManyListTest_ExtraFields" INNER JOIN' .' END AS "RecordClassName" FROM "ManyManyListTest_ExtraFields" INNER JOIN'
.' "ManyManyListTest_ExtraFields_Clients" ON' .' "ManyManyListTest_ExtraFields_Clients" ON'
.' "ManyManyListTest_ExtraFields_Clients"."ManyManyListTest_ExtraFieldsID" =' .' "ManyManyListTest_ExtraFields_Clients"."ManyManyListTest_ExtraFieldsID" ='

View File

@ -597,20 +597,20 @@ class SSViewer implements Flushable {
* Set whether HTML comments indicating the source .SS file used to render this page should be * Set whether HTML comments indicating the source .SS file used to render this page should be
* included in the output. This is enabled by default * included in the output. This is enabled by default
* *
* @deprecated 3.2 Use the "SSViewer.source_file_comments" config setting instead * @deprecated 4.0 Use the "SSViewer.source_file_comments" config setting instead
* @param boolean $val * @param boolean $val
*/ */
public static function set_source_file_comments($val) { public static function set_source_file_comments($val) {
Deprecation::notice('3.2', 'Use the "SSViewer.source_file_comments" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.source_file_comments" config setting instead');
Config::inst()->update('SSViewer', 'source_file_comments', $val); Config::inst()->update('SSViewer', 'source_file_comments', $val);
} }
/** /**
* @deprecated 3.2 Use the "SSViewer.source_file_comments" config setting instead * @deprecated 4.0 Use the "SSViewer.source_file_comments" config setting instead
* @return boolean * @return boolean
*/ */
public static function get_source_file_comments() { public static function get_source_file_comments() {
Deprecation::notice('3.2', 'Use the "SSViewer.source_file_comments" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.source_file_comments" config setting instead');
return Config::inst()->get('SSViewer', 'source_file_comments'); return Config::inst()->get('SSViewer', 'source_file_comments');
} }
@ -684,20 +684,20 @@ class SSViewer implements Flushable {
} }
/** /**
* @deprecated 3.2 Use the "SSViewer.theme" config setting instead * @deprecated 4.0 Use the "SSViewer.theme" config setting instead
* @param string $theme The "base theme" name (without underscores). * @param string $theme The "base theme" name (without underscores).
*/ */
public static function set_theme($theme) { public static function set_theme($theme) {
Deprecation::notice('3.2', 'Use the "SSViewer.theme" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.theme" config setting instead');
Config::inst()->update('SSViewer', 'theme', $theme); Config::inst()->update('SSViewer', 'theme', $theme);
} }
/** /**
* @deprecated 3.2 Use the "SSViewer.theme" config setting instead * @deprecated 4.0 Use the "SSViewer.theme" config setting instead
* @return string * @return string
*/ */
public static function current_theme() { public static function current_theme() {
Deprecation::notice('3.2', 'Use the "SSViewer.theme" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.theme" config setting instead');
return Config::inst()->get('SSViewer', 'theme'); return Config::inst()->get('SSViewer', 'theme');
} }
@ -736,10 +736,11 @@ class SSViewer implements Flushable {
} }
/** /**
* @deprecated since version 4.0
* @return string * @return string
*/ */
public static function current_custom_theme(){ public static function current_custom_theme(){
Deprecation::notice('3.2', 'Use the "SSViewer.theme" and "SSViewer.theme_enabled" config settings instead'); Deprecation::notice('4.0', 'Use the "SSViewer.theme" and "SSViewer.theme_enabled" config settings instead');
return Config::inst()->get('SSViewer', 'theme_enabled') ? Config::inst()->get('SSViewer', 'theme') : null; return Config::inst()->get('SSViewer', 'theme_enabled') ? Config::inst()->get('SSViewer', 'theme') : null;
} }
@ -865,31 +866,31 @@ class SSViewer implements Flushable {
* links: "<?php echo $_SERVER['REQUEST_URI']; ?>". This is useful if you're generating a * links: "<?php echo $_SERVER['REQUEST_URI']; ?>". This is useful if you're generating a
* page that will be saved to a .php file and may be accessed from different URLs. * page that will be saved to a .php file and may be accessed from different URLs.
* *
* @deprecated 3.2 Use the "SSViewer.rewrite_hash_links" config setting instead * @deprecated 4.0 Use the "SSViewer.rewrite_hash_links" config setting instead
* @param string $optionName * @param string $optionName
* @param mixed $optionVal * @param mixed $optionVal
*/ */
public static function setOption($optionName, $optionVal) { public static function setOption($optionName, $optionVal) {
if($optionName == 'rewriteHashlinks') { if($optionName == 'rewriteHashlinks') {
Deprecation::notice('3.2', 'Use the "SSViewer.rewrite_hash_links" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.rewrite_hash_links" config setting instead');
Config::inst()->update('SSViewer', 'rewrite_hash_links', $optionVal); Config::inst()->update('SSViewer', 'rewrite_hash_links', $optionVal);
} else { } else {
Deprecation::notice('3.2', 'Use the "SSViewer.' . $optionName . '" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.' . $optionName . '" config setting instead');
Config::inst()->update('SSViewer', $optionName, $optionVal); Config::inst()->update('SSViewer', $optionName, $optionVal);
} }
} }
/** /**
* @deprecated 3.2 Use the "SSViewer.rewrite_hash_links" config setting instead * @deprecated 4.0 Use the "SSViewer.rewrite_hash_links" config setting instead
* @param string * @param string
* @return mixed * @return mixed
*/ */
public static function getOption($optionName) { public static function getOption($optionName) {
if($optionName == 'rewriteHashlinks') { if($optionName == 'rewriteHashlinks') {
Deprecation::notice('3.2', 'Use the "SSViewer.rewrite_hash_links" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.rewrite_hash_links" config setting instead');
return Config::inst()->get('SSViewer', 'rewrite_hash_links'); return Config::inst()->get('SSViewer', 'rewrite_hash_links');
} else { } else {
Deprecation::notice('3.2', 'Use the "SSViewer.' . $optionName . '" config setting instead'); Deprecation::notice('4.0', 'Use the "SSViewer.' . $optionName . '" config setting instead');
return Config::inst()->get('SSViewer', $optionName); return Config::inst()->get('SSViewer', $optionName);
} }
} }