Commit efe0a73b authored by catch's avatar catch

Issue #334024 by klausi, catch, beejeebus, sun: Use const keyword to define...

Issue #334024 by klausi, catch, beejeebus, sun: Use const keyword to define constants instead of define().
parent c42985ff
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
* solve some theming issues. This flag is checked on several places * solve some theming issues. This flag is checked on several places
* in Drupal code (not just authorize.php). * in Drupal code (not just authorize.php).
*/ */
define('MAINTENANCE_MODE', 'update'); const MAINTENANCE_MODE = 'update';
/** /**
* Renders a 403 access denied page for authorize.php. * Renders a 403 access denied page for authorize.php.
......
...@@ -8,34 +8,34 @@ ...@@ -8,34 +8,34 @@
/** /**
* The current system version. * The current system version.
*/ */
define('VERSION', '8.0-dev'); const VERSION = '8.0-dev';
/** /**
* Core API compatibility. * Core API compatibility.
*/ */
define('DRUPAL_CORE_COMPATIBILITY', '8.x'); const DRUPAL_CORE_COMPATIBILITY = '8.x';
/** /**
* Minimum supported version of PHP. * Minimum supported version of PHP.
*/ */
define('DRUPAL_MINIMUM_PHP', '5.3.2'); const DRUPAL_MINIMUM_PHP = '5.3.2';
/** /**
* Minimum recommended value of PHP memory_limit. * Minimum recommended value of PHP memory_limit.
*/ */
define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT', '32M'); const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = '32M';
/** /**
* Indicates that the item should never be removed unless explicitly selected. * Indicates that the item should never be removed unless explicitly selected.
* *
* The item may be removed using cache()->delete() with a cache ID. * The item may be removed using cache()->delete() with a cache ID.
*/ */
define('CACHE_PERMANENT', 0); const CACHE_PERMANENT = 0;
/** /**
* Indicates that the item should be removed at the next general cache wipe. * Indicates that the item should be removed at the next general cache wipe.
*/ */
define('CACHE_TEMPORARY', -1); const CACHE_TEMPORARY = -1;
/** /**
* @defgroup logging_severity_levels Logging severity levels * @defgroup logging_severity_levels Logging severity levels
...@@ -60,42 +60,42 @@ ...@@ -60,42 +60,42 @@
/** /**
* Log message severity -- Emergency: system is unusable. * Log message severity -- Emergency: system is unusable.
*/ */
define('WATCHDOG_EMERGENCY', 0); const WATCHDOG_EMERGENCY = 0;
/** /**
* Log message severity -- Alert: action must be taken immediately. * Log message severity -- Alert: action must be taken immediately.
*/ */
define('WATCHDOG_ALERT', 1); const WATCHDOG_ALERT = 1;
/** /**
* Log message severity -- Critical: critical conditions. * Log message severity -- Critical: critical conditions.
*/ */
define('WATCHDOG_CRITICAL', 2); const WATCHDOG_CRITICAL = 2;
/** /**
* Log message severity -- Error: error conditions. * Log message severity -- Error: error conditions.
*/ */
define('WATCHDOG_ERROR', 3); const WATCHDOG_ERROR = 3;
/** /**
* Log message severity -- Warning: warning conditions. * Log message severity -- Warning: warning conditions.
*/ */
define('WATCHDOG_WARNING', 4); const WATCHDOG_WARNING = 4;
/** /**
* Log message severity -- Notice: normal but significant condition. * Log message severity -- Notice: normal but significant condition.
*/ */
define('WATCHDOG_NOTICE', 5); const WATCHDOG_NOTICE = 5;
/** /**
* Log message severity -- Informational: informational messages. * Log message severity -- Informational: informational messages.
*/ */
define('WATCHDOG_INFO', 6); const WATCHDOG_INFO = 6;
/** /**
* Log message severity -- Debug: debug-level messages. * Log message severity -- Debug: debug-level messages.
*/ */
define('WATCHDOG_DEBUG', 7); const WATCHDOG_DEBUG = 7;
/** /**
* @} End of "defgroup logging_severity_levels". * @} End of "defgroup logging_severity_levels".
...@@ -104,98 +104,98 @@ ...@@ -104,98 +104,98 @@
/** /**
* First bootstrap phase: initialize configuration. * First bootstrap phase: initialize configuration.
*/ */
define('DRUPAL_BOOTSTRAP_CONFIGURATION', 0); const DRUPAL_BOOTSTRAP_CONFIGURATION = 0;
/** /**
* Second bootstrap phase: try to serve a cached page. * Second bootstrap phase: try to serve a cached page.
*/ */
define('DRUPAL_BOOTSTRAP_PAGE_CACHE', 1); const DRUPAL_BOOTSTRAP_PAGE_CACHE = 1;
/** /**
* Third bootstrap phase: initialize database layer. * Third bootstrap phase: initialize database layer.
*/ */
define('DRUPAL_BOOTSTRAP_DATABASE', 2); const DRUPAL_BOOTSTRAP_DATABASE = 2;
/** /**
* Fourth bootstrap phase: initialize the variable system. * Fourth bootstrap phase: initialize the variable system.
*/ */
define('DRUPAL_BOOTSTRAP_VARIABLES', 3); const DRUPAL_BOOTSTRAP_VARIABLES = 3;
/** /**
* Fifth bootstrap phase: initialize session handling. * Fifth bootstrap phase: initialize session handling.
*/ */
define('DRUPAL_BOOTSTRAP_SESSION', 4); const DRUPAL_BOOTSTRAP_SESSION = 4;
/** /**
* Sixth bootstrap phase: set up the page header. * Sixth bootstrap phase: set up the page header.
*/ */
define('DRUPAL_BOOTSTRAP_PAGE_HEADER', 5); const DRUPAL_BOOTSTRAP_PAGE_HEADER = 5;
/** /**
* Seventh bootstrap phase: find out language of the page. * Seventh bootstrap phase: find out language of the page.
*/ */
define('DRUPAL_BOOTSTRAP_LANGUAGE', 6); const DRUPAL_BOOTSTRAP_LANGUAGE = 6;
/** /**
* Final bootstrap phase: Drupal is fully loaded; validate and fix * Final bootstrap phase: Drupal is fully loaded; validate and fix
* input data. * input data.
*/ */
define('DRUPAL_BOOTSTRAP_FULL', 7); const DRUPAL_BOOTSTRAP_FULL = 7;
/** /**
* Role ID for anonymous users; should match what's in the "role" table. * Role ID for anonymous users; should match what's in the "role" table.
*/ */
define('DRUPAL_ANONYMOUS_RID', 1); const DRUPAL_ANONYMOUS_RID = 1;
/** /**
* Role ID for authenticated users; should match what's in the "role" table. * Role ID for authenticated users; should match what's in the "role" table.
*/ */
define('DRUPAL_AUTHENTICATED_RID', 2); const DRUPAL_AUTHENTICATED_RID = 2;
/** /**
* The number of bytes in a kilobyte. For more information, visit * The number of bytes in a kilobyte. For more information, visit
* http://en.wikipedia.org/wiki/Kilobyte. * http://en.wikipedia.org/wiki/Kilobyte.
*/ */
define('DRUPAL_KILOBYTE', 1024); const DRUPAL_KILOBYTE = 1024;
/** /**
* System language (only applicable to UI). * System language (only applicable to UI).
* *
* Refers to the language used in Drupal and module/theme source code. * Refers to the language used in Drupal and module/theme source code.
*/ */
define('LANGUAGE_SYSTEM', 'system'); const LANGUAGE_SYSTEM = 'system';
/** /**
* The language code used when no language is explicitly assigned. * The language code used when no language is explicitly assigned.
* *
* Defined by ISO639-2 for "Undetermined". * Defined by ISO639-2 for "Undetermined".
*/ */
define('LANGUAGE_NONE', 'und'); const LANGUAGE_NONE = 'und';
/** /**
* The type of language used to define the content language. * The type of language used to define the content language.
*/ */
define('LANGUAGE_TYPE_CONTENT', 'language_content'); const LANGUAGE_TYPE_CONTENT = 'language_content';
/** /**
* The type of language used to select the user interface. * The type of language used to select the user interface.
*/ */
define('LANGUAGE_TYPE_INTERFACE', 'language'); const LANGUAGE_TYPE_INTERFACE = 'language';
/** /**
* The type of language used for URLs. * The type of language used for URLs.
*/ */
define('LANGUAGE_TYPE_URL', 'language_url'); const LANGUAGE_TYPE_URL = 'language_url';
/** /**
* Language written left to right. Possible value of $language->direction. * Language written left to right. Possible value of $language->direction.
*/ */
define('LANGUAGE_LTR', 0); const LANGUAGE_LTR = 0;
/** /**
* Language written right to left. Possible value of $language->direction. * Language written right to left. Possible value of $language->direction.
*/ */
define('LANGUAGE_RTL', 1); const LANGUAGE_RTL = 1;
/** /**
* Time of the current request in seconds elapsed since the Unix Epoch. * Time of the current request in seconds elapsed since the Unix Epoch.
...@@ -212,29 +212,29 @@ ...@@ -212,29 +212,29 @@
/** /**
* Flag for drupal_set_title(); text is not sanitized, so run check_plain(). * Flag for drupal_set_title(); text is not sanitized, so run check_plain().
*/ */
define('CHECK_PLAIN', 0); const CHECK_PLAIN = 0;
/** /**
* Flag for drupal_set_title(); text has already been sanitized. * Flag for drupal_set_title(); text has already been sanitized.
*/ */
define('PASS_THROUGH', -1); const PASS_THROUGH = -1;
/** /**
* Signals that the registry lookup cache should be reset. * Signals that the registry lookup cache should be reset.
*/ */
define('REGISTRY_RESET_LOOKUP_CACHE', 1); const REGISTRY_RESET_LOOKUP_CACHE = 1;
/** /**
* Signals that the registry lookup cache should be written to storage. * Signals that the registry lookup cache should be written to storage.
*/ */
define('REGISTRY_WRITE_LOOKUP_CACHE', 2); const REGISTRY_WRITE_LOOKUP_CACHE = 2;
/** /**
* Regular expression to match PHP function names. * Regular expression to match PHP function names.
* *
* @see http://php.net/manual/en/language.functions.php * @see http://php.net/manual/en/language.functions.php
*/ */
define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'); const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
/** /**
* Provides a caching wrapper to be used in place of large array structures. * Provides a caching wrapper to be used in place of large array structures.
......
...@@ -42,59 +42,59 @@ ...@@ -42,59 +42,59 @@
/** /**
* Return status for saving which involved creating a new item. * Return status for saving which involved creating a new item.
*/ */
define('SAVED_NEW', 1); const SAVED_NEW = 1;
/** /**
* Return status for saving which involved an update to an existing item. * Return status for saving which involved an update to an existing item.
*/ */
define('SAVED_UPDATED', 2); const SAVED_UPDATED = 2;
/** /**
* Return status for saving which deleted an existing item. * Return status for saving which deleted an existing item.
*/ */
define('SAVED_DELETED', 3); const SAVED_DELETED = 3;
/** /**
* The default group for system CSS files added to the page. * The default group for system CSS files added to the page.
*/ */
define('CSS_SYSTEM', -100); const CSS_SYSTEM = -100;
/** /**
* The default group for module CSS files added to the page. * The default group for module CSS files added to the page.
*/ */
define('CSS_DEFAULT', 0); const CSS_DEFAULT = 0;
/** /**
* The default group for theme CSS files added to the page. * The default group for theme CSS files added to the page.
*/ */
define('CSS_THEME', 100); const CSS_THEME = 100;
/** /**
* The default group for JavaScript libraries or jQuery plugins added * The default group for JavaScript libraries or jQuery plugins added
* to the page. * to the page.
*/ */
define('JS_LIBRARY', -100); const JS_LIBRARY = -100;
/** /**
* The default group for module JavaScript code added to the page. * The default group for module JavaScript code added to the page.
*/ */
define('JS_DEFAULT', 0); const JS_DEFAULT = 0;
/** /**
* The default group for theme JavaScript code added to the page. * The default group for theme JavaScript code added to the page.
*/ */
define('JS_THEME', 100); const JS_THEME = 100;
/** /**
* The default group for JavaScript settings added to the page. * The default group for JavaScript settings added to the page.
*/ */
define('JS_SETTING', 200); const JS_SETTING = 200;
/** /**
* Error code indicating that the request made by drupal_http_request() exceeded * Error code indicating that the request made by drupal_http_request() exceeded
* the specified timeout. * the specified timeout.
*/ */
define('HTTP_REQUEST_TIMEOUT', -1); const HTTP_REQUEST_TIMEOUT = -1;
/** /**
* Constants defining cache granularity for blocks and renderable arrays. * Constants defining cache granularity for blocks and renderable arrays.
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
* the content. * the content.
* - for blocks that change too frequently. * - for blocks that change too frequently.
*/ */
define('DRUPAL_NO_CACHE', -1); const DRUPAL_NO_CACHE = -1;
/** /**
* The block is handling its own caching in its hook_block_view(). From the * The block is handling its own caching in its hook_block_view(). From the
...@@ -129,31 +129,31 @@ ...@@ -129,31 +129,31 @@
* Useful when time based expiration is needed or a site uses a node access * Useful when time based expiration is needed or a site uses a node access
* which invalidates standard block cache. * which invalidates standard block cache.
*/ */
define('DRUPAL_CACHE_CUSTOM', -2); const DRUPAL_CACHE_CUSTOM = -2;
/** /**
* The block or element can change depending on the roles the user viewing the * The block or element can change depending on the roles the user viewing the
* page belongs to. This is the default setting for blocks, used when the block * page belongs to. This is the default setting for blocks, used when the block
* does not specify anything. * does not specify anything.
*/ */
define('DRUPAL_CACHE_PER_ROLE', 0x0001); const DRUPAL_CACHE_PER_ROLE = 0x0001;
/** /**
* The block or element can change depending on the user viewing the page. * The block or element can change depending on the user viewing the page.
* This setting can be resource-consuming for sites with large number of users, * This setting can be resource-consuming for sites with large number of users,
* and thus should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient. * and thus should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.
*/ */
define('DRUPAL_CACHE_PER_USER', 0x0002); const DRUPAL_CACHE_PER_USER = 0x0002;
/** /**
* The block or element can change depending on the page being viewed. * The block or element can change depending on the page being viewed.
*/ */
define('DRUPAL_CACHE_PER_PAGE', 0x0004); const DRUPAL_CACHE_PER_PAGE = 0x0004;
/** /**
* The block or element is the same for every user on every page where it is visible. * The block or element is the same for every user on every page where it is visible.
*/ */
define('DRUPAL_CACHE_GLOBAL', 0x0008); const DRUPAL_CACHE_GLOBAL = 0x0008;
/** /**
* Add content to a specified region. * Add content to a specified region.
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* The name by which to obtain a lock for retrive the next insert id. * The name by which to obtain a lock for retrive the next insert id.
*/ */
define('POSTGRESQL_NEXTID_LOCK', 1000); const POSTGRESQL_NEXTID_LOCK = 1000;
class DatabaseConnection_pgsql extends DatabaseConnection { class DatabaseConnection_pgsql extends DatabaseConnection {
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
/** /**
* Error reporting level: display no errors. * Error reporting level: display no errors.
*/ */
define('ERROR_REPORTING_HIDE', 0); const ERROR_REPORTING_HIDE = 0;
/** /**
* Error reporting level: display errors and warnings. * Error reporting level: display errors and warnings.
*/ */
define('ERROR_REPORTING_DISPLAY_SOME', 1); const ERROR_REPORTING_DISPLAY_SOME = 1;
/** /**
* Error reporting level: display all messages. * Error reporting level: display all messages.
*/ */
define('ERROR_REPORTING_DISPLAY_ALL', 2); const ERROR_REPORTING_DISPLAY_ALL = 2;
/** /**
* Map PHP error constants to watchdog severity levels. * Map PHP error constants to watchdog severity levels.
......
...@@ -38,27 +38,27 @@ ...@@ -38,27 +38,27 @@
/** /**
* Flag used by file_prepare_directory() -- create directory if not present. * Flag used by file_prepare_directory() -- create directory if not present.
*/ */
define('FILE_CREATE_DIRECTORY', 1); const FILE_CREATE_DIRECTORY = 1;
/** /**
* Flag used by file_prepare_directory() -- file permissions may be changed. * Flag used by file_prepare_directory() -- file permissions may be changed.
*/ */
define('FILE_MODIFY_PERMISSIONS', 2); const FILE_MODIFY_PERMISSIONS = 2;
/** /**
* Flag for dealing with existing files: Appends number until name is unique. * Flag for dealing with existing files: Appends number until name is unique.
*/ */
define('FILE_EXISTS_RENAME', 0); const FILE_EXISTS_RENAME = 0;
/** /**
* Flag for dealing with existing files: Replace the existing file. * Flag for dealing with existing files: Replace the existing file.
*/ */
define('FILE_EXISTS_REPLACE', 1); const FILE_EXISTS_REPLACE = 1;