drupal_current_script_url

drupal_current_script_url($query = array()) Returns the URL of the current script, with modified query parameters. This function can be called by low-level scripts (such as install.php and update.php) and returns the URL of the current script. Existing query parameters are preserved by default, but new ones can optionally be merged in. This function is used when the script must maintain certain query parameters over multiple page requests in order to work correctly. In such cases (for example,

drupal_common_theme

drupal_common_theme() Provides theme registration for themes across .inc files. File core/includes/theme.inc, line 1715 The theme system, which controls the output of Drupal. Code function drupal_common_theme() { return array( // From theme.inc. 'html' => array( 'render element' => 'html', ), 'page' => array( 'render element' => 'page', ), 'page_title' => array( 'variables' => array('title' => NULL), ), 'region' => ar

drupal_clear_js_cache

drupal_clear_js_cache() Deletes old cached JavaScript files and variables. Deprecated in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll(). File core/includes/common.inc, line 740 Common functions that many Drupal modules will need to reference. Code function drupal_clear_js_cache() { \Drupal::service('asset.js.collection_optimizer')->deleteAll(); }

drupal_clear_css_cache

drupal_clear_css_cache() Deletes old cached CSS files. Deprecated in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll(). File core/includes/common.inc, line 423 Common functions that many Drupal modules will need to reference. Code function drupal_clear_css_cache() { \Drupal::service('asset.css.collection_optimizer')->deleteAll(); }

drupal_classloader_register

drupal_classloader_register($name, $path) Registers an additional namespace. Parameters string $name: The namespace component to register; e.g., 'node'. string $path: The relative path to the Drupal component in the filesystem. File core/includes/bootstrap.inc, line 762 Functions that need to be loaded on every Drupal request. Code function drupal_classloader_register($name, $path) { $loader = \Drupal::service('class_loader'); $loader->addPsr4('Drupal\\' . $name . '\\', \Drupal::root(

drupal_chmod

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

drupal_check_profile

drupal_check_profile($profile) Checks an installation profile's requirements. Parameters string $profile: Name of installation profile to check. Return value array Array of the installation profile's requirements. File core/includes/install.inc, line 931 API functions for installing modules and themes. Code function drupal_check_profile($profile) { $info = install_profile_info($profile); // Collect requirement testing results. $requirements = array(); // Performs an ExtensionDiscove

drupal_check_module

drupal_check_module($module) Checks a module's requirements. Parameters $module: Machine name of module to check. Return value TRUE or FALSE, depending on whether the requirements are met. File core/includes/install.inc, line 994 API functions for installing modules and themes. Code function drupal_check_module($module) { module_load_install($module); // Check requirements $requirements = \Drupal::moduleHandler()->invoke($module, 'requirements', array('install')); if (is_array($r

drupal_check_incompatibility

drupal_check_incompatibility($v, $current_version) Checks whether a version is compatible with a given dependency. Parameters $v: A parsed dependency structure e.g. from ModuleHandler::parseDependency(). $current_version: The version to check against (like 4.2). Return value NULL if compatible, otherwise the original dependency version string that caused the incompatibility. See also \Drupal\Core\Extension\ModuleHandler::parseDependency() File core/includes/common.inc, line 1202 Common funct

drupal_basename

drupal_basename($uri, $suffix = NULL) Gets the filename from a given path. Deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::basename(). Related topics File interface Common file handling functions. File core/includes/file.inc, line 1147 API for handling file uploads and server file management. Code function drupal_basename($uri, $suffix = NULL) { return \Drupal::service('file_system')->basename($uri, $suffix); }