code
stringlengths
1
2.01M
language
stringclasses
1 value
<?php /** * @file * User page callbacks for the Aggregator module. */ /** * Page callback: Displays the most recent items gathered from any feed. * * @return * The rendered list of items for the feed. */ function aggregator_page_last() { drupal_add_feed('aggregator/rss', variable_get('site_name', 'Drupal'...
PHP
<?php /** * @file * Default theme implementation to present feeds as list items. * * Each iteration generates a single feed source or category. * * Available variables: * - $title: Title of the feed or category. * - $summary_list: Unordered list of linked feed items generated through * theme_item_list(). *...
PHP
<?php /** * @file * Parser functions for the aggregator module. */ /** * Implements hook_aggregator_parse_info(). */ function aggregator_aggregator_parse_info() { return array( 'title' => t('Default parser'), 'description' => t('Parses RSS, Atom and RDF feeds.'), ); } /** * Implements hook_aggregat...
PHP
<?php /** * @file * Fetcher functions for the aggregator module. */ /** * Implements hook_aggregator_fetch_info(). */ function aggregator_aggregator_fetch_info() { return array( 'title' => t('Default fetcher'), 'description' => t('Downloads data from a URL using Drupal\'s HTTP request handler.'), ); ...
PHP
<?php /** * @file * Default theme implementation to format an individual feed item for display * on the aggregator page. * * Available variables: * - $feed_url: URL to the originating feed item. * - $feed_title: Title of the feed item. * - $source_url: Link to the local source section. * - $source_title: Titl...
PHP
<?php /** * @file * Implement an image field, based on the file module's file field. */ /** * Implements hook_field_info(). */ function image_field_info() { return array( 'image' => array( 'label' => t('Image'), 'description' => t('This field stores the ID of an image file as an integer value.'...
PHP
<?php /** * @file * Functions needed to execute image effects provided by Image module. */ /** * Implements hook_image_effect_info(). */ function image_image_effect_info() { $effects = array( 'image_resize' => array( 'label' => t('Resize'), 'help' => t('Resizing will make images an exact set of...
PHP
<?php /** * @file * Administration pages for image settings. */ /** * Menu callback; Listing of all current image styles. */ function image_style_list() { $page = array(); $styles = image_styles(); $page['image_style_list'] = array( '#markup' => theme('image_style_list', array('styles' => $styles)), ...
PHP
<?php /** * @file * Hooks related to image styles and effects. */ /** * @addtogroup hooks * @{ */ /** * Define information about image effects provided by a module. * * This hook enables modules to define image manipulation effects for use with * an image style. * * @return * An array of image effects...
PHP
<?php /** * @file * Administration functions for locale.module. */ /** * @defgroup locale-language-administration Language administration interface * @{ * Administration interface for languages. * * These functions provide the user interface to show, add, edit and * delete languages as well as providing opti...
PHP
<?php /** * @file * Hooks provided by the Locale module. */ /** * @addtogroup hooks * @{ */ /** * Allows modules to define their own text groups that can be translated. * * @param $op * Type of operation. Currently, only supports 'groups'. */ function hook_locale($op = 'groups') { switch ($op) { c...
PHP
<?php /** * @file * Administrative page callbacks for the Database Logging module. */ /** * Page callback: Displays a listing of database log messages. * * Messages are truncated at 56 chars. Full-length messages can be viewed on the * message details page. * * @see dblog_clear_log_form() * @see dblog_event...
PHP
<?php /** * @file * User page callbacks for tracker.module. */ /** * Page callback: prints a listing of active nodes on the site. * * Queries the database for info, adds RDFa info if applicable, and generates * the render array that will be used to render the page. */ function tracker_page($account = NULL, $...
PHP
<?php /** * @file * Default theme implementation to configure blocks. * * Available variables: * - $block_regions: An array of regions. Keyed by name with the title as value. * - $block_listing: An array of blocks keyed by region and then delta. * - $form_submit: Form submit button. * * Each $block_listing[$r...
PHP
<?php /** * @file * Admin page callbacks for the block module. */ /** * Menu callback for admin/structure/block/demo. */ function block_admin_demo($theme = NULL) { drupal_add_css(drupal_get_path('module', 'block') . '/block.css'); return ''; } /** * Menu callback for admin/structure/block. * * @param $th...
PHP
<?php /** * @file * Hooks provided by the Block module. */ /** * @addtogroup hooks * @{ */ /** * Define all blocks provided by the module. * * This hook declares to Drupal what blocks are provided by your module and can * optionally specify initial block configuration settings. * * In hook_block_info(), ...
PHP
<?php /** * @file * Custom theme implementation to display a single Drupal page without * sidebars. The sidebars are hidden by regions_hidden for this theme, so * the default page.tpl.php will not work without throwing exceptions. */ ?> <div id="page-wrapper"><div id="page"> <div id="header"><div class="s...
PHP
<?php /** * @file * Default theme implementation to display a block. * * Available variables: * - $block->subject: Block title. * - $content: Block content. * - $block->module: Module that generated the block. * - $block->delta: An ID for the block, unique within each module. * - $block->region: The block reg...
PHP
<?php /** * @file * Page callbacks for simpletest module. */ /** * List tests arranged in groups that can be selected and run. */ function simpletest_test_form($form) { $form['tests'] = array( '#type' => 'fieldset', '#title' => t('Tests'), '#description' => t('Select the test(s) or test group(s) yo...
PHP
<?php /** * @file * Hooks provided by the SimpleTest module. */ /** * @addtogroup hooks * @{ */ /** * Alter the list of tests. * * @param $groups * A two dimension array, the first key is the test group (as defined in * getInfo) the second is the name of the class and the value is the return * valu...
PHP
<?php /** * @file * Batch callbacks for the Batch API tests. */ /** * Simple batch operation. */ function _batch_test_callback_1($id, $sleep, &$context) { // No-op, but ensure the batch take a couple iterations. // Batch needs time to run for the test, so sleep a bit. usleep($sleep); // Track execution,...
PHP
<?php /** * @file * A file to test module_implements() loading includes. */ /** * Implements hook_test_hook(). */ function module_test_test_hook() { return array('module_test' => 'success!'); }
PHP
<?php /** * Returns HTML for the 'theme_test' theme hook used by tests. */ function theme_theme_test($variables) { return 'Theme hook implementor=theme_theme_test(). Foo=' . $variables['foo']; } /** * Preprocesses variables for theme_theme_test(). */ function template_preprocess_theme_test(&$variables) { $var...
PHP
<?php /** * @file * Fake an HTTP request, for use during testing. */ // Set a global variable to indicate a mock HTTP request. $is_http_mock = !empty($_SERVER['HTTPS']); // Change to HTTP. $_SERVER['HTTPS'] = NULL; ini_set('session.cookie_secure', FALSE); foreach ($_SERVER as $key => $value) { $_SERVER[$key] = ...
PHP
<?php db_update('node')->fields(array( 'comment' => 2 )) ->condition('nid', 1) ->execute(); db_insert('comments')->fields(array( 'cid', 'pid', 'nid', 'uid', 'subject', 'comment', 'hostname', 'timestamp', 'status', 'format', 'thread', 'name', 'mail', 'homepage', )) ->values(array( ...
PHP
<?php /** * @file * Test content for the aggregator update path. */ db_insert('aggregator_feed')->fields(array( 'fid', 'title', 'url', 'refresh', 'checked', 'queued', 'link', 'description', 'image', 'hash', 'etag', 'modified', 'block', )) ->values(array( 'fid' => '1', 'title' => 'Dru...
PHP
<?php db_insert('variable')->fields(array( 'name', 'value', )) ->values(array( 'name' => 'user_mail_register_no_approval_required_body', 'value' => 's:86:"!username, !site, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.";', )) ->execute();
PHP
<?php /** * Database additions for forum tests. */ db_create_table('forum', array( 'fields' => array( 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' =>...
PHP
<?php db_insert('variable')->fields(array( 'name', 'value', )) ->values(array( 'name' => 'user_mail_register_no_approval_required_body', 'value' => 's:97:"!password, !username, !site, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.";', )) ->execute(); db_insert('users')->fields(array( 'u...
PHP
<?php db_insert('comments')->fields(array( 'cid', 'pid', 'nid', 'uid', 'subject', 'comment', 'hostname', 'timestamp', 'status', 'format', 'thread', 'name', 'mail', 'homepage', )) ->values(array( 'cid' => 1, 'pid' => 0, 'nid' => 37, 'uid' => 3, 'subject' => 'Comment title 1', 'com...
PHP
<?php db_insert('variable')->fields(array( 'name', 'value', )) ->values(array( 'name' => 'menu_default_node_menu', 'value' => 's:15:"secondary-links";', )) ->values(array( 'name' => 'menu_primary_links_source', 'value' => 's:15:"secondary-links";', )) ->values(array( 'name' => 'menu_secondary_links_source...
PHP
<?php db_insert('files')->fields(array( 'fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'status', 'timestamp', )) /* * This entry is deliberately omitted to test the upgrade routine when facing * possible data corruption. * ->values(array( 'fid' => '1', 'uid' => '1', 'filename' =...
PHP
<?php /** * @file * Test content for the trigger upgrade path. */ db_create_table('trigger_assignments', array( 'fields' => array( 'hook' => array( 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '', ), 'op' => array( 'type' => 'varchar', 'lengt...
PHP
<?php /** * Database additions for translatable tests. */ db_insert('node')->fields(array( 'nid', 'vid', 'type', 'language', 'title', 'uid', 'status', 'created', 'changed', 'comment', 'promote', 'moderate', 'sticky', 'tnid', 'translate', )) ->values(array( 'nid' => '53', 'vid' => '...
PHP
<?php /** * @file * Test content for the trigger upgrade path. */ // Add several trigger configurations. db_insert('trigger_assignments')->fields(array( 'hook', 'aid', 'weight', )) ->values(array( 'hook' => 'node_presave', 'aid' => 'node_publish_action', 'weight' => '1', )) ->values(array( 'hook' => '...
PHP
<?php /** * Database additions for locale tests. */ db_create_table('languages', array( 'fields' => array( 'language' => array( 'type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '', ), 'name' => array( 'type' => 'varchar', 'length' => 64, '...
PHP
<?php // Simulate duplicated permission condition. db_update('permission')->fields(array( 'perm' => 'access content, access content', )) ->condition('pid', 1) ->execute();
PHP
<?php /** * @file * Test content for the field update path. */ db_insert('variable')->fields(array( 'name', 'value', )) ->values(array( 'name' => 'field_bundle_settings', 'value' => 'a:1:{s:4:"node";a:1:{s:4:"poll";a:1:{s:12:"extra_fields";a:1:{s:7:"display";a:2:{s:16:"poll_view_voting";a:1:{s:7:"default";...
PHP
<?php /** * @file * Fake an HTTPS request, for use during testing. */ // Set a global variable to indicate a mock HTTPS request. $is_https_mock = empty($_SERVER['HTTPS']); // Change to HTTPS. $_SERVER['HTTPS'] = 'on'; foreach ($_SERVER as $key => $value) { $_SERVER[$key] = str_replace('modules/simpletest/tests/...
PHP
<?php /** * Tests a theme overriding a suggestion of a base theme hook. */ function test_theme_theme_test__suggestion($variables) { return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo']; } /** * Tests a theme implementing an alter hook. * * The confusing function name he...
PHP
<?php /** * @file * An include file to test loading it with the form API. */ /** * Form constructor for testing FAPI file inclusion of the file specified in * hook_menu(). */ function form_test_load_include_menu($form, &$form_state) { // Submit the form via Ajax. That way the FAPI has to care about including ...
PHP
<?php print 'SimpleTest PHP was executed!';
PHP
<?php /** * Global variable that holds information about the tests being run. * * An array, with the following keys: * - 'test_run_id': the ID of the test being run, in the form 'simpletest_%" * - 'in_child_site': TRUE if the current request is a cURL request from * the parent site. * * @var array */ gl...
PHP
<?php namespace Drupal\simpletest\Tests; class PSR0WebTest extends \DrupalWebTestCase { public static function getInfo() { return array( 'name' => 'PSR0 web test', 'description' => 'We want to assert that this PSR-0 test case is being discovered.', 'group' => 'SimpleTest', ); } funct...
PHP
<?php /** * @file * PHP page for handling incoming XML-RPC requests from clients. */ /** * Root directory of Drupal installation. */ define('DRUPAL_ROOT', getcwd()); include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); include_once DRUPAL_ROOT . '/includes/xmlrpc.inc'; ...
PHP
<?php /** * @file * Administrative script for running authorized file operations. * * Using this script, the site owner (the user actually owning the files on the * webserver) can authorize certain file-related operations to proceed with * elevated privileges, for example to deploy and upgrade modules or themes....
PHP
#!/usr/bin/env php <?php /** * Dump a Drupal 6 database into a Drupal 7 PHP script to test the upgrade * process. * * Run this script at the root of an existing Drupal 6 installation. * * The output of this script is a PHP script that can be ran inside Drupal 7 * and recreates the Drupal 6 database as dumped. T...
PHP
#!/usr/bin/php <?php /** * Drupal hash script - to generate a hash from a plaintext password * * Check for your PHP interpreter - on Windows you'll probably have to * replace line 1 with * #!c:/program files/php/php.exe * * @param password1 [password2 [password3 ...]] * Plain-text passwords in quotes (or wi...
PHP
#!/usr/bin/env php <?php /** * Drupal shell execution script * * Check for your PHP interpreter - on Windows you'll probably have to * replace line 1 with * #!c:/program files/php/php.exe * * @param path Drupal's absolute root directory in local file system (optional). * @param URI A URI to execute, inclu...
PHP
#!/usr/bin/env php <?php /** * @file * Generates content for a Drupal 7 database to test the upgrade process. * * Run this script at the root of an existing Drupal 6 installation. * Steps to use this generation script: * - Install drupal 7. * - Run this script from your Drupal ROOT directory. * - Use the dump-...
PHP
#!/usr/bin/env php <?php /** * Generate content for a Drupal 6 database to test the upgrade process. * * Run this script at the root of an existing Drupal 6 installation. * Steps to use this generation script: * - Install drupal 6. * - Run this script from your Drupal ROOT directory. * - Use the dump-database-d...
PHP
#!/usr/bin/env php <?php /** * @file * Dumps a Drupal 7 database into a PHP script to test the upgrade process. * * Run this script at the root of an existing Drupal 7 installation. * * The output of this script is a PHP script that can be run inside Drupal 7 * and recreates the Drupal 7 database as dumped. Tra...
PHP
<?php /** * Defines the root directory of the Drupal installation. */ define('DRUPAL_ROOT', getcwd()); /** * @file * Administrative page for handling updates from one Drupal version to another. * * Point your browser to "http://www.example.com/update.php" and follow the * instructions. * * If you are not log...
PHP
<?php /** * @file * Initiates a browser-based installation of Drupal. */ /** * Defines the root directory of the Drupal installation. */ define('DRUPAL_ROOT', getcwd()); /** * Global flag to indicate the site is in installation mode. */ define('MAINTENANCE_MODE', 'install'); // Exit early if running an incom...
PHP
<?php /** * @file * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs). */ /** * Root directory of Drupal installation. */ define('DRUPAL_ROOT', getcwd()); include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); if (!isset($_GET['cron_key']) || va...
PHP
<?php ?> <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>> <?php print $user_picture; ?> <?php print render($title_prefix); ?> <?php if (!$page): ?> <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> ...
PHP
<?php /** * @file * Theme setting callbacks for the garland theme. */ /** * Implements hook_form_FORM_ID_alter(). * * @param $form * The form. * @param $form_state * The form state. */ function garland_form_system_theme_settings_alter(&$form, &$form_state) { $form['garland_width'] = array( '#type...
PHP
<?php ?> <div class="<?php print $classes . ' ' . $zebra; ?>"<?php print $attributes; ?>> <div class="clearfix"> <span class="submitted"><?php print $submitted ?></span> <?php if ($new): ?> <span class="new"><?php print drupal_ucfirst($new) ?></span> <?php endif; ?> <?php print $picture ?> <?ph...
PHP
<?php /** * @file * Override of the default maintenance page. * * This is an override of the default maintenance page. Used for Garland and * Minnelli, this file should not be moved or modified since the installation * and update pages depend on this file. * * This mirrors closely page.tpl.php for Garland in o...
PHP
<?php /** * Override of theme_breadcrumb(). */ function garland_breadcrumb($variables) { $breadcrumb = $variables['breadcrumb']; if (!empty($breadcrumb)) { // Provide a navigational heading to give context for breadcrumb links to // screen-reader users. Make the heading invisible with .element-invisible...
PHP
<?php $info = array( // Available colors and color labels used in theme. 'fields' => array( 'base' => t('Base color'), 'link' => t('Link color'), 'top' => t('Header top'), 'bottom' => t('Header bottom'), 'text' => t('Text color'), ), // Pre-defined color schemes. 'schemes' => array( ...
PHP
<?php ?> <?php print render($page['header']); ?> <div id="wrapper"> <div id="container" class="clearfix"> <div id="header"> <div id="logo-floater"> <?php if ($logo || $site_title): ?> <?php if ($title): ?> <div id="branding"><strong><a href="<?php print $front_page ...
PHP
<?php /** * @file * Bartik's theme implementation to display a node. * * Available variables: * - $title: the (sanitized) title of the node. * - $content: An array of node items. Use render($content) to print them all, * or print a subset such as render($content['field_example']). Use * hide($content['fiel...
PHP
<?php /** * @file * Bartik's theme implementation to provide an HTML container for comments. * * Available variables: * - $content: The array of content-related elements for the node. Use * render($content) to print them all, or * print a subset such as render($content['comment_form']). * - $classes: Strin...
PHP
<?php /** * @file * Bartik's theme implementation for comments. * * Available variables: * - $author: Comment author. Can be link or plain text. * - $content: An array of comment items. Use render($content) to print them all, or * print a subset such as render($content['field_example']). Use * hide($conten...
PHP
<?php /** * @file * Implementation to display a single Drupal page while offline. * * All the available variables are mirrored in page.tpl.php. * * @see template_preprocess() * @see template_preprocess_maintenance_page() * @see bartik_process_maintenance_page() */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1...
PHP
<?php /** * @file * Bartik's theme implementation to display a single Drupal page. * * The doctype, html, head and body tags are not in this template. Instead they * can be found in the html.tpl.php template normally located in the * modules/system directory. * * Available variables: * * General utility vari...
PHP
<?php /** * Add body classes if certain regions have content. */ function bartik_preprocess_html(&$variables) { if (!empty($variables['page']['featured'])) { $variables['classes_array'][] = 'featured'; } if (!empty($variables['page']['triptych_first']) || !empty($variables['page']['triptych_middle']) ...
PHP
<?php // Put the logo path into JavaScript for the live preview. drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'bartik'))), 'setting'); $info = array( // Available colors and color labels used in theme. 'fields' => array( 'top' => t('Header top'), 'bottom' => t('Header bottom'),...
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>"> <head> <title><?php print $head_ti...
PHP
<?php /** * Override or insert variables into the maintenance page template. */ function seven_preprocess_maintenance_page(&$vars) { // While markup for normal pages is split into page.tpl.php and html.tpl.php, // the markup for the maintenance page is all in the single // maintenance-page.tpl.php template. So...
PHP
<div id="branding" class="clearfix"> <?php print $breadcrumb; ?> <?php print render($title_prefix); ?> <?php if ($title): ?> <h1 class="page-title"><?php print $title; ?></h1> <?php endif; ?> <?php print render($title_suffix); ?> <?php print render($primary_local_tasks); ?> </div> ...
PHP
<?php /** * @file * Secure password hashing functions for user authentication. * * Based on the Portable PHP password hashing framework. * @see http://www.openwall.com/phpass/ * * An alternative or custom version of this password hashing API may be * used by setting the variable password_inc to the name of the...
PHP
<?php /** * @file * Drupal placeholder/token replacement system. * * API functions for replacing placeholders in text with meaningful values. * * For example: When configuring automated emails, an administrator enters * standard text for the email. Variables like the title of a node and the date * the email wa...
PHP
<?php /** * @file * A database-mediated implementation of a locking mechanism. */ /** * @defgroup lock Locking mechanisms * @{ * Functions to coordinate long-running operations across requests. * * In most environments, multiple Drupal page requests (a.k.a. threads or * processes) will execute in parallel. T...
PHP
<?php /** * @file * The theme system, which controls the output of Drupal. * * The theme system allows for nearly all output of the Drupal system to be * customized by user themes. */ /** * @defgroup content_flags Content markers * @{ * Markers used by theme_mark() and node_mark() to designate content. * @s...
PHP
<?php /** * @file * API for the Drupal menu system. */ /** * @defgroup menu Menu system * @{ * Define the navigation menus, and route page requests to code based on URLs. * * The Drupal menu system drives both the navigation system from a user * perspective and the callback system that Drupal uses to respond...
PHP
<?php /** * @file * Functions for error handling. */ /** * Maps PHP error constants to watchdog severity levels. * * The error constants are documented at * http://php.net/manual/errorfunc.constants.php * * @ingroup logging_severity_levels */ function drupal_error_levels() { $types = array( E_ERROR =>...
PHP
<?php /** * @file * Provides API for defining and handling XML-RPC requests. */ /** * Invokes XML-RPC methods on this server. * * @param array $callbacks * Array of external XML-RPC method names with the callbacks they map to. */ function xmlrpc_server($callbacks) { $xmlrpc_server = new stdClass(); // D...
PHP
<?php /** * @file * Common functions that many Drupal modules will need to reference. * * The functions that are critical and need to be available even when serving * a cached page are instead located in bootstrap.inc. */ /** * @defgroup php_wrappers PHP wrapper functions * @{ * Functions that are wrappers o...
PHP
<?php /** * @file * Drupal stream wrapper interface. * * Provides a Drupal interface and classes to implement PHP stream wrappers for * public, private, and temporary files. * * A stream wrapper is an abstraction of a file system that allows Drupal to * use the same set of methods to access both local files an...
PHP
<?php /** * @file * Functions to handle paths in Drupal, including path aliasing. * * These functions are not loaded for cached pages, but modules that need * to use them in hook_boot() or hook exit() can make them available, by * executing "drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);". */ /** * Initialize the $...
PHP
<?php /** * @file * API functions for installing modules and themes. */ /** * Indicates that a module has not been installed yet. */ define('SCHEMA_UNINSTALLED', -1); /** * Indicates that a module has been installed. */ define('SCHEMA_INSTALLED', 0); /** * Requirement severity -- Informational message only. *...
PHP
<?php /** * @file * Functions and interfaces for cache handling. */ /** * Gets the cache object for a cache bin. * * By default, this returns an instance of the DrupalDatabaseCache class. * Classes implementing DrupalCacheInterface can register themselves both as a * default implementation and for specific bi...
PHP
<?php /** * @file * Queue handlers used by the Batch API. * * These implementations: * - Ensure FIFO ordering. * - Allow an item to be repeatedly claimed until it is actually deleted (no * notion of lease time or 'expire' date), to allow multipass operations. */ /** * Defines a batch queue. * * Stale ite...
PHP
<?php /** * @file * Drupal database update API. * * This file contains functions to perform database updates for a Drupal * installation. It is included and used extensively by update.php. */ /** * Minimum schema version of Drupal 6 required for upgrade to Drupal 7. * * Upgrades from Drupal 6 to Drupal 7 req...
PHP
<?php /** * @file * API functions for processing and sending e-mail. */ /** * Auto-detect appropriate line endings for e-mails. * * $conf['mail_line_endings'] will override this setting. */ define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE ? "\r\n" ...
PHP
<?php /** * @file * Functions to aid in the creation of sortable tables. * * All tables created with a call to theme('table') have the option of having * column headers that the user can click on to sort the table by that column. */ /** * Query extender class for tablesort queries. */ class TableSort extends...
PHP
<?php /** * @file * This file contains the code registry parser engine. */ /** * @defgroup registry Code registry * @{ * The code registry engine. * * Drupal maintains an internal registry of all interfaces or classes in the * system, allowing it to lazy-load code files as needed (reducing the amount * of c...
PHP
<?php /** * @file * API functions for installing Drupal. */ /** * Do not run the task during the current installation request. * * This can be used to skip running an installation task when certain * conditions are met, even though the task may still show on the list of * installation tasks presented to the u...
PHP
<?php /** * @file * Functions for use with Drupal's Ajax framework. */ /** * @defgroup ajax Ajax framework * @{ * Functions for Drupal's Ajax framework. * * Drupal's Ajax framework is used to dynamically update parts of a page's HTML * based on data from the server. Upon a specified event, such as a button ...
PHP
<?php /** * @file * Batch processing API for processes to run in multiple HTTP requests. * * Note that batches are usually invoked by form submissions, which is * why the core interaction functions of the batch processing API live in * form.inc. * * @see form.inc * @see batch_set() * @see batch_process() * ...
PHP
<?php /** * @file * API for handling file uploads and server file management. */ /** * Manually include stream wrapper code. * * Stream wrapper code is included here because there are cases where * File API is needed before a bootstrap, or in an alternate order (e.g. * maintenance theme). */ require_once DRU...
PHP
<?php /** * @file * Installation code for MySQL embedded database engine. */ /** * Specifies installation tasks for MySQL and equivalent databases. */ class DatabaseTasks_mysql extends DatabaseTasks { /** * The PDO driver name for MySQL and equivalent databases. * * @var string */ protected $pdoD...
PHP
<?php /** * @file * Database schema code for MySQL database servers. */ /** * @addtogroup schemaapi * @{ */ class DatabaseSchema_mysql extends DatabaseSchema { /** * Maximum length of a table comment in MySQL. */ const COMMENT_MAX_TABLE = 60; /** * Maximum length of a column comment in MySQL....
PHP
<?php /** * @addtogroup database * @{ */ /** * @file * Query code for MySQL embedded database engine. */ class InsertQuery_mysql extends InsertQuery { public function execute() { if (!$this->preExecute()) { return NULL; } // If we're selecting from a SelectQuery, finish building the quer...
PHP
<?php /** * @file * Database interface code for MySQL database servers. */ /** * @addtogroup database * @{ */ class DatabaseConnection_mysql extends DatabaseConnection { /** * Flag to indicate if the cleanup function in __destruct() should run. * * @var boolean */ protected $needsCleanup = FAL...
PHP
<?php /** * @file * Generic Database schema code. */ require_once dirname(__FILE__) . '/query.inc'; /** * @defgroup schemaapi Schema API * @{ * API to handle database schemas. * * A Drupal schema definition is an array structure representing one or * more tables and their related keys and indexes. A schema ...
PHP
<?php /** * @file * Database interface code for engines that need complete control over their * result sets. For example, SQLite will prefix some column names by the name * of the table. We post-process the data, by renaming the column names * using the same convention as MySQL and PostgreSQL. */ /** * @addtog...
PHP
<?php /** * @file * SQLite specific install functions */ class DatabaseTasks_sqlite extends DatabaseTasks { protected $pdoDriver = 'sqlite'; public function name() { return st('SQLite'); } /** * Minimum engine version. * * @todo: consider upping to 3.6.8 in Drupal 8 to get SAVEPOINT support....
PHP