diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/includes/common.inc b/includes/common.inc index caaa3f5a4..56166cda8 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1219,7 +1219,7 @@ function t($string, array $args = array(), array $options = array()) { $string = $custom_strings[$options['langcode']][$options['context']][$string]; } // Translate with locale module if enabled. - // We don't use drupal_function_exists() here, because it breaks the testing + // We don't use function_exists() here, because it breaks the testing // framework if the locale module is enabled in the parent site (we cannot // unload functions in PHP). elseif (function_exists('locale') && $options['langcode'] != 'en') { @@ -2319,7 +2319,6 @@ function drupal_page_footer() { ob_flush(); } - module_implements(MODULE_IMPLEMENTS_WRITE_CACHE); _registry_check_code(REGISTRY_WRITE_LOOKUP_CACHE); drupal_cache_system_paths(); } @@ -2868,7 +2867,7 @@ function drupal_clear_css_cache() { * - 'file': Path to the file relative to base_path(). * - 'inline': The JavaScript code that should be placed in the given scope. * - 'external': The absolute path to an external JavaScript file that is not - * hosted on the local server. These files will not be aggregated if + * hosted on the local server. These files will not be aggregated if * JavaScript aggregation is enabled. * - 'setting': An array with configuration options as associative array. The * array is directly placed in Drupal.settings. All modules should wrap @@ -3575,14 +3574,6 @@ function _drupal_bootstrap_full() { set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); - if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'simpletest') !== FALSE) { - // Valid SimpleTest user-agent, log fatal errors to test specific file - // directory. The user-agent is validated in DRUPAL_BOOTSTRAP_DATABASE - // phase so as long as it is a SimpleTest user-agent it is valid. - ini_set('log_errors', 1); - ini_set('error_log', file_directory_path() . '/error.log'); - } - // Emit the correct charset HTTP header. drupal_set_header('Content-Type', 'text/html; charset=utf-8'); // Detect string handling method @@ -3593,6 +3584,14 @@ function _drupal_bootstrap_full() { module_load_all(); // Make sure all stream wrappers are registered. file_get_stream_wrappers(); + if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'simpletest') !== FALSE) { + // Valid SimpleTest user-agent, log fatal errors to test specific file + // directory. The user-agent is validated in DRUPAL_BOOTSTRAP_DATABASE + // phase so as long as it is a SimpleTest user-agent it is valid. + ini_set('log_errors', 1); + ini_set('error_log', file_directory_path() . '/error.log'); + } + // Let all modules take action before menu system handles the request // We do not want this while running update.php. if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { @@ -3767,7 +3766,7 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) $searchdir[] = "$config/$directory"; } - // If the database is not available, we can't use drupal_function_exists(), so + // If the database is not available, we can't use function_exists(), so // we load the file_scan_directory function definition manually. if (!function_exists('file_scan_directory')) { require_once DRUPAL_ROOT . '/includes/file.inc'; @@ -3957,7 +3956,7 @@ function drupal_render(&$elements) { // element is rendered into the final text. if (isset($elements['#pre_render'])) { foreach ($elements['#pre_render'] as $function) { - if (drupal_function_exists($function)) { + if (function_exists($function)) { $elements = $function($elements); } } @@ -3991,7 +3990,7 @@ function drupal_render(&$elements) { // which allows the output'ed text to be filtered. if (isset($elements['#post_render'])) { foreach ($elements['#post_render'] as $function) { - if (drupal_function_exists($function)) { + if (function_exists($function)) { $elements['#children'] = $function($elements['#children'], $elements); } } @@ -4120,6 +4119,7 @@ function element_info($type) { if (!isset($cache)) { $basic_defaults = element_basic_defaults(); $cache = array(); + foreach (module_implements('elements') as $module) { $elements = module_invoke($module, 'elements'); if (isset($elements) && is_array($elements)) { @@ -5055,3 +5055,32 @@ function drupal_check_incompatibility($v, $current_version) { } } } + +/** + * Performs one or more XML-RPC request(s). + * + * @param $url + * An absolute URL of the XML-RPC endpoint. + * Example: + * http://www.example.com/xmlrpc.php + * @param ... + * For one request: + * The method name followed by a variable number of arguments to the method. + * For multiple requests (system.multicall): + * An array of call arrays. Each call array follows the pattern of the single + * request: method name followed by the arguments to the method. + * @return + * For one request: + * Either the return value of the method on success, or FALSE. + * If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg(). + * For multiple requests: + * An array of results. Each result will either be the result + * returned by the method called, or an xmlrpc_error object if the call + * failed. See xmlrpc_error(). + */ +function xmlrpc($url) { + require_once DRUPAL_ROOT . '/includes/xmlrpc.inc'; + $args = func_get_args(); + return call_user_func_array('_xmlrpc', $args); +} + |