\

Namespaces

Drupflare

Constants

BLOCK_CUSTOM_DISABLED

BLOCK_CUSTOM_DISABLED = 2

BLOCK_CUSTOM_ENABLED

BLOCK_CUSTOM_ENABLED = 1

BLOCK_CUSTOM_FIXED

BLOCK_CUSTOM_FIXED = 0

BLOCK_REGION_NONE

BLOCK_REGION_NONE = -1

BLOCK_VISIBILITY_LISTED

BLOCK_VISIBILITY_LISTED = 1

BLOCK_VISIBILITY_NOTLISTED

BLOCK_VISIBILITY_NOTLISTED = 0

BLOCK_VISIBILITY_PHP

BLOCK_VISIBILITY_PHP = 2

CACHE_PERMANENT

CACHE_PERMANENT = \Drupal\Core\Cache\CacheBackendInterface::CACHE_PERMANENT

CACHE_TEMPORARY

CACHE_TEMPORARY = \Drupal\Core\Cache\CacheBackendInterface::CACHE_PERMANENT - 1

CHECK_PLAIN

CHECK_PLAIN = 0

COMMENT_ANONYMOUS_MAY_CONTACT

COMMENT_ANONYMOUS_MAY_CONTACT = 1

COMMENT_ANONYMOUS_MAYNOT_CONTACT

COMMENT_ANONYMOUS_MAYNOT_CONTACT = 0

COMMENT_ANONYMOUS_MUST_CONTACT

COMMENT_ANONYMOUS_MUST_CONTACT = 2

COMMENT_FORM_BELOW

COMMENT_FORM_BELOW = 1

COMMENT_FORM_SEPARATE_PAGE

COMMENT_FORM_SEPARATE_PAGE = 0

COMMENT_MODE_FLAT

COMMENT_MODE_FLAT = 0

COMMENT_MODE_THREADED

COMMENT_MODE_THREADED = 1

COMMENT_NODE_CLOSED

COMMENT_NODE_CLOSED = 1

COMMENT_NODE_HIDDEN

COMMENT_NODE_HIDDEN = 0

COMMENT_NODE_OPEN

COMMENT_NODE_OPEN = 2

COMMENT_NOT_PUBLISHED

COMMENT_NOT_PUBLISHED = 0

COMMENT_PUBLISHED

COMMENT_PUBLISHED = 1

CSS_DEFAULT

CSS_DEFAULT = 0

CSS_SYSTEM

CSS_SYSTEM = -100

DRUPAL_ANONYMOUS_RID

DRUPAL_ANONYMOUS_RID = 'anonymous'

DRUPAL_AUTHENTICATED_RID

DRUPAL_AUTHENTICATED_RID = 'authenticated'

DRUPAL_BOOTSTRAP_FULL

DRUPAL_BOOTSTRAP_FULL = 7

DRUPAL_CACHE_CUSTOM

DRUPAL_CACHE_CUSTOM = -2

DRUPAL_CACHE_GLOBAL

DRUPAL_CACHE_GLOBAL = 0x8

DRUPAL_CACHE_PER_PAGE

DRUPAL_CACHE_PER_PAGE = 0x4

DRUPAL_CACHE_PER_ROLE

DRUPAL_CACHE_PER_ROLE = 0x1

DRUPAL_CACHE_PER_USER

DRUPAL_CACHE_PER_USER = 0x2

DRUPAL_CORE_COMPATIBILITY

DRUPAL_CORE_COMPATIBILITY = '7.x'

DRUPAL_MINIMUM_PHP

DRUPAL_MINIMUM_PHP = '5.2.4'

DRUPAL_NO_CACHE

DRUPAL_NO_CACHE = -1

FIELD_BEHAVIOR_CUSTOM

FIELD_BEHAVIOR_CUSTOM = 0x4

FIELD_BEHAVIOR_DEFAULT

FIELD_BEHAVIOR_DEFAULT = 0x2

FIELD_BEHAVIOR_NONE

FIELD_BEHAVIOR_NONE = 0x1

FIELD_CARDINALITY_UNLIMITED

FIELD_CARDINALITY_UNLIMITED = \Drupal\Core\Field\FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED

FIELD_LOAD_CURRENT

FIELD_LOAD_CURRENT = 'FIELD_LOAD_CURRENT'

FIELD_LOAD_REVISION

FIELD_LOAD_REVISION = 'FIELD_LOAD_REVISION'

FILE_CREATE_DIRECTORY

FILE_CREATE_DIRECTORY = \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY

FILE_EXISTS_ERROR

FILE_EXISTS_ERROR = 2

FILE_EXISTS_RENAME

FILE_EXISTS_RENAME = 0

FILE_EXISTS_REPLACE

FILE_EXISTS_REPLACE = 1

FILE_INSECURE_EXTENSIONS

FILE_INSECURE_EXTENSIONS = \implode('|', \Drupal\Core\File\FileSystemInterface::INSECURE_EXTENSIONS)

FILE_MODIFY_PERMISSIONS

FILE_MODIFY_PERMISSIONS = \Drupal\Core\File\FileSystemInterface::MODIFY_PERMISSIONS

FILE_STATUS_PERMANENT

FILE_STATUS_PERMANENT = 1

IMAGE_STORAGE_DEFAULT

IMAGE_STORAGE_DEFAULT = 4

LANGUAGE_NONE

LANGUAGE_NONE = \Drupal\Core\Language\LanguageInterface::LANGCODE_NOT_SPECIFIED

LANGUAGE_TYPE_CONTENT

LANGUAGE_TYPE_CONTENT = \Drupal\Core\Language\LanguageInterface::TYPE_CONTENT

LANGUAGE_TYPE_INTERFACE

LANGUAGE_TYPE_INTERFACE = \Drupal\Core\Language\LanguageInterface::TYPE_INTERFACE

MAIL_LINE_ENDINGS

MAIL_LINE_ENDINGS = "\n"

MENU_ACCESS_DENIED

MENU_ACCESS_DENIED = 3

MENU_CALLBACK

MENU_CALLBACK = 0x0

MENU_CONTEXT_INLINE

MENU_CONTEXT_INLINE = 0x2

MENU_CONTEXT_NONE

MENU_CONTEXT_NONE = 0x0

MENU_CONTEXT_PAGE

MENU_CONTEXT_PAGE = 0x1

MENU_CREATED_BY_ADMIN

MENU_CREATED_BY_ADMIN = 0x40

MENU_DEFAULT_LOCAL_TASK

MENU_DEFAULT_LOCAL_TASK = \MENU_IS_LOCAL_TASK | \MENU_LINKS_TO_PARENT | \MENU_VISIBLE_IN_BREADCRUMB

MENU_IS_LOCAL_ACTION

MENU_IS_LOCAL_ACTION = 0x100

MENU_IS_LOCAL_TASK

MENU_IS_LOCAL_TASK = 0x80

MENU_IS_ROOT

MENU_IS_ROOT = 0x1

MENU_LOCAL_ACTION

MENU_LOCAL_ACTION = \MENU_IS_LOCAL_TASK | \MENU_IS_LOCAL_ACTION | \MENU_VISIBLE_IN_BREADCRUMB

MENU_LOCAL_TASK

MENU_LOCAL_TASK = \MENU_IS_LOCAL_TASK | \MENU_VISIBLE_IN_BREADCRUMB

MENU_MAX_DEPTH

MENU_MAX_DEPTH = 9

MENU_MODIFIED_BY_ADMIN

MENU_MODIFIED_BY_ADMIN = 0x20

MENU_NORMAL_ITEM

MENU_NORMAL_ITEM = \MENU_VISIBLE_IN_TREE | \MENU_VISIBLE_IN_BREADCRUMB

MENU_NOT_FOUND

MENU_NOT_FOUND = 2

MENU_SITE_OFFLINE

MENU_SITE_OFFLINE = 4

MENU_SUGGESTED_ITEM

MENU_SUGGESTED_ITEM = \MENU_VISIBLE_IN_BREADCRUMB | 0x10

MENU_VISIBLE_IN_BREADCRUMB

MENU_VISIBLE_IN_BREADCRUMB = 0x4

MENU_VISIBLE_IN_TREE

MENU_VISIBLE_IN_TREE = 0x2

NODE_ACCESS_ALLOW

NODE_ACCESS_ALLOW = 'allow'

NODE_ACCESS_DENY

NODE_ACCESS_DENY = 'deny'

NODE_ACCESS_IGNORE

NODE_ACCESS_IGNORE = \null

NODE_NOT_PUBLISHED

NODE_NOT_PUBLISHED = 0

NODE_PUBLISHED

NODE_PUBLISHED = 1

PASS_THROUGH

PASS_THROUGH = -1

SCHEMA_UNINSTALLED

SCHEMA_UNINSTALLED = -1

STREAM_WRAPPERS_ALL

STREAM_WRAPPERS_ALL = \Drupal\Core\StreamWrapper\StreamWrapperInterface::ALL

STREAM_WRAPPERS_LOCAL

STREAM_WRAPPERS_LOCAL = \Drupal\Core\StreamWrapper\StreamWrapperInterface::LOCAL

STREAM_WRAPPERS_LOCAL_HIDDEN

STREAM_WRAPPERS_LOCAL_HIDDEN = \Drupal\Core\StreamWrapper\StreamWrapperInterface::LOCAL_HIDDEN

STREAM_WRAPPERS_LOCAL_NORMAL

STREAM_WRAPPERS_LOCAL_NORMAL = \Drupal\Core\StreamWrapper\StreamWrapperInterface::LOCAL_NORMAL

STREAM_WRAPPERS_READ

STREAM_WRAPPERS_READ = \Drupal\Core\StreamWrapper\StreamWrapperInterface::READ

STREAM_WRAPPERS_READ_VISIBLE

STREAM_WRAPPERS_READ_VISIBLE = \Drupal\Core\StreamWrapper\StreamWrapperInterface::READ_VISIBLE

STREAM_WRAPPERS_VISIBLE

STREAM_WRAPPERS_VISIBLE = \Drupal\Core\StreamWrapper\StreamWrapperInterface::VISIBLE

STREAM_WRAPPERS_WRITE

STREAM_WRAPPERS_WRITE = \Drupal\Core\StreamWrapper\StreamWrapperInterface::WRITE

STREAM_WRAPPERS_WRITE_VISIBLE

STREAM_WRAPPERS_WRITE_VISIBLE = \Drupal\Core\StreamWrapper\StreamWrapperInterface::WRITE_VISIBLE

UNICODE_MULTIBYTE

UNICODE_MULTIBYTE = 1

UPDATE_CURRENT

UPDATE_CURRENT = 5

UPDATE_NOT_CURRENT

UPDATE_NOT_CURRENT = 4

UPDATE_NOT_SECURE

UPDATE_NOT_SECURE = 1

UPDATE_NOT_SUPPORTED

UPDATE_NOT_SUPPORTED = 3

UPDATE_REVOKED

UPDATE_REVOKED = 2

USERNAME_MAX_LENGTH

USERNAME_MAX_LENGTH = 60

VERSION

VERSION = \Drupal::VERSION

WATCHDOG_ALERT

WATCHDOG_ALERT = \Drupal\Core\Logger\RfcLogLevel::ALERT

WATCHDOG_CRITICAL

WATCHDOG_CRITICAL = \Drupal\Core\Logger\RfcLogLevel::CRITICAL

WATCHDOG_DEBUG

WATCHDOG_DEBUG = \Drupal\Core\Logger\RfcLogLevel::DEBUG

WATCHDOG_EMERGENCY

WATCHDOG_EMERGENCY = \Drupal\Core\Logger\RfcLogLevel::EMERGENCY

WATCHDOG_ERROR

WATCHDOG_ERROR = \Drupal\Core\Logger\RfcLogLevel::ERROR

WATCHDOG_INFO

WATCHDOG_INFO = \Drupal\Core\Logger\RfcLogLevel::INFO

WATCHDOG_NOTICE

WATCHDOG_NOTICE = \Drupal\Core\Logger\RfcLogLevel::NOTICE

WATCHDOG_WARNING

WATCHDOG_WARNING = \Drupal\Core\Logger\RfcLogLevel::WARNING

Functions

_cache_get_object()

_cache_get_object(mixed  $bin) : mixed

The Drupal 11 backend for a Drupal 7 bin name.

Drupal 7 named bins after their table (cache_bootstrap, cache_features) and Drupal 11 names the service without the prefix, adding it for the table. A bin with no service, such as one a contrib module declared in its schema, gets a database backend over the same table.

Parameters

mixed $bin

Returns

mixed —

_entity_load()

_entity_load(string  $entity_type, array|int|string|false  $ids, array|bool  $conditions, bool  $reset) : array|\Drupal\Core\Entity\EntityInterface|null

Parameters

string $entity_type
array|int|string|false $ids
array|bool $conditions
bool $reset

Returns

array|\Drupal\Core\Entity\EntityInterface|null —

_legacy_cache_tags()

_legacy_cache_tags(mixed  $bin, array  $cids) : list<string>

Tags for cache items of a bin: one for the bin, which a wildcard clear invalidates, one per item.

Parameters

mixed $bin
array $cids

Returns

list —

_theme_process_registry()

_theme_process_registry(array  $cache, string  $name, string  $type, string  $theme, string  $path) : void

Parameters

array $cache
string $name
string $type
string $theme
string $path

Returns

void —

anachron_field_instance_gaps()

anachron_field_instance_gaps() : array{unmapped: array<string,int>, refusals: array<string,int>}

Reports the instance keys read with no mapping and the writes refused, since the last reset.

Returns

array{unmapped: array, refusals: array} —

anachron_field_storage_for()

anachron_field_storage_for(string  $entity_type, string  $field_name) : void

Copies a field's storage to another entity type.

A Drupal 7 field belongs to no entity type and any instance may use it. A Drupal 11 storage is per entity type, and field_create_field() makes it for node. When the instance names another type, its storage is the node one made again for that type.

Parameters

string $entity_type
string $field_name

Returns

void —

anachron_legacy_field_types()

anachron_legacy_field_types() : \Drupflare\Anachron\Drupal\Field\LegacyFieldTypes

Returns

\Drupflare\Anachron\Drupal\Field\LegacyFieldTypes —

anachron_request_time()

anachron_request_time() : int

Answers the time of the current request, for the delivery rewrite of REQUEST_TIME.

A constant freezes at the first request in a process that serves many. With no container, as while a module file is being included, the server value or the clock answers instead.

Returns

int —

arg()

arg(int|null  $index = null, string|null  $path = null) : string|array|null

Returns a component of the current path, as Drupal 7's arg() did.

Reads the path from the path.current service instead of Drupal 7's $_GET['q'].

Parameters

int|null $index

The component to return, or null for all components.

string|null $path

The path to split, or null for the current path.

Returns

string|array|null —

The component, the full array when no index is given, or null when it is missing.

cache_clear_all()

cache_clear_all(mixed  $cid = null, mixed  $bin = null, mixed  $wildcard = false) : mixed

Parameters

mixed $cid
mixed $bin
mixed $wildcard

Returns

mixed —

cache_get()

cache_get(mixed  $cid, mixed  $bin = 'default') : mixed

Parameters

mixed $cid
mixed $bin

Returns

mixed —

cache_get_multiple()

cache_get_multiple(array  $cids, mixed  $bin = 'default') : mixed

Parameters

array $cids
mixed $bin

Returns

mixed —

cache_is_empty()

cache_is_empty(mixed  $bin) : mixed

Parameters

mixed $bin

Returns

mixed —

cache_set()

cache_set(mixed  $cid, mixed  $data, mixed  $bin = 'default', mixed  $expire = \CACHE_PERMANENT) : mixed

Parameters

mixed $cid
mixed $data
mixed $bin
mixed $expire

Returns

mixed —

check_plain()

check_plain(\Drupal\Component\Render\MarkupInterface|\Stringable|string  $text) : string

Parameters

\Drupal\Component\Render\MarkupInterface|\Stringable|string $text

Returns

string —

conf_path()

conf_path(bool  $require_settings = true, bool  $reset = false) : string

Parameters

bool $require_settings
bool $reset

Returns

string —

current_path()

current_path() : string

Returns

string —

db_add_field()

db_add_field(string  $table, string  $field, array  $spec, array  $keys_new = []) : void

Parameters

string $table
string $field
array $spec
array $keys_new

Returns

void —

db_add_index()

db_add_index(string  $table, string  $name, array  $fields, array  $spec = []) : void

Parameters

string $table
string $name
array $fields
array $spec

Returns

void —

db_add_primary_key()

db_add_primary_key(string  $table, string[]  $fields) : void

Parameters

string $table
string[] $fields

Returns

void —

db_add_unique_key()

db_add_unique_key(string  $table, string  $name, string[]  $fields) : void

Parameters

string $table
string $name
string[] $fields

Returns

void —

db_and()

db_and() : mixed

Returns

mixed —

db_change_field()

db_change_field(string  $table, string  $field, string  $field_new, array  $spec, array  $keys_new = []) : void

Parameters

string $table
string $field
string $field_new
array $spec
array $keys_new

Returns

void —

db_condition()

db_condition(string  $conjunction) : mixed

Parameters

string $conjunction

Returns

mixed —

db_create_table()

db_create_table(string  $name, array  $table) : void

Parameters

string $name
array $table

Returns

void —

db_delete()

db_delete(string  $table, array  $options = []) : mixed

Parameters

string $table
array $options

Returns

mixed —

db_driver()

db_driver() : string

Returns

string —

db_drop_field()

db_drop_field(string  $table, string  $field) : bool

Parameters

string $table
string $field

Returns

bool —

db_drop_index()

db_drop_index(string  $table, string  $name) : bool

Parameters

string $table
string $name

Returns

bool —

db_drop_primary_key()

db_drop_primary_key(string  $table) : bool

Parameters

string $table

Returns

bool —

db_drop_table()

db_drop_table(string  $table) : bool

Parameters

string $table

Returns

bool —

db_drop_unique_key()

db_drop_unique_key(string  $table, string  $name) : bool

Parameters

string $table
string $name

Returns

bool —

db_field_exists()

db_field_exists(string  $table, string  $field) : bool

Parameters

string $table
string $field

Returns

bool —

db_field_set_default()

db_field_set_default(string  $table, string  $field, mixed  $default) : void

Parameters

string $table
string $field
mixed $default

Returns

void —

db_field_set_no_default()

db_field_set_no_default(string  $table, string  $field) : void

Parameters

string $table
string $field

Returns

void —

db_find_tables()

db_find_tables(string  $table_expression) : string[]

Parameters

string $table_expression

Returns

string[] —

db_index_exists()

db_index_exists(string  $table, string  $name) : bool

Parameters

string $table
string $name

Returns

bool —

db_insert()

db_insert(string  $table, array  $options = []) : mixed

Parameters

string $table
array $options

Returns

mixed —

db_like()

db_like(string  $arg) : mixed

Parameters

string $arg

Returns

mixed —

db_merge()

db_merge(string  $table, array  $options = []) : mixed

Parameters

string $table
array $options

Returns

mixed —

db_or()

db_or() : mixed

Returns

mixed —

db_query()

db_query(string  $query, array  $args = [], array  $options = []) : mixed

Parameters

string $query
array $args
array $options

Returns

mixed —

db_query_range()

db_query_range(string  $query, string|int  $from, string|int  $count, array  $args = [], array  $options = []) : mixed

Parameters

string $query
string|int $from
string|int $count
array $args
array $options

Returns

mixed —

db_query_temporary()

db_query_temporary(mixed  $query, array  $args = [], array  $options = []) : mixed

Parameters

mixed $query
array $args
array $options

Returns

mixed —

db_rename_table()

db_rename_table(string  $table, string  $new_name) : void

Parameters

string $table
string $new_name

Returns

void —

db_select()

db_select(string  $table, ?string  $alias = null, array  $options = []) : mixed

Parameters

string $table
?string $alias
array $options

Returns

mixed —

db_table_exists()

db_table_exists(string  $table) : bool

Parameters

string $table

Returns

bool —

db_transaction()

db_transaction(?string  $name = null, array  $options = []) : mixed

Parameters

?string $name
array $options

Returns

mixed —

db_truncate()

db_truncate(string  $table, array  $options = []) : mixed

Parameters

string $table
array $options

Returns

mixed —

db_update()

db_update(string  $table, array  $options = []) : mixed

Parameters

string $table
array $options

Returns

mixed —

debug()

debug(mixed  $data, string|null  $label = null, bool  $print_r = true) : mixed

Prints a value as an escaped, preformatted notice, as Drupal 7's debug() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). $print_r defaults to true here, where Drupal 7 defaulted to false.

Parameters

mixed $data

The value to print.

string|null $label

An optional label.

bool $print_r

True for print_r() output, false for var_export().

Returns

mixed —

decode_entities()

decode_entities(mixed  $text) : string

Decodes HTML entities to UTF-8 characters, as Drupal 7's decode_entities() did.

Parameters

mixed $text

The text to decode.

Returns

string —

The decoded text, with single and double quote entities decoded too.

drupal_add_css()

drupal_add_css(string|null  $data = null, array|string|null  $options = null) : string[]

Parameters

string|null $data
array|string|null $options

Returns

string[] —

drupal_add_js()

drupal_add_js(array|string|null  $data = null, array|string|null  $options = null) : string[]

Parameters

array|string|null $data
array|string|null $options

Returns

string[] —

drupal_add_library()

drupal_add_library(string  $module, string  $name, ?bool  $every_page = null) : void

Parameters

string $module
string $name
?bool $every_page

Returns

void —

drupal_alter()

drupal_alter(string|string[]  $type, mixed  $data, mixed  $context1 = null, mixed  $context2 = null, mixed  $context3 = null) : void

Parameters

string|string[] $type
mixed $data
mixed $context1
mixed $context2
mixed $context3

Returns

void —

drupal_array_get_nested_value()

& drupal_array_get_nested_value(array  $array, array  $parents, ?bool  $key_exists = null) : mixed

Parameters

array $array
array $parents
?bool $key_exists

Returns

mixed —

drupal_array_nested_key_exists()

drupal_array_nested_key_exists(array  $array, array  $parents) : bool

Parameters

array $array
array $parents

Returns

bool —

drupal_array_set_nested_value()

drupal_array_set_nested_value(array  $array, array  $parents, mixed  $value, bool  $force = false) : void

Parameters

array $array
array $parents
mixed $value
bool $force

Returns

void —

drupal_attributes()

drupal_attributes(array  $attributes = []) : string

Parameters

array $attributes

Returns

string —

drupal_build_form()

drupal_build_form(string  $form_id, array  $form_state) : array

Parameters

string $form_id
array $form_state

Returns

array —

drupal_clean_css_identifier()

drupal_clean_css_identifier(string  $identifier, string[]  $filter = [' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '']) : string

Parameters

string $identifier
string[] $filter

Returns

string —

drupal_encode_path()

drupal_encode_path(string  $path) : string

Parameters

string $path

Returns

string —

drupal_form_submit()

drupal_form_submit(string  $form_id, \Drupal\Core\Form\FormStateInterface  $form_state) : void

Parameters

string $form_id
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

drupal_get_destination()

drupal_get_destination() : array

Returns the destination query parameter for the current page, as Drupal 7's did.

Unlike Drupal 7, the result is not cached for the request.

Returns

array —

An array with a single "destination" key.

drupal_get_filename()

drupal_get_filename(string  $type, string  $name, ?string  $filename = null, bool  $trigger_error = false) : ?string

Parameters

string $type
string $name
?string $filename
bool $trigger_error

Returns

?string —

drupal_get_form()

drupal_get_form(string  $form_id, mixed  ...$args) : array

Parameters

string $form_id
mixed $args variadic

Returns

array —

drupal_get_installed_schema_version()

drupal_get_installed_schema_version(string  $module, bool  $reset = false, bool  $array = false) : int|array

Returns the installed schema version of a module, as Drupal 7's did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). It reads the update.update_hook_registry service, so the Drupal 7 $reset flag has no effect.

Parameters

string $module

The module machine name.

bool $reset

Ignored.

bool $array

True to return the versions of all modules keyed by name.

Returns

int|array —

The schema version, or all versions when $array is set.

drupal_get_library()

drupal_get_library(string  $module, ?string  $name = null) : array<string,mixed>|false

Parameters

string $module
?string $name

Returns

array|false —

drupal_get_messages()

drupal_get_messages(?string  $type = null, bool  $clear_queue = true) : array<string,array<int,mixed>>

Parameters

?string $type
bool $clear_queue

Returns

array> —

drupal_get_module_schema()

drupal_get_module_schema(string  $module, string|null  $table = null) : array

Returns a module's hook_schema() definition, as Drupal 9's did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). Drupal 7 had no function of this name.

Parameters

string $module

The module machine name.

string|null $table

A table name, or null for the whole schema.

Returns

array —

The table definition or the full schema, empty when none exists.

drupal_get_path()

drupal_get_path(string  $type, string  $name) : string

Parameters

string $type
string $name

Returns

string —

drupal_get_profile()

drupal_get_profile() : string

Returns the name of the installed profile, or `standard` when the site has none, as Drupal 7 did.

Returns

string —

drupal_get_query_array()

drupal_get_query_array(string  $query) : array<int|string,mixed>

Parameters

string $query

Returns

array —

drupal_get_query_parameters()

drupal_get_query_parameters(array|null  $query = null, array  $exclude = ['q'], string  $parent = '') : array

Returns the query parameters minus the excluded keys, as Drupal 7's did.

The default source is the current Symfony request instead of Drupal 7's $_GET.

Parameters

array|null $query

The parameters to filter, or null for the current request's query.

array $exclude

The keys to drop. Nested keys use the "a[b]" form.

string $parent

The parent key for nested values. Internal use.

Returns

array —

The filtered parameters.

drupal_get_schema()

drupal_get_schema(?string  $table = null, ?bool  $rebuild = false) : false|array{fields: array<string,array{serialize: bool, type: string, default: mixed, 'not null'?: bool}>}

Parameters

?string $table
?bool $rebuild

Returns

false|array{fields: array} —

drupal_get_schema_unprocessed()

drupal_get_schema_unprocessed(string  $module, ?string  $table = null) : array<string,mixed>

Returns a module's hook_schema() definition without the processing Drupal 7 added.

The cache table of system, which Drupal 7 modules copy for their own cache bins, now comes from the database cache backend, because Drupal 11's system_schema() no longer holds it.

Parameters

string $module
?string $table

Returns

array —

drupal_get_title()

drupal_get_title() : array|string|\Stringable|null

Returns

array|string|\Stringable|null —

drupal_get_token()

drupal_get_token(string  $value = '') : string

Returns a CSRF token for a value, as Drupal 7's drupal_get_token() did.

Delegates to the csrf_token service.

Parameters

string $value

An additional value to base the token on.

Returns

string —

The token.

drupal_goto()

drupal_goto(string  $path = '', array  $options = [], int  $http_response_code = 302) : void

Parameters

string $path
array $options
int $http_response_code

Returns

void —

drupal_hash_base64()

drupal_hash_base64(string  $data) : string

Parameters

string $data

Returns

string —

drupal_html_class()

drupal_html_class(string  $class) : string

Parameters

string $class

Returns

string —

drupal_http_build_query()

drupal_http_build_query(array  $query, string  $parent = '') : string

Builds a URL-encoded query string from an array, as Drupal 7's did.

Keys without a value are emitted bare, and slashes in values stay unencoded.

Parameters

array $query

The query parameters, which may be nested.

string $parent

The encoded parent key for nested values. Internal use.

Returns

string —

The query string, without a leading question mark.

drupal_is_cli()

drupal_is_cli() : bool

Tells whether the code runs from the command line, as Drupal 7's drupal_is_cli() did.

Reads a missing argc as not numeric instead of raising a notice.

Returns

bool —

True when running under the CLI.

drupal_is_https()

drupal_is_https() : bool

Returns

bool —

drupal_json_decode()

drupal_json_decode(string  $var) : mixed

Parameters

string $var

Returns

mixed —

drupal_json_encode()

drupal_json_encode(mixed  $var) : string

Parameters

mixed $var

Returns

string —

drupal_map_assoc()

drupal_map_assoc((string|int)[]  $array, ?callable  $function = null) : array<string|int,mixed>

Parameters

(string|int)[] $array
?callable $function

Returns

array —

drupal_parse_info_file()

drupal_parse_info_file(string  $filename) : array

Parameters

string $filename

Returns

array —

drupal_parse_info_format()

drupal_parse_info_format(mixed  $data) : array

Parameters

mixed $data

Returns

array —

drupal_realpath()

drupal_realpath(string  $uri) : string|false

Parameters

string $uri

Returns

string|false —

drupal_render()

drupal_render(array  $elements) : \Drupal\Component\Render\MarkupInterface|string

Parameters

array $elements

Returns

\Drupal\Component\Render\MarkupInterface|string —

drupal_render_children()

drupal_render_children(array  $element, string[]|null  $children_keys = null) : string

Parameters

array $element
string[]|null $children_keys

Returns

string —

drupal_set_message()

drupal_set_message(null|string|\Stringable  $message = null, string  $type = 'status', bool  $repeat = true) : string[][]|\Drupal\Component\Render\MarkupInterface[][]

Parameters

null|string|\Stringable $message
string $type
bool $repeat

Returns

string[][]|\Drupal\Component\Render\MarkupInterface[][] —

drupal_set_title()

drupal_set_title(?string  $title = null, int  $output = \CHECK_PLAIN) : array|string|\Stringable|null

Parameters

?string $title
int $output

Returns

array|string|\Stringable|null —

drupal_sort_title()

drupal_sort_title(mixed  $a, mixed  $b) : int

Orders two items by their `title` key, ignoring case.

Parameters

mixed $a
mixed $b

Returns

int —

drupal_sort_weight()

drupal_sort_weight(mixed  $a, mixed  $b) : int

Orders two items by their `weight` key; an item without one weighs 0, as in Drupal 7.

Parameters

mixed $a
mixed $b

Returns

int —

drupal_strlen()

drupal_strlen(mixed  $text) : int

Returns the number of characters in a string, as Drupal 7's drupal_strlen() did.

Always uses mb_strlen(). Drupal 7's byte-counting fallback for sites without mbstring is gone.

Parameters

mixed $text

The string to measure. Null counts as zero characters.

Returns

int —

The length of the string in characters.

drupal_strtolower()

drupal_strtolower(mixed  $text) : string

Lowercases a UTF-8 string, as Drupal 7's drupal_strtolower() did with mbstring.

Parameters

mixed $text

The string to convert.

Returns

string —

The lowercased string.

drupal_strtoupper()

drupal_strtoupper(mixed  $text) : string

Uppercases a UTF-8 string, as Drupal 7's drupal_strtoupper() did with mbstring.

Parameters

mixed $text

The string to convert.

Returns

string —

The uppercased string.

drupal_substr()

drupal_substr(mixed  $text, int  $start, int|null  $length = null) : string

Cuts a piece out of a string by character index, as Drupal 7's drupal_substr() did.

Parameters

mixed $text

The input string.

int $start

The character position at which to start reading.

int|null $length

The number of characters to read, or null to read to the end.

Returns

string —

The shortened string.

drupal_ucfirst()

drupal_ucfirst(mixed  $text) : string

Uppercases the first character of a string, as Drupal 7's drupal_ucfirst() did.

Parameters

mixed $text

The string to convert.

Returns

string —

The string with its first character uppercased.

drupal_valid_token()

drupal_valid_token(string  $token, string  $value = '', bool  $skip_anonymous = false) : bool

Validates a CSRF token, as Drupal 7's drupal_valid_token() did.

Parameters

string $token

The token to validate.

string $value

The additional value the token was based on.

bool $skip_anonymous

Whether to accept any token for anonymous users.

Returns

bool —

True for a valid token, or always true for anonymous users when $skip_anonymous is set.

drupal_write_record()

drupal_write_record(string  $table, array|object  $record, string[]  $primary_keys = []) : int|false

Parameters

string $table
array|object $record
string[] $primary_keys

Returns

int|false —

each()

each(array  $array) : array|false

Returns the current key and value of an array and advances the pointer.

Parameters

array $array

The array to read, by reference.

Returns

array|false —

The pair as both [0, 1] and ['key', 'value'], or false past the end.

element_children()

element_children(array  $elements, bool  $sort = false) : array<string,mixed>

Parameters

array $elements
bool $sort

Returns

array —

entity_extract_ids()

entity_extract_ids(string  $entity_type, \Drupal\Core\Entity\EntityInterface  $entity) : array{int|string|null, int|string|null, string}

Parameters

string $entity_type
\Drupal\Core\Entity\EntityInterface $entity

Returns

array{int|string|null, int|string|null, string} —

entity_get_controller()

entity_get_controller(string  $entity_type) : object

Parameters

string $entity_type

Returns

object —

entity_get_info()

entity_get_info(?string  $entity_type = null) : array<string,mixed>

Parameters

?string $entity_type

Returns

array —

entity_label()

entity_label(string  $entity_type, mixed  $entity) : string|false

Returns the label of an entity, as Drupal 7's entity_label() did.

Parameters

string $entity_type

The entity type ID. Unused; the entity supplies its own label.

mixed $entity

The entity.

Returns

string|false —

The label, or false when the value is not an entity or has no label.

entity_language()

entity_language(string  $entity_type, \Drupal\Core\Entity\EntityInterface  $entity) : ?string

Parameters

string $entity_type
\Drupal\Core\Entity\EntityInterface $entity

Returns

?string —

entity_load()

entity_load(string  $entity_type, array|false  $ids = false, array  $conditions = [], bool  $reset = false) : array<int|string,\Drupal\Core\Entity\EntityInterface>

Parameters

string $entity_type
array|false $ids
array $conditions
bool $reset

Returns

array —

entity_load_unchanged()

entity_load_unchanged(string  $entity_type, int|string  $id) : mixed

Parameters

string $entity_type
int|string $id

Returns

mixed —

entity_uri()

entity_uri(string  $entity_type, \Drupal\Core\Entity\EntityInterface  $entity) : string

Parameters

string $entity_type
\Drupal\Core\Entity\EntityInterface $entity

Returns

string —

field_create_field()

field_create_field(array{field_name: string, type: string}  $field) : \Drupal\field\FieldStorageConfigInterface

Parameters

array{field_name: string, type: string} $field

Returns

\Drupal\field\FieldStorageConfigInterface —

field_create_instance()

field_create_instance(array{field_name: string, entity_type: string, bundle: string}  $instance) : \Drupal\field\FieldConfigInterface

Parameters

array{field_name: string, entity_type: string, bundle: string} $instance

Returns

\Drupal\field\FieldConfigInterface —

field_info_field()

field_info_field(string  $field_name) : array<string,mixed>|null

Answers one field as the array `field_info_fields()` lists, or null when no field has the name.

Parameters

string $field_name

Returns

array|null —

field_info_field_types()

field_info_field_types(?string  $field_type = null) : array<string,mixed>

Lists the field types in the Drupal 7 shape; see `LegacyFieldTypes`.

Parameters

?string $field_type

Returns

array —

field_info_fields()

field_info_fields() : array<string,array<string,mixed>>

Lists every field the way Drupal 7 did, as arrays keyed by field name.

A name used on several entity types lists the bundles of each under its entity type. The keys are the ones a Drupal 7 module reads: id, field_name, deleted (always false), type, module, settings, cardinality, translatable, locked, indexes, columns and bundles. A call made from inside this function's own load answers an empty list, for the reason field_info_instances() gives.

Returns

array> —

field_info_formatter_types()

field_info_formatter_types(?string  $formatter_type = null) : array<string,mixed>

Lists the formatter types in the Drupal 7 shape; see `LegacyFieldTypes`.

Parameters

?string $formatter_type

Returns

array —

field_info_instance()

field_info_instance(string  $entity_type, string  $field_name, string  $bundle_name) : ?\Drupflare\Anachron\Drupal\Field\LegacyFieldInstance

Parameters

string $entity_type
string $field_name
string $bundle_name

Returns

?\Drupflare\Anachron\Drupal\Field\LegacyFieldInstance —

field_info_instances()

field_info_instances(?string  $entity_type = null, ?string  $bundle_name = null) : array

Lists field instances the way Drupal 7 grouped them, each one an array-like `LegacyFieldInstance`.

Drupal 11 calls hook_entity_load for config entities too, and a Drupal 7 implementation often reads the instances from there, which loads the instances again without end. A call made from inside this function's own load answers an empty list.

Parameters

?string $entity_type
?string $bundle_name

Returns

array —

Keyed by entity type, bundle and field name, with the levels you named left out.

field_info_widget_types()

field_info_widget_types(?string  $widget_type = null) : array<string,mixed>

Lists the widget types in the Drupal 7 shape; see `LegacyFieldTypes`.

Parameters

?string $widget_type

Returns

array —

field_read_instances()

field_read_instances(array  $params = [], array  $include_additional = []) : list<\Drupflare\Anachron\Drupal\Field\LegacyFieldInstance>

Reads field instances matching Drupal 7 conditions, as a flat list.

Only entity_type, bundle, field_name and deleted are conditions here. Drupal 11 keeps no deleted instances to read, so deleted true answers an empty list. Another key is refused and recorded, and the read answers an empty list rather than every instance.

Parameters

array $params
array $include_additional

Returns

list<\Drupflare\Anachron\Drupal\Field\LegacyFieldInstance> —

file_create_url()

file_create_url(mixed  $uri) : string|false

Returns an absolute URL for a file URI, as Drupal 7's file_create_url() did.

Uses the file_url_generator service, so Drupal 7's hook_file_url_alter() is not called.

Parameters

mixed $uri

The URI or path of the file.

Returns

string|false —

The absolute URL, or false when the stream wrapper is invalid.

file_get_stream_wrappers()

file_get_stream_wrappers(int  $filter = \Drupal\Core\StreamWrapper\StreamWrapperInterface::ALL) : array<string,array{name: string, class: string, description: string, type: int}>

Parameters

int $filter

Returns

array —

file_icon_class()

file_icon_class(string  $mime_type) : string

Returns the icon class for a MIME type, as Drupal 10's file_icon_class() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). Drupal 7 had no function of this name.

Parameters

string $mime_type

The MIME type.

Returns

string —

The icon class.

file_load()

file_load(int|string  $fid) : \Drupal\file\FileInterface|false

Loads a file entity by ID, as Drupal 7's file_load() did.

Parameters

int|string $fid

The file ID.

Returns

\Drupal\file\FileInterface|false —

The file entity, or false when none exists.

file_munge_filename()

file_munge_filename(string  $filename, string  $extensions, bool  $alerts = true) : string

Renames a file so a double extension cannot run as code, as Drupal 7's did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). The allow_insecure_uploads setting comes from system.file config, where Drupal 7 used a variable.

Parameters

string $filename

The file name.

string $extensions

The space-separated list of allowed extensions.

bool $alerts

Whether to show a status message when the name changes.

Returns

string —

The munged file name.

file_prepare_directory()

file_prepare_directory(string  $directory, ?int  $options = \Drupal\Core\File\FileSystemInterface::MODIFY_PERMISSIONS) : bool

Parameters

string $directory
?int $options

Returns

bool —

file_save_data()

file_save_data(string  $data, string|null  $destination = null, int|\Drupal\Core\File\FileExists  $replace = \Drupal\Core\File\FileSystemInterface::EXISTS_RENAME) : \Drupal\file\FileInterface|false

Saves a string to a new file entity, as Drupal 7's file_save_data() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). It calls the file.repository service and maps the old integer replace flags to FileExists. It returns false on a file or stream wrapper error.

Parameters

string $data

The contents to write.

string|null $destination

The destination URI, or null for the default scheme root.

int|\Drupal\Core\File\FileExists $replace

The behavior when the file exists: 0 renames, 2 errors, anything else replaces.

Returns

\Drupal\file\FileInterface|false —

The file entity, or false on failure.

file_scan_directory()

file_scan_directory(string  $dir, string  $mask, array  $options = []) : object[]

Parameters

string $dir
string $mask
array $options

Returns

object[] —

file_uri_target()

file_uri_target(string  $uri) : string|bool

Parameters

string $uri

Returns

string|bool —

filter_xss()

filter_xss(string  $string, string[]  $allowed_tags = ['a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd']) : string

Parameters

string $string
string[] $allowed_tags

Returns

string —

filter_xss_admin()

filter_xss_admin(string  $string) : string

Parameters

string $string

Returns

string —

filter_xss_bad_protocol()

filter_xss_bad_protocol(string  $string, bool  $decode = true) : string

Parameters

string $string
bool $decode

Returns

string —

form_error()

form_error(array  $element, string  $message = '') : void

Parameters

array $element
string $message

Returns

void —

form_get_errors()

form_get_errors() : mixed

Returns

mixed —

form_load_include()

form_load_include(\Drupal\Core\Form\FormStateInterface  $form_state, string  $type, string  $module, ?string  $name = null) : string|false

Parameters

\Drupal\Core\Form\FormStateInterface $form_state
string $type
string $module
?string $name

Returns

string|false —

form_set_error()

form_set_error(?string  $name = null, string  $message = '', ?string[]  $limit_validation_errors = null) : array

Parameters

?string $name
string $message
?string[] $limit_validation_errors

Returns

array —

form_set_value()

form_set_value(array  $element, mixed  $value, \Drupal\Core\Form\FormStateInterface  $form_state) : void

Parameters

array $element
mixed $value
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

form_state_values_clean()

form_state_values_clean(\Drupal\Core\Form\FormStateInterface  $form_state) : void

Parameters

\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

format_date()

format_date(int|string  $timestamp, string  $type = 'medium', string  $format = '', string|null  $timezone = null, string|null  $langcode = null) : string

Formats a timestamp with the date formatter service, as Drupal 7's format_date() did.

Parameters

int|string $timestamp

The Unix timestamp.

string $type

The date format type, such as "short", "medium", "long" or "custom".

string $format

The PHP date format, used when the type is "custom".

string|null $timezone

The timezone name, or null for the user's timezone.

string|null $langcode

The language code, or null for the current language.

Returns

string —

The formatted date.

format_interval()

format_interval(int  $interval, int  $granularity = 2, string|null  $langcode = null) : string

Formats a time interval with the requested granularity, as Drupal 7's did.

Parameters

int $interval

The length of the interval in seconds.

int $granularity

The maximum number of units to show.

string|null $langcode

The language code for the units, or null for the current language.

Returns

string —

The interval, such as "1 week 2 days", or "0 sec" for an empty interval.

format_plural()

format_plural(int|float|string  $count, string  $singular, string  $plural, array  $args = [], array  $options = []) : string

Formats a string containing a count, as Drupal 7's format_plural() did.

Delegates to the translation service's formatPlural().

Parameters

int|float|string $count

The item count.

string $singular

The text for a count of 1.

string $plural

The text for any other count, with "@count" as the placeholder.

array $args

Placeholder replacements.

array $options

Translation options, such as "langcode".

Returns

string —

The translated string.

format_size()

format_size(int|float  $size, string|null  $langcode = null) : string

Formats a byte count as a human-readable string, as Drupal 7's format_size() did.

Parameters

int|float $size

The size in bytes.

string|null $langcode

The language code for the units, or null for the current language.

Returns

string —

The size with its unit, such as "1.5 MB".

format_string()

format_string(string  $string, array  $args = []) : \Drupal\Component\Render\MarkupInterface

Parameters

string $string
array $args

Returns

\Drupal\Component\Render\MarkupInterface —

get_magic_quotes_gpc()

get_magic_quotes_gpc() : bool

Reports magic quotes for request data, which PHP removed in 8.0.

Returns

bool —

Always false.

get_magic_quotes_runtime()

get_magic_quotes_runtime() : bool

Reports magic quotes for runtime data, which PHP removed in 8.0.

Returns

bool —

Always false.

get_t()

get_t() : string

Returns

string —

l()

l(string  $text, string  $path, array{attributes?: array, html?: bool}  $options = []) : string

Parameters

string $text
string $path
array{attributes?: array, html?: bool} $options

Returns

string —

list_themes()

list_themes(bool  $refresh = false) : array<string,\Drupflare\Anachron\Drupal\Extension\ExtensionWrapper>

Parameters

bool $refresh

Returns

array —

lock_acquire()

lock_acquire(string  $name, float  $timeout = 30.0) : bool

Parameters

string $name
float $timeout

Returns

bool —

lock_may_be_available()

lock_may_be_available(string  $name) : bool

Parameters

string $name

Returns

bool —

lock_release()

lock_release(string  $name) : void

Parameters

string $name

Returns

void —

lock_release_all()

lock_release_all(?string  $lock_id = null) : void

Parameters

?string $lock_id

Returns

void —

lock_wait()

lock_wait(string  $name, int  $delay = 30) : bool

Parameters

string $name
int $delay

Returns

bool —

module_exists()

module_exists(string  $module) : bool

Parameters

string $module

Returns

bool —

module_hook()

module_hook(string  $module, string  $hook) : bool

Parameters

string $module
string $hook

Returns

bool —

module_implements()

module_implements(string  $hook, bool  $sort = false, bool  $reset = false) : string[]

Parameters

string $hook
bool $sort
bool $reset

Returns

string[] —

module_invoke()

module_invoke(string  $module, string  $hook) : mixed

Parameters

string $module
string $hook

Returns

mixed —

module_invoke_all()

module_invoke_all(string  $hook) : array<int,mixed>

Parameters

string $hook

Returns

array —

module_list()

module_list(bool  $refresh = false, bool  $bootstrap_refresh = false, bool  $sort = false, array  $fixed_list = null) : string[]

Parameters

bool $refresh
bool $bootstrap_refresh
bool $sort
array $fixed_list

Returns

string[] —

module_load_include()

module_load_include(string  $type, string  $module, string|null  $name = null) : string|false

Includes a file from a module's directory, as Drupal 7's module_load_include() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). Drupal 7 cached each result. This version looks the module path up in the extension.list.module service.

Parameters

string $type

The file extension without the dot, such as "inc".

string $module

The module machine name.

string|null $name

The file base name, or null to use the module name.

Returns

string|false —

The included file path, or false when the file does not exist.

module_load_install()

module_load_install(mixed  $module) : string|false

Loads a module's install file, as Drupal 7's module_load_install() did.

Parameters

mixed $module

Returns

string|false —

The included file path, or false when the module has none.

node_access()

node_access(string  $op, \Drupal\node\NodeInterface|string|null  $node, \Drupal\Core\Session\AccountInterface|object|null  $account = null) : bool

Checks node access for an operation, as Drupal 7's node_access() did.

Fails closed: a missing node, an unsupported operation, an unresolvable account or a node type string with any operation other than "create" returns false. Access is decided by the node entity access handler, not by Drupal 7's hook_node_access() and node_access table.

Parameters

string $op

The operation: "view", "update", "delete" or "create".

\Drupal\node\NodeInterface|string|null $node

The node, or a node type ID for "create".

\Drupal\Core\Session\AccountInterface|object|null $account

The account to check, or null for the current user.

Returns

bool —

True when access is granted.

node_load()

node_load(int|string|null  $nid = null, int|string|null  $vid = null, bool  $reset = false) : mixed

Parameters

int|string|null $nid
int|string|null $vid
bool $reset

Returns

mixed —

node_load_multiple()

node_load_multiple(array  $nids = [], array  $conditions = [], bool  $reset = false) : mixed

Parameters

array $nids
array $conditions
bool $reset

Returns

mixed —

node_type_delete()

node_type_delete(string  $type) : void

Parameters

string $type

Returns

void —

node_type_get_name()

node_type_get_name(\Drupal\Core\Entity\EntityInterface|string  $node) : string|false

Parameters

\Drupal\Core\Entity\EntityInterface|string $node

Returns

string|false —

node_type_load()

node_type_load(string  $name) : ?\Drupal\node\NodeTypeInterface

Parameters

string $name

Returns

?\Drupal\node\NodeTypeInterface —

node_type_save()

node_type_save(\Drupal\node\NodeTypeInterface  $info) : int

Parameters

\Drupal\node\NodeTypeInterface $info

Returns

int —

node_type_set_defaults()

node_type_set_defaults(array{type?: string, name?: string, base?: string, description?: string, help?: string, custom?: int, modified?: int, locked?: int, disabled?: int, is_new?: int, has_title?: int, title_label?: string}  $info = []) : \Drupal\node\NodeTypeInterface

Parameters

array{type?: string, name?: string, base?: string, description?: string, help?: string, custom?: int, modified?: int, locked?: int, disabled?: int, is_new?: int, has_title?: int, title_label?: string} $info

Returns

\Drupal\node\NodeTypeInterface —

node_types_rebuild()

node_types_rebuild() : void

Creates the node types that enabled modules declare in `hook_node_info()`.

Drupal 7 kept the declared types in a table and added the missing ones here. Drupal 11 has no such hook, so a type is created as a config entity when none of that name exists. Keys with no counterpart (has_title, title_label, has_body, locked) are recorded and not applied.

Returns

void —

node_view()

node_view(mixed  $node, mixed  $view_mode = 'full', mixed  $langcode = null) : mixed

Parameters

mixed $node
mixed $view_mode
mixed $langcode

Returns

mixed —

parse_size()

parse_size(mixed  $size) : float

Converts a size string such as "2M" to bytes, as Drupal 7's parse_size() did.

Parameters

mixed $size

The size string. A unit letter from "bkmgtpezy" scales the number by powers of 1024.

Returns

float —

The size in bytes, rounded to a whole number.

path_get_admin_paths()

path_get_admin_paths() : array{admin: string, non_admin: string}

Returns

array{admin: string, non_admin: string} —

path_is_admin()

path_is_admin() : bool

Returns

bool —

path_to_theme()

path_to_theme() : string

Returns

string —

render()

render(array|mixed  $element) : string|mixed

Parameters

array|mixed $element

Returns

string|mixed —

request_uri()

request_uri() : string

Returns

string —

set_magic_quotes_runtime()

set_magic_quotes_runtime(bool|int  $new_setting) : bool

Accepts a request to change runtime magic quotes, which no longer exist.

Parameters

bool|int $new_setting

The requested setting.

Returns

bool —

True when asked to disable them, false when asked to enable them.

system_get_info()

system_get_info(string  $type, ?string  $name = null) : array

Parameters

string $type
?string $name

Returns

array —

system_rebuild_module_data()

system_rebuild_module_data() : array<string,\stdClass>

Lists every discovered module as Drupal 7 did, keyed by name.

Each value is an object with name, type, filename, status, info, requires and required_by. The info array is Drupal 11's with dependencies as plain module names. Keys Drupal 11 has no source for (schema_version, weight, bootstrap) are not set.

Returns

array —

taxonomy_get_parents()

taxonomy_get_parents(mixed  $tid) : mixed

Parameters

mixed $tid

Returns

mixed —

taxonomy_get_term_by_name()

taxonomy_get_term_by_name(string  $name) : \Drupal\Core\Entity\EntityInterface[]

Parameters

string $name

Returns

\Drupal\Core\Entity\EntityInterface[] —

taxonomy_get_tree()

taxonomy_get_tree(string  $vid, int  $parent = 0, ?int  $max_depth = null, bool  $load_entities = false) : object[]

Parameters

string $vid
int $parent
?int $max_depth
bool $load_entities

Returns

object[] —

taxonomy_get_vocabularies()

taxonomy_get_vocabularies() : array

Returns

array —

taxonomy_term_load()

taxonomy_term_load(int|string  $tid) : \Drupal\taxonomy\TermInterface|false

Loads a taxonomy term by ID, as Drupal 7's taxonomy_term_load() did.

Parameters

int|string $tid

The term ID.

Returns

\Drupal\taxonomy\TermInterface|false —

The term, or false when the ID is not numeric or no term exists.

theme()

theme(string  $hook, array  $variables = []) : \Drupal\Component\Render\MarkupInterface|string

Parameters

string $hook
array $variables

Returns

\Drupal\Component\Render\MarkupInterface|string —

theme_form_required_marker()

theme_form_required_marker(array  $variables) : string

Parameters

array $variables

Returns

string —

url()

url(?string  $path = null, array  $options = []) : string

Parameters

?string $path
array $options

Returns

string —

user_access()

user_access(string  $string, ?\Drupal\Core\Session\AccountInterface  $account = null) : bool

Parameters

string $string
?\Drupal\Core\Session\AccountInterface $account

Returns

bool —

user_is_anonymous()

user_is_anonymous() : bool

Returns

bool —

user_is_logged_in()

user_is_logged_in() : bool

Returns

bool —

user_load()

user_load(int|string  $uid, bool  $reset = false) : \Drupal\user\UserInterface|false

Loads a user entity by ID, as Drupal 7's user_load() did.

Parameters

int|string $uid

The user ID.

bool $reset

Whether to reset the entity cache first.

Returns

\Drupal\user\UserInterface|false —

The user entity, or false when none exists.

user_password()

user_password(int  $length = 10) : string

Generates a random password, as Drupal 7's user_password() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). The password comes from the password_generator service.

Parameters

int $length

The password length.

Returns

string —

The generated password.

user_permission_get_modules()

user_permission_get_modules() : array<string,string>

Returns

array —

user_role_load()

user_role_load(string  $rid) : ?\Drupal\user\RoleInterface

Parameters

string $rid

Returns

?\Drupal\user\RoleInterface —

user_role_load_by_name()

user_role_load_by_name(string  $role_name) : \Drupal\user\RoleInterface|false

Parameters

string $role_name

Returns

\Drupal\user\RoleInterface|false —

user_role_names()

user_role_names(bool  $members_only = false, string|null  $permission = null) : array

Returns role labels keyed by role ID, as Drupal 10's user_role_names() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). Drupal 7 had no function of this name; its user_roles() covered the same job.

Parameters

bool $members_only

Whether to leave out the anonymous role.

string|null $permission

When set, only roles holding this permission are returned.

Returns

array —

Role labels keyed by role ID.

user_roles()

user_roles(bool  $membersonly = false, string|null  $permission = null) : string[]

Returns role labels keyed by role ID, as Drupal 7's user_roles() did.

Roles are sorted by weight, then label. Role IDs are machine names, where Drupal 7 used numeric role IDs.

Parameters

bool $membersonly

Whether to leave out the anonymous role.

string|null $permission

When set, only roles holding this permission are returned.

Returns

string[] —

Role labels keyed by role ID.

variable_del()

variable_del(string  $name) : void

Parameters

string $name

Returns

void —

variable_get()

variable_get(string  $name, mixed  $default = null) : mixed

Parameters

string $name
mixed $default

Returns

mixed —

variable_set()

variable_set(string  $name, mixed  $value) : void

Parameters

string $name
mixed $value

Returns

void —

watchdog()

watchdog(string  $type, string|\Stringable  $message, array  $variables = [], int  $severity = \WATCHDOG_NOTICE, ?string  $link = null) : void

Parameters

string $type
string|\Stringable $message
array $variables
int $severity
?string $link

Returns

void —

watchdog_exception()

watchdog_exception(string  $type, \Exception  $exception, string|null  $message = null, array  $variables = [], int  $severity = \Drupal\Core\Logger\RfcLogLevel::ERROR, string|null  $link = null) : mixed

Logs an exception through the logger service, as Drupal 7's watchdog_exception() did.

Replaces a function absent from Drupal 11.4.11 core (original cited above). Severity defaults to RfcLogLevel::ERROR where Drupal 7 used WATCHDOG_ERROR.

Parameters

string $type

The logger channel.

\Exception $exception

The exception to log.

string|null $message

The message, or null for the default exception message.

array $variables

Placeholder replacements. Exception details are merged in.

int $severity

The RFC 5424 log level.

string|null $link

An optional link to attach to the entry.

Returns

mixed —