diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-30 08:16:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-30 08:16:55 +0000 |
commit | 949ccddb91397c263a79e8dc144c172baa41452f (patch) | |
tree | 1d63c72055cc55c9fd7d3875506f2ad5144d0c77 | |
parent | 682b9dc3bb3a7d159570154f35476261f49c2e24 (diff) | |
download | brdo-949ccddb91397c263a79e8dc144c172baa41452f.tar.gz brdo-949ccddb91397c263a79e8dc144c172baa41452f.tar.bz2 |
- Patch #666024 by boombatower, mcrittenden: code and documentation clean-ups.
-rw-r--r-- | includes/ajax.inc | 4 | ||||
-rw-r--r-- | includes/authorize.inc | 4 | ||||
-rw-r--r-- | includes/batch.inc | 2 | ||||
-rw-r--r-- | includes/bootstrap.inc | 5 | ||||
-rw-r--r-- | includes/cache-install.inc | 19 | ||||
-rw-r--r-- | includes/cache.inc | 40 | ||||
-rw-r--r-- | includes/file.inc | 52 | ||||
-rw-r--r-- | includes/session.inc | 6 |
8 files changed, 72 insertions, 60 deletions
diff --git a/includes/ajax.inc b/includes/ajax.inc index 248ce39a9..8a2c4b07b 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -328,7 +328,7 @@ function ajax_deliver($page_callback_result) { } elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax_commands')) { // Complex AJAX callbacks can return a result that contains a specific - // set of commands to send to the browser. + // set of commands to send to the browser. if (isset($page_callback_result['#ajax_commands'])) { $commands = $page_callback_result['#ajax_commands']; } @@ -792,7 +792,7 @@ function ajax_command_settings($argument) { * The name or key (in the key value pair) of the data attached to this * selector. * @param $value - * The value of the data. Not just limited to strings can be any format. + * The value of the data. Not just limited to strings can be any format. * * @return * An array suitable for use with the ajax_render() function. diff --git a/includes/authorize.inc b/includes/authorize.inc index 772481b2d..28d475add 100644 --- a/includes/authorize.inc +++ b/includes/authorize.inc @@ -19,7 +19,7 @@ function authorize_filetransfer_form($form_state) { // CSS we depend on lives in modules/system/maintenance.css, which is loaded // via the default maintenance theme. $form['#attached']['js'][] = $base_url . '/misc/authorize.js'; - + // Get all the available ways to transfer files. if (empty($_SESSION['authorize_filetransfer_backends'])) { drupal_set_message(t('Unable to continue, no available methods of file transfer'), 'error'); @@ -182,7 +182,7 @@ function authorize_filetransfer_form_submit($form, &$form_state) { variable_set('authorize_filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings); $filetransfer = authorize_get_filetransfer($filetransfer_backend, $form_state['values']['connection_settings'][$filetransfer_backend]); - + // Now run the operation. authorize_run_operation($filetransfer); } diff --git a/includes/batch.inc b/includes/batch.inc index 4b3e0f365..c0a7c96e0 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -144,7 +144,7 @@ function _batch_progress_page_js() { } /** - * Do one pass of execution in JavaScript-mode and return progress to the browser. + * Do one execution pass in JavaScript-mode and return progress to the browser. * * @see _batch_progress_page_js() * @see _batch_process() diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index b9bf2d6d0..5b424829e 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -37,8 +37,9 @@ define('DRUPAL_MINIMUM_MYSQL', '5.0'); define('DRUPAL_MINIMUM_PGSQL', '8.3'); /** - * Indicates that the item should never be removed unless explicitly told to - * using cache_clear_all() with a cache ID. + * Indicates that the item should never be removed unless explicitly selected. + * + * The item may be removed using cache_clear_all() with a cache ID. */ define('CACHE_PERMANENT', 0); diff --git a/includes/cache-install.inc b/includes/cache-install.inc index 56bf3eb52..e0772bea7 100644 --- a/includes/cache-install.inc +++ b/includes/cache-install.inc @@ -2,13 +2,18 @@ // $Id$ /** - * A stub cache implementation to be used during the installation - * process when database access is not yet available. Because Drupal's - * caching system never requires that cached data be present, these - * stub functions can short-circuit the process and sidestep the - * need for any persistent storage. Obviously, using this cache - * implementation during normal operations would have a negative impact - * on performance. + * @file + * Provides a stub cache implementation to be used during installation. + */ + +/** + * A stub cache implementation to be used during the installation process. + * + * The stub implementation is needed when database access is not yet available. + * Because Drupal's caching system never requires that cached data be present, + * these stub functions can short-circuit the process and sidestep the need for + * any persistent storage. Obviously, using this cache implementation during + * normal operations would have a negative impact on performance. */ class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface { function get($cid) { diff --git a/includes/cache.inc b/includes/cache.inc index 7ebfb380e..cbefdd2a3 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -30,9 +30,10 @@ function _cache_get_object($bin) { } /** - * Return data from the persistent cache. Data may be stored as either plain - * text or as serialized data. cache_get will automatically return - * unserialized objects and arrays. + * Return data from the persistent cache + * + * Data may be stored as either plain text or as serialized data. cache_get + * will automatically return unserialized objects and arrays. * * @param $cid * The cache ID of the data to retrieve. @@ -42,7 +43,8 @@ function _cache_get_object($bin) { * 'cache_menu', 'cache_page', 'cache_path', 'cache_update' or 'cache' for * the default cache. * - * @return The cache or FALSE on failure. + * @return + * The cache or FALSE on failure. */ function cache_get($cid, $bin = 'cache') { return _cache_get_object($bin)->get($cid); @@ -107,10 +109,10 @@ function cache_get_multiple(array &$cids, $bin = 'cache') { * * - smaller bins mean smaller database tables and allow for faster selects and * inserts - * - we try to put fast changing cache items and rather static ones into different - * bins. The effect is that only the fast changing bins will need a lot of - * writes to disk. The more static bins will also be better cacheable with - * MySQL's query cache. + * - we try to put fast changing cache items and rather static ones into + * different bins. The effect is that only the fast changing bins will need a + * lot of writes to disk. The more static bins will also be better cacheable + * with MySQL's query cache. * * @param $cid * The cache ID of the data to store. @@ -188,21 +190,22 @@ function cache_is_empty($bin) { /** * Interface for cache implementations. * - * All cache implementations have to implement this interface. DrupalDatabaseCache - * provides the default implementation, which can be consulted as an example. + * All cache implementations have to implement this interface. + * DrupalDatabaseCache provides the default implementation, which can be + * consulted as an example. * * To make Drupal use your implementation for a certain cache bin, you have to - * set a variable with the name of the cache bin as its key and the name of your - * class as its value. For example, if your implementation of DrupalCacheInterface - * was called MyCustomCache, the following line would make Drupal use it for the - * 'cache_page' bin: + * set a variable with the name of the cache bin as its key and the name of + * your class as its value. For example, if your implementation of + * DrupalCacheInterface was called MyCustomCache, the following line would make + * Drupal use it for the 'cache_page' bin: * @code * variable_set('cache_page', 'MyCustomCache'); * @endcode * - * Additionally, you can register your cache implementation to be used by default - * for all cache bins by setting the variable 'cache_default_class' to the name - * of your implementation of the DrupalCacheInterface, e.g. + * Additionally, you can register your cache implementation to be used by + * default for all cache bins by setting the variable 'cache_default_class' to + * the name of your implementation of the DrupalCacheInterface, e.g. * @code * variable_set('cache_default_class', 'MyCustomCache'); * @endcode @@ -226,7 +229,8 @@ interface DrupalCacheInterface { * * @param $cid * The cache ID of the data to retrieve. - * @return The cache or FALSE on failure. + * @return + * The cache or FALSE on failure. */ function get($cid); diff --git a/includes/file.inc b/includes/file.inc index e8c3d90fc..b60e826ae 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -7,6 +7,8 @@ */ /** + * Manually include stream wrapper code. + * * Stream wrapper code is included here because there are cases where * File API is needed before a bootstrap, or in an alternate order (e.g. * maintenance theme). @@ -60,10 +62,11 @@ define('FILE_EXISTS_REPLACE', 1); define('FILE_EXISTS_ERROR', 2); /** - * File status -- This bit in the status indicates that the file is permanent - * and should not be deleted during file garbage collection process. Temporary - * files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during cron - * runs. + * Indicates that the file is permanent and should not be deleted. + * + * Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed + * during cron runs, but permanent files will not be removed during the file + * garbage collection process. */ define('FILE_STATUS_PERMANENT', 1); @@ -227,7 +230,7 @@ function file_stream_wrapper_uri_normalize($uri) { } /** - * Returns a reference to the stream wrapper class responsible for a given URI (stream). + * Returns a reference to the stream wrapper class responsible for a given URI. * * The scheme determines the stream wrapper class that should be * used by consulting the stream wrapper registry. @@ -438,7 +441,7 @@ function file_create_htaccess($directory, $private = TRUE) { * should be supplied in the form array('field_name' => 'field_value'). * * @return - * An array of file objects, indexed by fid. + * An array of file objects, indexed by fid. * * @see hook_file_load() * @see file_load() @@ -451,7 +454,7 @@ function file_load_multiple($fids = array(), $conditions = array()) { * Load a file object from the database. * * @param $fid - * A file ID. + * A file ID. * @return * A file object. * @@ -562,8 +565,7 @@ function file_copy(stdClass $source, $destination = NULL, $replace = FILE_EXISTS } /** - * Copy a file to a new location without calling any hooks or making any - * changes to the database. + * Copy a file to a new location without invoking the file API. * * This is a powerful function that in many ways performs like an advanced * version of copy(). @@ -1357,8 +1359,7 @@ function file_validate_is_image(stdClass $file) { } /** - * If the file is an image verify that its dimensions are within the specified - * maximum and minimum dimensions. + * Verify that image dimensions are within the specified maximum and minimum. * * Non-image files will be ignored. If a image toolkit is available the image * will be scalled to fit within the desired maximum dimensions. @@ -1469,8 +1470,7 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM } /** - * Save a string to the specified destination without calling any hooks or - * making any changes to the database. + * Save a string to the specified destination without invoking file API. * * This function is identical to file_save_data() except the file will not be * saved to the {file} table and none of the file_* hooks will be called. @@ -1505,8 +1505,9 @@ function file_unmanaged_save_data($data, $destination = NULL, $replace = FILE_EX } /** - * Transfer file using HTTP to client. Pipes a file through Drupal to the - * client. + * Transfer file using HTTP to client. + * + * Pipes a file through Drupal to the client. * * @param $uri * String specifying the file URI to transfer. @@ -1721,15 +1722,16 @@ function file_get_mimetype($uri, $mapping = NULL) { * Set the permissions on a file or directory. * * This function will use the 'file_chmod_directory' and 'file_chmod_file' - * variables for the default modes for directories and uploaded/generated files. - * By default these will give everyone read access so that users accessing the - * files with a user account without the webserver group (e.g. via FTP) can read - * these files, and give group write permissions so webserver group members - * (e.g. a vhost account) can alter files uploaded and owned by the webserver. + * variables for the default modes for directories and uploaded/generated + * files. By default these will give everyone read access so that users + * accessing the files with a user account without the webserver group (e.g. + * via FTP) can read these files, and give group write permissions so webserver + * group members (e.g. a vhost account) can alter files uploaded and owned by + * the webserver. * - * PHP's chmod does not support stream wrappers so we use our wrapper implementation - * which interfaces with chmod() by default. Contrib wrappers may override this - * bahavior in their implementations as needed. + * PHP's chmod does not support stream wrappers so we use our wrapper + * implementation which interfaces with chmod() by default. Contrib wrappers + * may override this bahavior in their implementations as needed. * * @param $uri * A string containing a URI file, or directory path. @@ -1823,7 +1825,7 @@ function drupal_realpath($uri) { * @ingroup php_wrappers */ function drupal_dirname($uri) { - $scheme = file_uri_scheme($uri); + $scheme = file_uri_scheme($uri); if ($scheme && file_stream_wrapper_valid_scheme($scheme)) { $target = file_uri_target($uri); @@ -1899,7 +1901,7 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) { * @ingroup php_wrappers */ function drupal_tempnam($directory, $prefix) { - $scheme = file_uri_scheme($directory); + $scheme = file_uri_scheme($directory); if ($scheme && file_stream_wrapper_valid_scheme($scheme)) { $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme); diff --git a/includes/session.inc b/includes/session.inc index beab9601b..2aeb8eee5 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -314,7 +314,7 @@ function drupal_session_regenerate() { * * Cleanup a specific session. * - * @param string $sid + * @param $sid * Session ID. */ function _drupal_session_destroy($sid) { @@ -356,7 +356,7 @@ function _drupal_session_delete_cookie($name, $force_insecure = FALSE) { /** * End a specific user's session(s). * - * @param string $uid + * @param $uid * User ID. */ function drupal_session_destroy_uid($uid) { @@ -370,7 +370,7 @@ function drupal_session_destroy_uid($uid) { * * Cleanup stalled sessions. * - * @param int $lifetime + * @param $lifetime * The value of session.gc_maxlifetime, passed by PHP. * Sessions not updated for more than $lifetime seconds will be removed. */ |