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

@ -1622,11 +1622,13 @@ class LeftAndMain extends Controller implements PermissionProvider {
/**
* Sets the href for the anchor on the Silverstripe logo in the menu
*
* @deprecated since version 4.0
*
* @param String $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);
}
@ -1648,9 +1650,10 @@ class LeftAndMain extends Controller implements PermissionProvider {
/**
* @param String $name
* @deprecated since version 4.0
*/
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);
}
@ -1747,21 +1750,24 @@ class LeftAndMain extends Controller implements PermissionProvider {
/**
* Register the given javascript file as required in the CMS.
* Filenames should be relative to the base, eg, FRAMEWORK_DIR . '/javascript/loader.js'
*
* @deprecated since version 4.0
*/
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()));
}
/**
* 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 $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
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)));
}
@ -1769,12 +1775,14 @@ class LeftAndMain extends Controller implements PermissionProvider {
* Register the given "themeable stylesheet" as required.
* 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.
*
* @deprecated since version 4.0
*
* @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")
*/
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)));
}

View File

@ -465,20 +465,20 @@ abstract class ModelAdmin extends LeftAndMain {
* overwrite the static page_length of the admin panel,
* 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){
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;
}
/**
* 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(){
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;
}

View File

@ -334,41 +334,41 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
* The permissions represented in the $codes will not appearing in the form
* 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
*/
public static function add_hidden_permission($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);
}
/**
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead
* @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @param $codes String|Array
*/
public static function remove_hidden_permission($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);
}
/**
* @deprecated 3.2 Use "Permission.hidden_permissions" config setting instead
* @deprecated 4.0 Use "Permission.hidden_permissions" config setting instead
* @return Array
*/
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);
}
/**
* 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(){
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());
}
}

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
* {@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 mixed $value The cURL opt 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));
}
/**
* 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) {
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);
}
@ -74,12 +74,12 @@ class RestfulService extends ViewableData implements Flushable {
* @param string $user The proxy auth user name
* @param string $password The proxy auth password
* @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
*/
public static function set_default_proxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
Deprecation::notice(
'3.1',
'4.0',
'Use the "RestfulService.default_curl_options" config setting instead, '
. 'with direct reference to the CURL_* options'
);
@ -144,8 +144,11 @@ class RestfulService extends ViewableData implements Flushable {
$this->customHeaders[] = $header;
}
/**
* @deprecated since version 4.0
*/
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);
}
@ -616,9 +619,10 @@ class RestfulService_Response extends SS_HTTPResponse {
/**
* @param string
* @deprecated since version 4.0
*/
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) {
$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,
* 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) {
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);
}
@ -67,30 +67,30 @@ class ContentNegotiator extends Object {
* 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.
*
* @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() {
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');
}
/**
* 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() {
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);
}
/**
* 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() {
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);
}

View File

@ -69,13 +69,13 @@ class Director implements TemplateGlobalProvider {
*
* 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
* priority 100 for your site's rules. The built-in rules are priority 10, standard modules are
* priority 50.
*/
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);
}
@ -575,10 +575,10 @@ class Director implements TemplateGlobalProvider {
* Sets the root URL for the website.
* 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) {
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);
}
@ -595,10 +595,10 @@ class Director implements TemplateGlobalProvider {
* Sets the root folder for the website.
* 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) {
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);
}
@ -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()},
* 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.
*/
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",
E_USER_WARNING);
} 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);
}
}

View File

@ -103,7 +103,7 @@ class HTTP {
*/
public static function urlRewriter($content, $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

View File

@ -162,24 +162,24 @@ class Session {
* To make cookies visible on all subdomains then the domain
* 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
*/
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);
}
/**
* 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
*/
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');
}
@ -187,24 +187,24 @@ class Session {
* Path to set on the domain where the session cookie will work.
* 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
*/
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);
}
/**
* 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
*/
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')) {
return Config::inst()->get('Session', 'cookie_path');
} else {
@ -215,45 +215,46 @@ class Session {
/**
* 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
*/
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);
}
/**
* 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
*/
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');
}
/**
* 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
*/
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);
}
/**
* Get the session store path
* @return string
* @deprecated since version 4.0
*/
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');
}
@ -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.
*
* @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.
*/
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);
}
@ -605,20 +606,20 @@ class Session {
/**
* 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.
*/
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);
}
/**
* @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() {
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');
}
}

View File

@ -750,10 +750,10 @@ class Injector {
/**
* Register a service with an explicit name
*
* @deprecated since 3.1.1
* @deprecated since 4.0
*/
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);
}

View File

@ -681,7 +681,7 @@ class Config {
/**
* @package framework
* @subpackage core
* @deprecated 3.2
* @deprecated 4.0
*/
class Config_LRU {
const SIZE = 1000;
@ -693,7 +693,7 @@ class Config_LRU {
protected $c = 0;
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', '<')) {
// SplFixedArray causes seg faults before PHP 5.3.7
$this->cache = array();

View File

@ -584,7 +584,7 @@ abstract class Object {
$sources[] = $extensionClass;
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");
}

View File

@ -79,7 +79,7 @@ class SS_ConfigStaticManifest {
$static = $this->statics[$class][$name];
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);
// Don't warn more than once per static
$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) {
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);
}
/**
* @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() {
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');
}

View File

@ -43,7 +43,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
*/
protected $usesDatabase = null;
/**
* @deprecated since version 4.0
*/
protected $originalMailer;
protected $originalMemberPasswordValidator;
protected $originalRequirements;
protected $originalIsRunningTest;
@ -221,7 +225,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
// Set up email
$this->originalMailer = Email::mailer();
$this->mailer = new TestMailer();
Email::set_mailer($this->mailer);
Injector::inst()->registerService($this->mailer, 'Mailer');
Config::inst()->remove('Email', 'send_all_emails_to');
// 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);
// Restore email configuration
if($this->originalMailer) {
Email::set_mailer($this->originalMailer);
$this->originalMailer = null;
}
$this->originalMailer = null;
$this->mailer = null;
// Restore password validation

View File

@ -62,10 +62,10 @@ class Email extends ViewableData {
protected $bcc;
/**
* @deprecated since version 3.3
* @deprecated since version 4.0
*/
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');
}
@ -162,7 +162,7 @@ class Email extends ViewableData {
if($bcc != null) $this->bcc = $bcc;
if($bounceHandlerURL != null) {
Deprecation::notice('3.1', 'Use "emailbouncehandler" module');
Deprecation::notice('4.0', 'Use "emailbouncehandler" module');
}
parent::__construct();
@ -177,8 +177,11 @@ class Email extends ViewableData {
return $this;
}
/**
* @deprecated since version 4.0
*/
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) {
@ -538,20 +541,20 @@ class Email extends ViewableData {
*
* 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
*/
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);
}
/**
* @deprecated 3.2 Use the "Email.admin_email" config setting instead
* @deprecated 4.0 Use the "Email.admin_email" config setting instead
* @return string
*/
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');
}
@ -562,10 +565,10 @@ class Email extends ViewableData {
*
* 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) {
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);
}
@ -580,10 +583,10 @@ class Email extends ViewableData {
*
* 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) {
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);
}
@ -598,10 +601,10 @@ class Email extends ViewableData {
*
* 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) {
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);
}

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) {
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) {
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.
*
* @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.
*/
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) {
config::inst()->update('GDBackend', 'default_quality', (int) $quality);
}
@ -562,10 +562,10 @@ class GDBackend extends Object implements Image_Backend {
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) {
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);
}
}

View File

@ -42,12 +42,12 @@ class ImagickBackend extends Imagick implements Image_Backend {
/**
* 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
* @return void
*/
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) {
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 mixed $v
* @return boolean
*/
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));
}

View File

@ -100,7 +100,7 @@ class FormAction extends FormField {
// Remove this method override in 4.0
$decoded = Convert::xml2raw($title);
if($decoded !== $title) {
if($title && $decoded !== $title) {
Deprecation::notice(
'4.0',
'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) {
Deprecation::notice('3.2', 'Use FormField::create_tag()');
Deprecation::notice('4.0', 'Use FormField::create_tag()');
return self::create_tag($tag, $attributes, $content);
}
}
/**
* Validation method each {@link FormField} subclass should implement,

View File

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

View File

@ -34,8 +34,11 @@ class RequiredFields extends Validator {
parent::__construct();
}
/**
* @deprecated since version 4.0
*/
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;
return $this;
}

View File

@ -137,54 +137,56 @@ class i18n extends Object implements TemplateGlobalProvider, Flushable {
*
* @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
*/
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);
}
/**
* @deprecated 3.2 Use the "i18n.js_i18n" config setting instead
* @deprecated 4.0 Use the "i18n.js_i18n" config setting instead
* @return bool
*/
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');
}
/**
* @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
*/
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);
}
/**
* @deprecated since version 4.0
* @return string ISO 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');
}
/**
* @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
*/
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);
}
/**
* @deprecated since version 4.0
* @return string ISO 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');
}
@ -2224,10 +2226,11 @@ class i18n extends Object implements TemplateGlobalProvider, Flushable {
/**
* Get a list of locales (code => language and country)
*
* @deprecated since version 4.0
* @return list of languages in the form 'code' => 'name'
*/
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');
}

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') {
Deprecation::notice('3.3', 'Use DB::set_conn instead');
Deprecation::notice('4.0', 'Use DB::set_conn instead');
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') {
Deprecation::notice('3.3', 'Use DB::get_conn instead');
Deprecation::notice('4.0', 'Use DB::get_conn instead');
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) {
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) {
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);
}
@ -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() {
Deprecation::notice('3.3', 'Use DB::is_active instead');
Deprecation::notice('4.0', 'Use DB::is_active instead');
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) {
Deprecation::notice('3.3', 'Use DB::create_database instead');
Deprecation::notice('4.0', 'Use DB::create_database instead');
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) {
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);
}
@ -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) {
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);
}
@ -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,
$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);
}
@ -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) {
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);
}
@ -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) {
Deprecation::notice('3.3', 'Use DB::require_index instead');
Deprecation::notice('4.0', 'Use DB::require_index instead');
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) {
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);
}
@ -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) {
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);
}
@ -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) {
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);
}
@ -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() {
Deprecation::notice('3.3', 'Use DB::affected_rows instead');
Deprecation::notice('4.0', 'Use DB::affected_rows instead');
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() {
Deprecation::notice('3.3', 'Use DB::table_list instead');
Deprecation::notice('4.0', 'Use DB::table_list instead');
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) {
Deprecation::notice('3.3', 'Use DB::field_list instead');
Deprecation::notice('4.0', 'Use DB::field_list instead');
return self::field_list($table);
}

View File

@ -265,10 +265,10 @@ class DatabaseAdmin extends Controller {
/**
* Clear all data out of the database
*
* @deprecated since version 3.2
* @deprecated since version 4.0
*/
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();
}

View File

@ -168,10 +168,10 @@ class Image extends File implements Flushable {
* File names are filtered through {@link FileNameFilter}, see class documentation
* on how to influence this behaviour.
*
* @deprecated 3.2
* @deprecated 4.0
*/
public function loadUploadedImage($tmpFile) {
Deprecation::notice('3.2', 'Use the Upload::loadIntoFile()');
Deprecation::notice('4.0', 'Use the Upload::loadIntoFile()');
if(!is_array($tmpFile)) {
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();
/**
* @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){
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);
}
/**
* @deprecated since version 3.3 Use selectDatabase('dbname', true) instead
* @deprecated since version 4.0 Use selectDatabase('dbname', true) instead
*/
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();
$this->selectDatabase($database, true);
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) {
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) {
Deprecation::notice('3.3', 'Use Convert::raw2sql($string, true) instead');
Deprecation::notice('4.0', 'Use Convert::raw2sql($string, true) instead');
return $this->quoteString($string);
}
/**
* @deprecated since version 3.3 Use dropSelectedDatabase instead
* @deprecated since version 4.0 Use dropSelectedDatabase instead
*/
public function dropDatabase() {
Deprecation::notice('3.3', 'Use dropSelectedDatabase instead');
Deprecation::notice('4.0', 'Use dropSelectedDatabase instead');
$this->dropSelectedDatabase();
}
/**
* @deprecated since version 3.3 Use databaseList instead
* @deprecated since version 4.0 Use databaseList instead
*/
public function allDatabaseNames() {
Deprecation::notice('3.3', 'Use databaseList instead');
Deprecation::notice('4.0', 'Use databaseList instead');
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) {
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);
}
/**
* @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,
$alteredFields = null, $alteredIndexes = null, $alteredOptions = 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(
$table, $newFields, $newIndexes, $alteredFields,
$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) {
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);
}
/**
* @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) {
Deprecation::notice('3.3', 'Use DB::create_field() instead');
Deprecation::notice('4.0', 'Use DB::create_field() instead');
$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) {
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);
}
/**
* @deprecated since version 3.3 Use getSelectedDatabase instead
* @deprecated since version 4.0 Use getSelectedDatabase instead
*/
public function currentDatabase() {
Deprecation::notice('3.3', 'Use getSelectedDatabase instead');
Deprecation::notice('4.0', 'Use getSelectedDatabase instead');
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) {
Deprecation::notice('3.3', 'Use DB::field_list instead');
Deprecation::notice('4.0', 'Use DB::field_list instead');
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() {
Deprecation::notice('3.3', 'Use DB::table_list instead');
Deprecation::notice('4.0', 'Use DB::table_list instead');
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) {
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);
}
/**
* @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) {
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);
}
/**
* @deprecated since version 3.3 Use Convert::raw2sql instead
* @deprecated since version 4.0 Use Convert::raw2sql instead
*/
public function addslashes($value) {
Deprecation::notice('3.3', 'Use Convert::raw2sql instead');
Deprecation::notice('4.0', 'Use Convert::raw2sql instead');
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() {
Deprecation::notice('3.3', 'Use DB::get_schema()->cancelSchemaUpdate instead');
Deprecation::notice('4.0', 'Use DB::get_schema()->cancelSchemaUpdate instead');
$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() {
Deprecation::notice('3.3', 'Use DB::get_schema()->isSchemaUpdating() instead');
Deprecation::notice('4.0', 'Use DB::get_schema()->isSchemaUpdating() instead');
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() {
Deprecation::notice('3.3', 'Use DB::get_schema()->doesSchemaNeedUpdating() instead');
Deprecation::notice('4.0', 'Use DB::get_schema()->doesSchemaNeedUpdating() instead');
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) {
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);
}
/**
* @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) {
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);
}
/**
* @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) {
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);
}
/**
* @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) {
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);
}
/**
* @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) {
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);
}
/**
* @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) {
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);
}
/**
* @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,
$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(
$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) {
Deprecation::notice('3.3', 'Use DB::dont_require_table() instead');
Deprecation::notice('4.0', 'Use DB::dont_require_table() instead');
$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) {
Deprecation::notice('3.3', 'Use DB::require_index() instead');
Deprecation::notice('4.0', 'Use DB::require_index() instead');
$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) {
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);
}
/**
* @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) {
Deprecation::notice('3.3', 'Use DB::require_field() instead');
Deprecation::notice('4.0', 'Use DB::require_field() instead');
$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) {
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);
}
/**
* @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()) {
Deprecation::notice('3.3', 'Use DB::build_sql() instead');
Deprecation::notice('4.0', 'Use DB::build_sql() instead');
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]
*/
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;
}
}

View File

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

View File

@ -24,18 +24,18 @@ abstract class SQLExpression {
protected $replacementsNew = array();
/**
* @deprecated since version 3.2
* @deprecated since version 4.0
*/
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;
}
/**
* @deprecated since version 3.2
* @deprecated since version 4.0
*/
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;
}

View File

@ -36,10 +36,10 @@ class BBCodeParser extends TextParser {
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() {
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) {
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) {
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;
}
/**
* @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() {
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;
}
/**
* @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) {
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;
}
/**
* @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() {
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;
}
/**
* @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() {
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;
}

View File

@ -202,10 +202,10 @@ class Member extends DataObject implements TemplateGlobalProvider {
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) {
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;
}
@ -275,11 +275,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* RewriteCond %{HTTP_COOKIE} !SS_LOGGED_IN=1
* </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.
*/
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;
}
@ -369,11 +369,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Get the field used for uniquely identifying a member
* 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
*/
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;
}
@ -381,11 +381,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Set the field used for uniquely identifying a member
* 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
*/
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;
}
@ -407,20 +407,20 @@ class Member extends DataObject implements TemplateGlobalProvider {
* Set the number of days that a password should be valid for.
* 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) {
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;
}
/**
* 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) {
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;
}

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
*
* @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
* @return void
*/
public static function add_to_hidden_permissions($code){
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);
}
/**
* 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
* @return void
*/
public static function remove_from_hidden_permissions($code){
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);
}
@ -587,12 +587,12 @@ class Permission extends DataObject implements TemplateGlobalProvider {
* Permissions can be grouped by nesting arrays. Scalar values are always
* 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
* declare for the system.
*/
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;
}

View File

@ -132,10 +132,10 @@ class Security extends Controller implements TemplateGlobalProvider {
/**
* 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() {
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;
}
@ -165,22 +165,22 @@ class Security extends Controller implements TemplateGlobalProvider {
/**
* 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
*/
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;
}
/**
* 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
*/
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;
}
@ -888,12 +888,12 @@ class Security extends Controller implements TemplateGlobalProvider {
* This prevents sharing of the session across several sites in the
* 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
* checking.
*/
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;
}
@ -901,11 +901,11 @@ class Security extends Controller implements TemplateGlobalProvider {
/**
* 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
*/
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;
}
@ -913,23 +913,23 @@ class Security extends Controller implements TemplateGlobalProvider {
/**
* 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
* algorithms determined by {@link Security::get_encryption_algorithms()}
* @return bool Returns TRUE if the passed algorithm was valid, otherwise FALSE.
*/
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;
}
/**
* @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
*/
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;
}
@ -1022,20 +1022,20 @@ class Security extends Controller implements TemplateGlobalProvider {
* Enable or disable recording of login attempts
* 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
*/
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;
}
/**
* @deprecated 3.2 Use the "Security.login_recording" config setting instead
* @deprecated 4.0 Use the "Security.login_recording" config setting instead
* @return boolean
*/
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;
}
@ -1049,20 +1049,20 @@ class Security extends Controller implements TemplateGlobalProvider {
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) {
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;
}
/**
* 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() {
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;
}
@ -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.
*
* @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) {
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);
}

View File

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

View File

@ -199,7 +199,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseInt() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"SortOrder\") VALUES (2)");
$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->resetDBSchema(true);
}
@ -207,7 +207,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateFull() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$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->resetDBSchema(true);
}
@ -215,7 +215,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateStartsWith() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$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->resetDBSchema(true);
}
@ -223,7 +223,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseDateStartsPartial() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
$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->resetDBSchema(true);
}
@ -231,7 +231,7 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseTextCaseInsensitive() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
$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->resetDBSchema(true);
}
@ -239,11 +239,11 @@ class DataQueryTest extends SapphireTest {
public function testComparisonClauseTextCaseSensitive() {
DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
$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");
$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->resetDBSchema(true);
}

View File

@ -250,13 +250,13 @@ class ManyManyListTest extends SapphireTest {
// ensure that ManyManyListTest_ExtraFields_Clients.ValueCurrency is
// selected.
$db = DB::getConn();
$db = DB::get_conn();
$expected = 'SELECT DISTINCT "ManyManyListTest_ExtraFields_Clients"."WorthCurrency",'
.' "ManyManyListTest_ExtraFields_Clients"."WorthAmount", "ManyManyListTest_ExtraFields_Clients"."Reference",'
.' "ManyManyListTest_ExtraFields"."ClassName", "ManyManyListTest_ExtraFields"."LastEdited",'
.' "ManyManyListTest_ExtraFields"."Created", "ManyManyListTest_ExtraFields"."ID",'
.' 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'
.' "ManyManyListTest_ExtraFields_Clients" ON'
.' "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
* 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
*/
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);
}
/**
* @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
*/
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');
}
@ -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).
*/
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);
}
/**
* @deprecated 3.2 Use the "SSViewer.theme" config setting instead
* @deprecated 4.0 Use the "SSViewer.theme" config setting instead
* @return string
*/
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');
}
@ -736,10 +736,11 @@ class SSViewer implements Flushable {
}
/**
* @deprecated since version 4.0
* @return string
*/
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;
}
@ -865,31 +866,31 @@ class SSViewer implements Flushable {
* 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.
*
* @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 mixed $optionVal
*/
public static function setOption($optionName, $optionVal) {
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);
} 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);
}
}
/**
* @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
* @return mixed
*/
public static function getOption($optionName) {
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');
} 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);
}
}