drupal_static_reset

drupal_static_reset($name = NULL) Resets one or all centrally stored static variable(s). Parameters $name: Name of the static variable to reset. Omit to reset all variables. Resetting all variables should only be used, for example, for running unit tests with a clean environment. File core/includes/bootstrap.inc, line 920 Functions that need to be loaded on every Drupal request. Code function drupal_static_reset($name = NULL) { drupal_static($name, NULL, TRUE); }

drupal_static

&drupal_static($name, $default_value = NULL, $reset = FALSE) Provides central static variable storage. All functions requiring a static variable to persist or cache data within a single page request are encouraged to use this function unless it is absolutely certain that the static variable will not need to be reset during the page request. By centralizing static variable storage through this function, other functions can rely on a consistent API for resetting any other function's static va

drupal_set_time_limit

drupal_set_time_limit($time_limit) Attempts to set the PHP maximum execution time. This function is a wrapper around the PHP function set_time_limit(). When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out. If the current time limit is not unlimited it is possible to decrease the

drupal_set_message

drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) Sets a message to display to the user. Messages are stored in a session variable and displayed in the page template via the $messages theme variable. Example usage: drupal_set_message(t('An error occurred and processing did not complete.'), 'error'); Parameters string|\Drupal\Component\Render\MarkupInterface $message: (optional) The translated message to be displayed to the user. For consistency with other messages, it sho

drupal_set_installed_schema_version

drupal_set_installed_schema_version($module, $version) Updates the installed version information for a module. Parameters string $module: A module name. string $version: The new schema version. Related topics Schema API API to handle database schemas. File core/includes/schema.inc, line 105 Schema API handling functions. Code function drupal_set_installed_schema_version($module, $version) { \Drupal::keyValue('system.schema')->set($module, $version); // Reset the static cache of modu

drupal_schema_get_field_value

drupal_schema_get_field_value(array $info, $value) Typecasts values to proper datatypes. MySQL PDO silently casts, e.g. FALSE and '' to 0, when inserting the value into an integer column, but PostgreSQL PDO does not. Look up the schema information and use that to correctly typecast the value. Parameters array $info: An array describing the schema field info. mixed $value: The value to be converted. Return value mixed The converted value. Related topics Schema API API to handle database schema

drupal_rmdir

drupal_rmdir($uri, $context = NULL) Removes a directory. Deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::rmdir(). Related topics File interface Common file handling functions. File core/includes/file.inc, line 1168 API for handling file uploads and server file management. Code function drupal_rmdir($uri, $context = NULL) { return \Drupal::service('file_system')->rmdir($uri, $context); }

drupal_rewrite_settings

drupal_rewrite_settings($settings = array(), $settings_file = NULL) Replaces values in settings.php with values in the submitted array. This function replaces values in place if possible, even for multidimensional arrays. This way the old settings do not linger, overridden and also the doxygen on a value remains where it should be. Parameters $settings: An array of settings that need to be updated. Multidimensional arrays are dumped up to a stdClass object. The object can have value, required

drupal_requirements_url

drupal_requirements_url($severity) Returns a URL for proceeding to the next page after a requirements problem. This function can be called by low-level scripts (such as install.php and update.php) and returns a URL that can be used to attempt to proceed to the next step of the script. Parameters $severity: The severity of the requirements problem, as returned by drupal_requirements_severity(). Return value A URL for attempting to proceed to the next step of the script. The URL is not sanitize

drupal_requirements_severity

drupal_requirements_severity(&$requirements) Extracts the highest severity from the requirements array. Parameters $requirements: An array of requirements, in the same format as is returned by hook_requirements(). Return value The highest severity in the array. File core/includes/install.inc, line 975 API functions for installing modules and themes. Code function drupal_requirements_severity(&$requirements) { $severity = REQUIREMENT_OK; foreach ($requirements as $requirement) {