Functions - 8.9.x - drupal

Primary tabs

Title Deprecated File name Summary Direct uses Strings
demo_umami_toolbar core/profiles/demo_umami/demo_umami.profile Implements hook_toolbar().
deprecation_test_deprecated_alter_alter core/modules/system/tests/modules/deprecation_test/deprecation_test.module Implements hook_deprecated_alter_alter().
deprecation_test_deprecated_hook core/modules/system/tests/modules/deprecation_test/deprecation_test.module Implements hook_deprecated_hook().
deprecation_test_function

in drupal:8.4.0 and is removed from drupal:9.0.0. This is the deprecation message for deprecated_test_function().

core/modules/system/tests/modules/deprecation_test/deprecation_test.module A deprecated function. 4
drupal_attach_tabledrag core/includes/common.inc Assists in attaching the tableDrag JavaScript behavior to a themed table. 3
drupal_basename

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::basename().

core/includes/file.inc Gets the filename from a given path. 1
drupal_check_incompatibility

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Extension\Dependency::isCompatible() instead.

core/includes/common.inc Checks whether a version is compatible with a given dependency. 1
drupal_check_module core/includes/install.inc Checks a module's requirements. 1
drupal_check_profile core/includes/install.inc Checks an installation profile's requirements. 1
drupal_chmod

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::chmod().

core/includes/file.inc Sets the permissions on a file or directory. 1
drupal_classloader_register

in drupal:8.8.0 and is removed from drupal:9.0.0. Use the class loader as injected service instance to register the namespace:

$this->classLoader
    ->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');

or the following code if the service cannot be injected:

\Drupal::service('class_loader')->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');
core/includes/bootstrap.inc Registers an additional namespace. 1
drupal_clear_css_cache

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll().

core/includes/common.inc Deletes old cached CSS files.
drupal_clear_js_cache

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll().

core/includes/common.inc Deletes old cached JavaScript files and variables.
drupal_common_theme core/includes/theme.inc Provides theme registration for themes across .inc files. 1
drupal_current_script_url core/includes/install.inc Returns the URL of the current script, with modified query parameters. 1
drupal_detect_database_types core/includes/install.inc Detects all supported databases that are compiled into PHP. 1
drupal_dirname

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::dirname().

core/includes/file.inc Gets the name of the directory from a given path. 1
drupal_error_levels core/includes/errors.inc Maps PHP error constants to watchdog severity levels. 1
drupal_find_theme_functions core/includes/theme.inc Allows themes and/or theme engines to discover overridden theme functions. 2
drupal_find_theme_templates core/includes/theme.inc Allows themes and/or theme engines to easily discover overridden templates. 4
drupal_flush_all_caches core/includes/common.inc Flushes all persistent caches, resets all variables, and rebuilds all data structures. 16 1
drupal_generate_test_ua core/includes/bootstrap.inc Generates a user agent string with a HMAC and timestamp for simpletest. 11
drupal_get_database_types core/includes/install.inc Returns all supported database driver installer objects. 11
drupal_get_destination

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the redirect.destination service.

core/includes/common.inc Prepares a 'destination' URL query parameter.
drupal_get_filename core/includes/bootstrap.inc Returns and optionally sets the filename for a system resource. 12
drupal_get_filetransfer_info core/includes/common.inc Assembles the Drupal FileTransfer registry. 2
drupal_get_installed_schema_version core/includes/schema.inc Returns the currently installed schema version for a module. 27 2
drupal_get_messages

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Messenger\MessengerInterface::all() or \Drupal\Core\Messenger\MessengerInterface::messagesByType() instead.

core/includes/bootstrap.inc Returns all messages that have been set with drupal_set_message(). 1
drupal_get_module_schema core/includes/schema.inc Returns a module's schema. 14
drupal_get_path core/includes/bootstrap.inc Returns the path to a system item (module, theme, etc.). 113 1
drupal_get_profile

in drupal:8.3.0 and is removed from drupal:9.0.0. Use the install_profile container parameter or \Drupal::installProfile() instead. If you are accessing the value before it is written to configuration during the installer use the $install_state global. If you need to access the value before container is available you can use BootstrapConfigStorageFactory to load the value directly from configuration.

core/includes/bootstrap.inc Gets the name of the currently active installation profile. 1
drupal_get_schema_versions core/includes/schema.inc Returns an array of available schema versions for a module. 6
drupal_get_updaters core/includes/common.inc Assembles the Drupal Updater registry. 6
drupal_get_user_timezone

in drupal:8.8.0 and is removed from drupal:9.0.0. Use date_default_timezone_get() instead.

core/includes/bootstrap.inc Returns the time zone of the current user. 1
drupal_http_header_attributes

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Render\HtmlResponseAttachmentsProcessor::formatHttpHeaderAttributes() instead.

core/includes/common.inc Formats an attribute string for an HTTP header. 1
drupal_installation_attempted

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Installer\InstallerKernel::installationAttempted() instead.

core/includes/bootstrap.inc Returns TRUE if a Drupal installation is currently being attempted. 1
drupal_install_config_directories

in drupal:8.8.0 and is removed from drupal:9.0.0. There is no replacement.

core/includes/install.inc Creates the config directory and ensures it is operational.
drupal_install_fix_file core/includes/install.inc Attempts to fix file permissions. 1
drupal_install_mkdir core/includes/install.inc Creates a directory with the specified permissions. 1
drupal_install_profile_distribution_name core/includes/install.inc Loads the installation profile, extracting its defined distribution name. 11 1
drupal_install_profile_distribution_version core/includes/install.inc Loads the installation profile, extracting its defined version. 1
drupal_install_schema core/includes/schema.inc Creates all tables defined in a module's hook_schema(). 1
drupal_install_system core/includes/install.inc Installs the system module. 1
drupal_js_defaults core/includes/common.inc Constructs an array of the defaults that are used for JavaScript assets.
drupal_load_updates core/includes/install.inc Loads .install files for installed modules to initialize the update system. 2
drupal_maintenance_theme core/includes/bootstrap.inc Enables use of the theme system without requiring database access. 7
drupal_migrate_post_update_clear_migrate_field_plugin_cache core/modules/migrate_drupal/migrate_drupal.post_update.php Force MigrateField plugin definitions to be cleared.
drupal_mkdir

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::mkdir().

core/includes/file.inc Creates a directory, optionally creating missing components in the path to the directory. 1
drupal_move_uploaded_file

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::moveUploadedFile().

core/includes/file.inc Moves an uploaded file to a new location. 1
drupal_phpunit_contrib_extension_directory_roots core/tests/bootstrap.php Returns directories under which contributed extensions may exist. 2

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.