summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-05-26 17:12:55 +0000
committerDries Buytaert <dries@buytaert.net>2008-05-26 17:12:55 +0000
commitc529e4afbece1355bee882500faf2fd0c059048a (patch)
treea4fbe98ab46c3ae8f2c9ff6d085cca8eb3c009fe
parent035713ea5c2f2aba2d5f9827dceb7c504c11de2e (diff)
downloadbrdo-c529e4afbece1355bee882500faf2fd0c059048a.tar.gz
brdo-c529e4afbece1355bee882500faf2fd0c059048a.tar.bz2
- Patch #101543 by webchick: document all constants.
-rw-r--r--includes/bootstrap.inc67
-rw-r--r--includes/common.inc4
-rw-r--r--includes/file.inc50
-rw-r--r--includes/install.inc67
-rw-r--r--includes/locale.inc5
-rw-r--r--includes/menu.inc58
-rw-r--r--includes/password.inc6
-rw-r--r--includes/theme.inc17
-rw-r--r--install.php3
-rw-r--r--modules/block/block.module4
-rw-r--r--modules/node/node.module33
-rw-r--r--modules/openid/openid.inc33
-rw-r--r--modules/poll/poll.test8
-rw-r--r--modules/user/user.module7
14 files changed, 322 insertions, 40 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 993b52602..dda784822 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -35,19 +35,68 @@ define('CACHE_NORMAL', 1);
define('CACHE_AGGRESSIVE', 2);
/**
+ * Log message severity -- Emergency: system is unusable.
*
- * Severity levels, as defined in RFC 3164 http://www.faqs.org/rfcs/rfc3164.html
* @see watchdog()
* @see watchdog_severity_levels()
*/
-define('WATCHDOG_EMERG', 0); // Emergency: system is unusable
-define('WATCHDOG_ALERT', 1); // Alert: action must be taken immediately
-define('WATCHDOG_CRITICAL', 2); // Critical: critical conditions
-define('WATCHDOG_ERROR', 3); // Error: error conditions
-define('WATCHDOG_WARNING', 4); // Warning: warning conditions
-define('WATCHDOG_NOTICE', 5); // Notice: normal but significant condition
-define('WATCHDOG_INFO', 6); // Informational: informational messages
-define('WATCHDOG_DEBUG', 7); // Debug: debug-level messages
+define('WATCHDOG_EMERG', 0);
+
+/**
+ * Log message severity -- Alert: action must be taken immediately.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_ALERT', 1);
+
+/**
+ * Log message severity -- Critical: critical conditions.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_CRITICAL', 2);
+
+/**
+ * Log message severity -- Error: error conditions.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_ERROR', 3);
+
+/**
+ * Log message severity -- Warning: warning conditions.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_WARNING', 4);
+
+/**
+ * Log message severity -- Notice: normal but significant condition.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_NOTICE', 5);
+
+/**
+ * Log message severity -- Informational: informational messages.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_INFO', 6);
+
+/**
+ * Log message severity -- Debug: debug-level messages.
+ *
+ * @see watchdog()
+ * @see watchdog_severity_levels()
+ */
+define('WATCHDOG_DEBUG', 7);
/**
* First bootstrap phase: initialize configuration.
diff --git a/includes/common.inc b/includes/common.inc
index 32b290b4e..598849907 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3464,10 +3464,12 @@ function drupal_parse_info_file($filename) {
}
/**
+ * Severity levels, as defined in RFC 3164: http://www.ietf.org/rfc/rfc3164.txt.
+ *
* @return
* Array of the possible severity levels for log messages.
*
- * @see watchdog
+ * @see watchdog()
*/
function watchdog_severity_levels() {
return array(
diff --git a/includes/file.inc b/includes/file.inc
index 0984190ce..a01fad778 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -12,24 +12,62 @@
* Common file handling functions.
*/
+/**
+ * Flag to indicate that the 'public' file download method is enabled.
+ *
+ * When using this method, files are available from a regular HTTP request,
+ * which provides no additional access restrictions.
+ */
define('FILE_DOWNLOADS_PUBLIC', 1);
+
+/**
+ * Flag to indicate that the 'private' file download method is enabled.
+ *
+ * When using this method, all file requests are served by Drupal, during which
+ * access-control checking can be performed.
+ */
define('FILE_DOWNLOADS_PRIVATE', 2);
+
+/**
+ * Flag used by file_create_directory() -- create directory if not present.
+ */
define('FILE_CREATE_DIRECTORY', 1);
+
+/**
+ * Flag used by file_create_directory() -- file permissions may be changed.
+ */
define('FILE_MODIFY_PERMISSIONS', 2);
+
+/**
+ * Flag for dealing with existing files: Append number until filename is unique.
+ */
define('FILE_EXISTS_RENAME', 0);
+
+/**
+ * Flag for dealing with existing files: Replace the existing file.
+ */
define('FILE_EXISTS_REPLACE', 1);
+
+/**
+ * Flag for dealing with existing files: Do nothing and return FALSE.
+ */
define('FILE_EXISTS_ERROR', 2);
/**
- * A files status can be one of two values: temporary or permanent. The status
- * for each file Drupal manages is stored in the {files} tables. If the status
- * is temporary Drupal's file garbage collection will delete the file and
- * remove it from the files table after a set period of time.
+ * File status -- File has been temporarily saved to the {files} tables.
*
- * If you wish to add custom statuses for use by contrib modules please expand as
- * binary flags and consider the first 8 bits reserved. (0,1,2,4,8,16,32,64,128)
+ * Drupal's file garbage collection will delete the file and remove it from the
+ * files table after a set period of time.
*/
define('FILE_STATUS_TEMPORARY', 0);
+
+/**
+ * File status -- File has been permanently saved to the {files} tables.
+ *
+ * If you wish to add custom statuses for use by contrib modules please expand
+ * as binary flags and consider the first 8 bits reserved.
+ * (0,1,2,4,8,16,32,64,128).
+ */
define('FILE_STATUS_PERMANENT', 1);
/**
diff --git a/includes/install.inc b/includes/install.inc
index 54bfd4bc4..fd68ed9ab 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -1,21 +1,74 @@
<?php
// $Id$
+/**
+ * Indicates that a module has not been installed yet.
+ */
define('SCHEMA_UNINSTALLED', -1);
+
+/**
+ * Indicates that a module has been installed.
+ */
define('SCHEMA_INSTALLED', 0);
+/**
+ * Requirement severity -- Informational message only.
+ */
define('REQUIREMENT_INFO', -1);
+
+/**
+ * Requirement severity -- Requirement successfully met.
+ */
define('REQUIREMENT_OK', 0);
+
+/**
+ * Requirement severity -- Warning condition; proceed but flag warning.
+ */
define('REQUIREMENT_WARNING', 1);
+
+/**
+ * Requirement severity -- Error condition; abort installation.
+ */
define('REQUIREMENT_ERROR', 2);
-define('FILE_EXIST', 1);
-define('FILE_READABLE', 2);
-define('FILE_WRITABLE', 4);
-define('FILE_EXECUTABLE', 8);
-define('FILE_NOT_EXIST', 16);
-define('FILE_NOT_READABLE', 32);
-define('FILE_NOT_WRITABLE', 64);
+/**
+ * File permission check -- File exists.
+ */
+define('FILE_EXIST', 1);
+
+/**
+ * File permission check -- File is readable.
+ */
+define('FILE_READABLE', 2);
+
+/**
+ * File permission check -- File is writable.
+ */
+define('FILE_WRITABLE', 4);
+
+/**
+ * File permission check -- File is executable.
+ */
+define('FILE_EXECUTABLE', 8);
+
+/**
+ * File permission check -- File does not exist.
+ */
+define('FILE_NOT_EXIST', 16);
+
+/**
+ * File permission check -- File is not readable.
+ */
+define('FILE_NOT_READABLE', 32);
+
+/**
+ * File permission check -- File is not writable.
+ */
+define('FILE_NOT_WRITABLE', 64);
+
+/**
+ * File permission check -- File is not executable.
+ */
define('FILE_NOT_EXECUTABLE', 128);
/**
diff --git a/includes/locale.inc b/includes/locale.inc
index 9f51306f9..1937bc904 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -3,9 +3,12 @@
/**
* @file
- * Administration functions for locale.module.
+ * Administration functions for locale.module.
*/
+/**
+ * Regular expression pattern used to localize JavaScript strings.
+ */
define('LOCALE_JS_STRING', '(?:(?:\'(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+');
/**
diff --git a/includes/menu.inc b/includes/menu.inc
index 4e20a7e7a..35faf77dd 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -77,12 +77,39 @@
* Flags for use in the "type" attribute of menu items.
*/
+/**
+ * Internal menu flag -- menu item is the root of the menu tree.
+ */
define('MENU_IS_ROOT', 0x0001);
+
+/**
+ * Internal menu flag -- menu item is visible in the menu tree.
+ */
define('MENU_VISIBLE_IN_TREE', 0x0002);
+
+/**
+ * Internal menu flag -- menu item is visible in the breadcrumb.
+ */
define('MENU_VISIBLE_IN_BREADCRUMB', 0x0004);
+
+/**
+ * Internal menu flag -- menu item links back to its parnet.
+ */
define('MENU_LINKS_TO_PARENT', 0x0008);
+
+/**
+ * Internal menu flag -- menu item can be modified by administrator.
+ */
define('MENU_MODIFIED_BY_ADMIN', 0x0020);
+
+/**
+ * Internal menu flag -- menu item was created by administrator.
+ */
define('MENU_CREATED_BY_ADMIN', 0x0040);
+
+/**
+ * Internal menu flag -- menu item is a local task.
+ */
define('MENU_IS_LOCAL_TASK', 0x0080);
/**
@@ -97,6 +124,8 @@ define('MENU_IS_LOCAL_TASK', 0x0080);
*/
/**
+ * Menu type -- A "normal" menu item that's shown in menu and breadcrumbs.
+ *
* Normal menu items show up in the menu tree and can be moved/hidden by
* the administrator. Use this for most menu items. It is the default value if
* no menu item type is specified.
@@ -104,12 +133,16 @@ define('MENU_IS_LOCAL_TASK', 0x0080);
define('MENU_NORMAL_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB);
/**
+ * Menu type -- A hidden, internal callback, typically used for API calls.
+ *
* Callbacks simply register a path so that the correct function is fired
* when the URL is accessed. They are not shown in the menu.
*/
define('MENU_CALLBACK', MENU_VISIBLE_IN_BREADCRUMB);
/**
+ * Menu type -- A normal menu item, hidden until enabled by an administrator.
+ *
* Modules may "suggest" menu items that the administrator may enable. They act
* just as callbacks do until enabled, at which time they act like normal items.
* Note for the value: 0x0010 was a flag which is no longer used, but this way
@@ -118,13 +151,17 @@ define('MENU_CALLBACK', MENU_VISIBLE_IN_BREADCRUMB);
define('MENU_SUGGESTED_ITEM', MENU_VISIBLE_IN_BREADCRUMB | 0x0010);
/**
- * Local tasks are rendered as tabs by default. Use this for menu items that
- * describe actions to be performed on their parent item. An example is the path
- * "node/52/edit", which performs the "edit" task on "node/52".
+ * Menu type -- A task specific to the parent item, usually rendered as a tab.
+ *
+ * Local tasks are menu items that describe actions to be performed on their
+ * parent item. An example is the path "node/52/edit", which performs the
+ * "edit" task on "node/52".
*/
define('MENU_LOCAL_TASK', MENU_IS_LOCAL_TASK);
/**
+ * Menu type -- The "default" local task, which is initially active.
+ *
* Every set of local tasks should provide one "default" task, that links to the
* same path as its parent when clicked.
*/
@@ -140,9 +177,24 @@ define('MENU_DEFAULT_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT);
* Status codes for menu callbacks.
*/
+/**
+ * Internal menu status code -- Menu item was found.
+ */
define('MENU_FOUND', 1);
+
+/**
+ * Internal menu status code -- Menu item was not found.
+ */
define('MENU_NOT_FOUND', 2);
+
+/**
+ * Internal menu status code -- Menu item access is denied.
+ */
define('MENU_ACCESS_DENIED', 3);
+
+/**
+ * Internal menu status code -- Menu item inaccessible because site is offline.
+ */
define('MENU_SITE_OFFLINE', 4);
/**
diff --git a/includes/password.inc b/includes/password.inc
index 6c145cf9e..d5dccc398 100644
--- a/includes/password.inc
+++ b/includes/password.inc
@@ -22,9 +22,13 @@
define('DRUPAL_HASH_COUNT', 14);
/**
- * The min and max allowed log2 number of iterations for password stretching.
+ * The minimum allowed log2 number of iterations for password stretching.
*/
define('DRUPAL_MIN_HASH_COUNT', 7);
+
+/**
+ * The maximum allowed log2 number of iterations for password stretching.
+ */
define('DRUPAL_MAX_HASH_COUNT', 30);
/**
diff --git a/includes/theme.inc b/includes/theme.inc
index 15d4429e0..07ec0786b 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -18,9 +18,22 @@
* Markers used by theme_mark() and node_mark() to designate content.
* @see theme_mark(), node_mark()
*/
-define('MARK_READ', 0);
-define('MARK_NEW', 1);
+
+/**
+ * Mark content as read.
+ */
+define('MARK_READ', 0);
+
+/**
+ * Mark content as being new.
+ */
+define('MARK_NEW', 1);
+
+/**
+ * Mark content as being updated.
+ */
define('MARK_UPDATED', 2);
+
/**
* @} End of "Content markers".
*/
diff --git a/install.php b/install.php
index 902fe2b8f..ab980c3e5 100644
--- a/install.php
+++ b/install.php
@@ -3,6 +3,9 @@
require_once './includes/install.inc';
+/**
+ * Global flag to indicate that site is in installation mode.
+ */
define('MAINTENANCE_MODE', 'install');
/**
diff --git a/modules/block/block.module b/modules/block/block.module
index c2e29f078..1d32f62d9 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -6,7 +6,9 @@
* Controls the boxes that are displayed around the main content.
*/
-// Denotes that a block is not enabled in any region and should not be shown.
+/**
+ * Denotes that a block is not enabled in any region and should not be shown.
+ */
define('BLOCK_REGION_NONE', -1);
/**
diff --git a/modules/node/node.module b/modules/node/node.module
index 1003ebde5..9a64948cf 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -3,17 +3,46 @@
/**
* @file
- * The core that allows content to be submitted to the site. Modules and scripts may
- * programmatically submit nodes using the usual form API pattern.
+ * The core that allows content to be submitted to the site. Modules and
+ * scripts may programmatically submit nodes using the usual form API pattern.
*/
+/**
+ * Nodes changed before this time are always marked as read.
+ *
+ * Nodes changed after this time may be marked new, updated, or read, depending
+ * on their state for the current user. Defaults to 30 days ago.
+ */
define('NODE_NEW_LIMIT', time() - 30 * 24 * 60 * 60);
+/**
+ * Node is being built before being viewed normally.
+ */
define('NODE_BUILD_NORMAL', 0);
+
+/**
+ * Node is being built before being previewed.
+ */
define('NODE_BUILD_PREVIEW', 1);
+
+/**
+ * Node is being built before being indexed by search module.
+ */
define('NODE_BUILD_SEARCH_INDEX', 2);
+
+/**
+ * Node is being built before being displayed as a search result.
+ */
define('NODE_BUILD_SEARCH_RESULT', 3);
+
+/**
+ * Node is being built before being displayed as part of an RSS feed.
+ */
define('NODE_BUILD_RSS', 4);
+
+/**
+ * Node is being built before being printed.
+ */
define('NODE_BUILD_PRINT', 5);
/**
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index c39cd8e40..452a9aded 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -6,21 +6,48 @@
* OpenID utility functions.
*/
-// Diffie-Hellman Key Exchange Default Value.
+/**
+ * Diffie-Hellman Key Exchange Default Value.
+ *
+ * This is used to establish an association between the Relying Party and the
+ * OpenID Provider.
+ *
+ * See RFC 2631: http://www.ietf.org/rfc/rfc2631.txt
+ */
define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801' .
'966915404479707795314057629378541917580651227423698188993727816152646631' .
'438561595825688188889951272158842675419950341258706556549803580104870537' .
'681476726513255747040765857479291291572334510643245094715007229621094194' .
'349783925984760375594985848253359305585439638443');
-// Constants for Diffie-Hellman key exchange computations.
+/**
+ * Diffie-Hellman generator; used for Diffie-Hellman key exchange computations.
+ */
define('OPENID_DH_DEFAULT_GEN', '2');
+
+/**
+ * SHA-1 hash block size; used for Diffie-Hellman key exchange computations.
+ */
define('OPENID_SHA1_BLOCKSIZE', 64);
+
+/**
+ * Random number generator; used for Diffie-Hellman key exchange computations.
+ */
define('OPENID_RAND_SOURCE', '/dev/urandom');
-// OpenID namespace URLs
+/**
+ * OpenID Authentication 2.0 namespace URL.
+ */
define('OPENID_NS_2_0', 'http://specs.openid.net/auth/2.0');
+
+/**
+ * OpenID Authentication 1.1 namespace URL; used for backwards-compatibility.
+ */
define('OPENID_NS_1_1', 'http://openid.net/signon/1.1');
+
+/**
+ * OpenID Authentication 1.0 namespace URL; used for backwards-compatibility.
+ */
define('OPENID_NS_1_0', 'http://openid.net/signon/1.0');
/**
diff --git a/modules/poll/poll.test b/modules/poll/poll.test
index 4939f0007..69865b7d1 100644
--- a/modules/poll/poll.test
+++ b/modules/poll/poll.test
@@ -19,7 +19,7 @@ class PollTestCase extends DrupalWebTestCase {
// Get the form first to initialize the state of the internal browser
$this->drupalGet('node/add/poll');
-
+
// Prepare a form with two choices
list($edit, $index) = $this->_pollGenerateEdit($title, $choices);
@@ -53,7 +53,7 @@ class PollTestCase extends DrupalWebTestCase {
$max_new_choices = $index == 0 ? 2 : 5;
$already_submitted_choices = array_slice($choices, 0, $index);
$new_choices = array_values(array_slice($choices, $index, $max_new_choices));
-
+
$edit = array(
'title' => $title
);
@@ -65,7 +65,7 @@ class PollTestCase extends DrupalWebTestCase {
}
return array($edit, count($already_submitted_choices) + count($new_choices));
}
-
+
function _generateChoices($count = 7) {
$choices = array();
for($i = 1; $i <= $count; $i++) {
@@ -119,7 +119,7 @@ class PollVoteTestCase extends PollTestCase {
$web_user = $this->drupalCreateUser(array('cancel own vote', 'inspect all votes', 'vote on polls', 'access content'));
$this->drupalLogin($web_user);
-
+
// Record a vote for the first choice.
$edit = array (
'choice' => '1',
diff --git a/modules/user/user.module b/modules/user/user.module
index 238fd9c23..18f3dbe01 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -6,7 +6,14 @@
* Enables the user registration and login system.
*/
+/**
+ * Maximum length of username text field.
+ */
define('USERNAME_MAX_LENGTH', 60);
+
+/**
+ * Maximum length of user e-mail text field.
+ */
define('EMAIL_MAX_LENGTH', 64);
/**