variable_set
Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.
includes/bootstrap.inc, строка 514
- Версии
- 5 – 6
variable_set($name, $value)
Устанавливает постоянную переменную.
Параметры
$name
Имя устанавливаемой переменной.
$value
Устанавливаемое значение. Может быть любого типа данных, так как функция умеет сериализировать данные при необходимости.
Set a persistent variable.
Parameters
$name The name of the variable to set.
$value The value to set. This can be any PHP data type; these functions take care of serialization as necessary.
▾ 72 функции вызывают variable_set()
- block_example_block in developer/examples/block_example.module
- Реализация hook_block().
- book_block in modules/book/book.module
- Реализация hook_block().
- book_node_type in modules/book/book.module
- Реализация hook_node_type().
- color_scheme_form_submit in modules/color/color.module
- Submit handler for color change form.
- comment_update_1 in modules/comment/comment.install
- Changed node_comment_statistics to use node->changed to avoid future timestamps.
- comment_update_6002 in modules/comment/comment.install
- Changed comment settings from global to per-node -- copy global settings to all node types.
- default_profile_tasks in profiles/default/default.profile
- Perform any final installation tasks for this profile.
- drupal_clear_js_cache in includes/common.inc
- Удаляет все файлы кэша JS.
- drupal_cron_run in includes/common.inc
- При вызове выполняет задачи cron
- drupal_get_private_key in includes/common.inc
- Гарантирует, что переменная персонального ключа, которая используется для генерации токенов установлена.
- drupal_http_request in includes/common.inc
- Выполняет HTTP-запрос.
- example_form_submit in ./example.profile
- Form API submit for the example form.
- example_profile_tasks in ./example.profile
- Perform any final installation tasks for this profile.
- file_directory_temp in includes/file.inc
- Определеляет папку по умолчанию для хранения временных файлов.
- filter_admin_overview_submit in modules/filter/filter.admin.inc
- forum_block in modules/forum/forum.module
- Реализация hook_block().
- forum_enable in modules/forum/forum.install
- forum_form_submit in modules/forum/forum.admin.inc
- Process forum form and container form submissions.
- forum_taxonomy in modules/forum/forum.module
- Implementation of hook_taxonomy().
- forum_update_6000 in modules/forum/forum.install
- Create the forum vocabulary if does not exist. Assign the vocabulary a low weight so it will appear first in forum topic create and edit forms. Do not just call forum_enable() because in future versions it might do something different.
- hook_block in developer/hooks/core.php
- Определяет блок или набор блоков.
- hook_node_type in developer/hooks/node.php
- Позволяет модулям осуществлять действия при изменении типа нод.
- hook_taxonomy in developer/hooks/core.php
- Выполняется при изменениях таксономии.
- hook_update_index in developer/hooks/core.php
- Обновляет полнотекстовый индекс Друпала для данного модуля.
- install_configure_form_submit in ./install.php
- Form API submit for the site configuration form.
- install_main in ./install.php
- The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database...
- install_tasks in ./install.php
- Tasks performed after the database is initialized.
- locale_add_language in includes/locale.inc
- API добавления языка.
- locale_languages_configure_form_submit in includes/locale.inc
- Submit function for language negotiation settings.
- locale_languages_edit_form_submit in includes/locale.inc
- Process the language editing form submission.
- locale_languages_overview_form_submit in includes/locale.inc
- Process language overview form submissions, updating existing languages.
- locale_update_6000 in modules/locale/locale.install
- {locales_meta} table became {languages}.
- locale_update_6005 in modules/locale/locale.install
- Change language setting variable of content types.
- locale_update_js_files in modules/locale/locale.module
- Update JavaScript translation file, if required, and add it to the page.
- menu_rebuild in includes/menu.inc
- (Пере)заполняет таблицы базы данных, используемые различными функциями меню.
- multipage_form_example_custom_submit in developer/examples/multipage_form_example.module
- node_access_needs_rebuild in modules/node/node.module
- Устанавливает/снимает флаг перестройки права доступа ноды или возвращает текущее значение флага.
- node_type_form_submit in modules/node/content_types.inc
- Implementation of hook_form_submit().
- node_update_index in modules/node/node.module
- Реализация hook_update_index().
- profile_block in modules/profile/profile.module
- Реализация hook_block().
- statistics_block in modules/statistics/statistics.module
- Реализация hook_block().
- statistics_cron in modules/statistics/statistics.module
- Реализация hook_cron().
- system_block in modules/system/system.module
- Реализация hook_block().
- system_check_http_request in modules/system/system.module
- Checks whether the server is capable of issuing HTTP requests.
- system_image_toolkit_settings in modules/system/system.admin.inc
- Form builder; Configure site image toolkit usage. See alsosystem_settings_form()
- system_node_type in modules/system/system.module
- Implementation of hook_node_type().
- system_settings_form_submit in modules/system/system.module
- Execute the system_settings_form.
- system_themes_form_submit in modules/system/system.admin.inc
- Process system_themes_form form submissions.
- system_theme_settings_submit in modules/system/system.admin.inc
- Process system_theme_settings form submissions.
- system_update_1022 in modules/system/system.install
- Add index on users created column.
- system_update_6014 in modules/system/system.install
- Record that the installer is done, so it is not possible to run the installer on upgraded sites.
- system_update_6017 in modules/system/system.install
- Rename settings related to user.module email notifications.
- system_update_6021 in modules/system/system.install
- Migrate the menu items from the old menu system to the new menu_links table.
- system_update_6042 in modules/system/system.install
- Upgrade recolored theme stylesheets to new array structure.
- system_update_6043 in modules/system/system.install
- Update table indices to make them more rational and useful.
- system_update_6046 in modules/system/system.install
- Ensure that the file_directory_path variable is set (using the old 5.x default, if necessary), so that the changed 6.x default won't break existing sites.
- throttle_exit in modules/throttle/throttle.module
- Implementation of hook_exit().
- update_fix_d6_requirements in ./update.php
- Perform Drupal 5.x to 6.x updates that are required for update.php to function properly.
- update_settings_submit in modules/update/update.settings.inc
- Submit handler for the settings tab.
- user_block in modules/user/user.module
- Реализация hook_block().
- _book_install_type_create in modules/book/book.install
- _color_render_images in modules/color/color.module
- Render images that match a given palette.
- _drupal_flush_css_js in includes/common.inc
- Helper function to change query-strings on css/js files.
- _install_locale_initial_batch_finished in ./install.php
- Finished callback for the first locale import batch.
- _install_locale_remaining_batch_finished in ./install.php
- Finished callback for the second locale import batch.
- _install_profile_batch_finished in ./install.php
- Finished callback for the modules install batch.
- _locale_invalidate_js in includes/locale.inc
- Провоцирует Javascript-файлы переводов на обновление.
- _locale_rebuild_js in includes/locale.inc
- Создает(заменяет) JavaScript-файл перевода для указанного языка.
- _menu_router_build in includes/menu.inc
- Helper function to build the router table based on the data from hook_menu.
- _menu_set_expanded_menus in includes/menu.inc
- Helper function to update a list of menus with expanded items
- _node_index_node in modules/node/node.module
- Индексирует одну ноду.
- _update_refresh in modules/update/update.fetch.inc
- Fetch project info via XML from a central server.
Код
<?php
function variable_set($name, $value) {
global $conf;
$serialized_value = serialize($value);
db_query("UPDATE {variable} SET value = '%s' WHERE name = '%s'", $serialized_value, $name);
if (!db_affected_rows()) {
@db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", $name, $serialized_value);
}
cache_clear_all('variables', 'cache');
$conf[$name] = $value;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии