Commit 013b73e6 authored by Dries's avatar Dries

- Patch #30122 by m3verick: changed include_once()'s to include "./$file"

  for performance's sake.
parent 451dbd17
......@@ -6,7 +6,7 @@
* Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
*/
include_once 'includes/bootstrap.inc';
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
// If not in 'safe mode', increase the maximum execution time:
......
......@@ -545,7 +545,7 @@ function update_132() {
/**
* Wipe the search index
*/
include_once('modules/search.module');
include_once './modules/search.module';
search_wipe();
}
......
......@@ -460,7 +460,7 @@ function drupal_load($type, $name) {
$filename = drupal_get_filename($type, $name);
if ($filename) {
include_once($filename);
include_once "./$filename";
$files[$type][$name] = TRUE;
return TRUE;
......
......@@ -110,10 +110,10 @@ function db_set_active($name = 'default') {
}
$db_type = substr($connect_url, 0, strpos($connect_url, '://'));
$handler = "includes/database.$db_type.inc";
$handler = "./includes/database.$db_type.inc";
if (is_file($handler)) {
include_once($handler);
include_once $handler;
}
else {
drupal_maintenance_theme();
......
......@@ -11,7 +11,7 @@ function image_get_available_toolkits() {
$output = array();
foreach ($toolkits as $file => $toolkit) {
include_once($file);
include_once "./$file";
$function = str_replace('.', '_', $toolkit->name) .'_info';
if (function_exists($function)) {
$info = $function();
......@@ -31,7 +31,7 @@ function image_get_toolkit() {
static $toolkit;
if (!$toolkit) {
$toolkit = variable_get('image_toolkit', 'gd');
$toolkit_file = 'includes/image.'.$toolkit.'.inc';
$toolkit_file = './includes/image.'.$toolkit.'.inc';
if ($toolkit != 'gd' && file_exists($toolkit_file)) {
include_once $toolkit_file;
}
......
......@@ -68,11 +68,11 @@ function init_theme() {
if (strpos($themes[$theme]->filename, '.theme')) {
// file is a theme; include it
include_once($themes[$theme]->filename);
include_once './' . $themes[$theme]->filename;
}
elseif (strpos($themes[$theme]->description, '.engine')) {
// file is a template; include its engine
include_once($themes[$theme]->description);
include_once './' . $themes[$theme]->description;
$theme_engine = basename($themes[$theme]->description, '.engine');
if (function_exists($theme_engine .'_init')) {
call_user_func($theme_engine .'_init', $themes[$theme]);
......
......@@ -258,7 +258,7 @@ function locale_get_plural($count) {
* Page handler for the language management screen
*/
function locale_admin_manage() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
if ($_POST['op'] == t('Save configuration')) {
......@@ -290,7 +290,7 @@ function locale_admin_manage() {
* User interface for the language deletion confirmation screen
*/
function locale_admin_manage_delete_screen() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$langcode = arg(4);
$edit = $_POST['edit'];
......@@ -334,7 +334,7 @@ function locale_admin_manage_delete_screen() {
* Page handler for the language addition screen
*/
function locale_admin_manage_add() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
$isocodes = _locale_get_iso639_list();
......@@ -374,7 +374,7 @@ function locale_admin_manage_add() {
* Page handler for the translation import screen
*/
function locale_admin_import() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
switch ($_POST['op']) {
case t('Import'):
......@@ -408,7 +408,7 @@ function locale_admin_import() {
* Page handler for the translation export screen
*/
function locale_admin_export() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
switch ($_POST['op']) {
case t('Export'):
_locale_export_po($_POST['edit']['langcode']);
......@@ -425,7 +425,7 @@ function locale_admin_export() {
* Page handler for the string search and administration screen
*/
function locale_admin_string() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$op = ($_POST['op'] ? $_POST['op'] : arg(3));
$edit =& $_POST['edit'];
......
......@@ -258,7 +258,7 @@ function locale_get_plural($count) {
* Page handler for the language management screen
*/
function locale_admin_manage() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
if ($_POST['op'] == t('Save configuration')) {
......@@ -290,7 +290,7 @@ function locale_admin_manage() {
* User interface for the language deletion confirmation screen
*/
function locale_admin_manage_delete_screen() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$langcode = arg(4);
$edit = $_POST['edit'];
......@@ -334,7 +334,7 @@ function locale_admin_manage_delete_screen() {
* Page handler for the language addition screen
*/
function locale_admin_manage_add() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
$isocodes = _locale_get_iso639_list();
......@@ -374,7 +374,7 @@ function locale_admin_manage_add() {
* Page handler for the translation import screen
*/
function locale_admin_import() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$edit = &$_POST['edit'];
switch ($_POST['op']) {
case t('Import'):
......@@ -408,7 +408,7 @@ function locale_admin_import() {
* Page handler for the translation export screen
*/
function locale_admin_export() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
switch ($_POST['op']) {
case t('Export'):
_locale_export_po($_POST['edit']['langcode']);
......@@ -425,7 +425,7 @@ function locale_admin_export() {
* Page handler for the string search and administration screen
*/
function locale_admin_string() {
include_once 'includes/locale.inc';
include_once './includes/locale.inc';
$op = ($_POST['op'] ? $_POST['op'] : arg(3));
$edit =& $_POST['edit'];
......
......@@ -392,13 +392,13 @@ function system_region_list($theme_key) {
return $list[$theme_key];
}
if (file_exists($file = dirname($theme->filename) .'/' . $theme_key . '.theme')) {
include_once($file);
include_once "./$file";
}
$regions = function_exists($theme_key . '_regions') ? call_user_func($theme_key . '_regions') : array();
if (strpos($theme->description, '.engine')) {
// File is a template; include its engine's regions.
include_once($theme->description);
include_once './' . $theme->description;
$theme_engine = basename($theme->description, '.engine');
$engine_regions = function_exists($theme_engine . '_regions') ? call_user_func($theme_engine . '_regions') : array();
$regions = array_merge($engine_regions, $regions);
......
......@@ -392,13 +392,13 @@ function system_region_list($theme_key) {
return $list[$theme_key];
}
if (file_exists($file = dirname($theme->filename) .'/' . $theme_key . '.theme')) {
include_once($file);
include_once "./$file";
}
$regions = function_exists($theme_key . '_regions') ? call_user_func($theme_key . '_regions') : array();
if (strpos($theme->description, '.engine')) {
// File is a template; include its engine's regions.
include_once($theme->description);
include_once './' . $theme->description;
$theme_engine = basename($theme->description, '.engine');
$engine_regions = function_exists($theme_engine . '_regions') ? call_user_func($theme_engine . '_regions') : array();
$regions = array_merge($engine_regions, $regions);
......
......@@ -370,7 +370,7 @@ function user_is_blocked($name) {
*/
function user_mail($mail, $subject, $message, $header) {
if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) {
include_once variable_get('smtp_library', '');
include_once './' . variable_get('smtp_library', '');
return user_mail_wrapper($mail, $subject, $message, $header);
}
else {
......
......@@ -370,7 +370,7 @@ function user_is_blocked($name) {
*/
function user_mail($mail, $subject, $message, $header) {
if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) {
include_once variable_get('smtp_library', '');
include_once './' . variable_get('smtp_library', '');
return user_mail_wrapper($mail, $subject, $message, $header);
}
else {
......
......@@ -9,7 +9,7 @@
function phptemplate_init($template) {
$file = dirname($template->filename) . '/template.php';
if (file_exists($file)) {
include_once($file);
include_once "./$file";
}
}
......@@ -333,7 +333,7 @@ function _phptemplate_default($hook, $variables, $file = NULL) {
if ($file) {
extract($variables, EXTR_SKIP); // Extract the vars to local namespace
ob_start(); // Start output buffering
include($file); // Include the file
include "./$file"; // Include the file
$contents = ob_get_contents(); // Get the contents of the buffer
ob_end_clean(); // End buffering and discard
return $contents; // Return the contents
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment