diff options
author | Michal Čihař <mcihar@novell.com> | 2010-03-31 14:29:21 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@novell.com> | 2010-03-31 14:29:21 +0400 |
commit | 7b754395e9b2fa7eb231f6aedb6ba88f9be55925 (patch) | |
tree | 1560f539b2686d9d9c5d33b747fad92085dd0a78 | |
parent | a6371c10d56cbcbe5d6dfb2562cd9f3674994810 (diff) |
Provide way for vendors to easily change paths to config files.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libraries/auth/cookie.auth.lib.php | 10 | ||||
-rw-r--r-- | libraries/auth/http.auth.lib.php | 8 | ||||
-rw-r--r-- | libraries/common.inc.php | 4 | ||||
-rw-r--r-- | libraries/footer.inc.php | 4 | ||||
-rw-r--r-- | libraries/header.inc.php | 4 | ||||
-rw-r--r-- | libraries/vendor_config.php | 21 | ||||
-rw-r--r-- | show_config_errors.php | 4 |
8 files changed, 40 insertions, 16 deletions
@@ -56,6 +56,7 @@ $Id$ Martynas Mickevičius + patch #2967320 [designer] Colored relations based on the primary key, thanks to GreenRover - greenrover +- [core] Provide way for vendors to easily change paths to config files. 3.3.2.0 (not yet released) - patch #2969449 [core] Name for MERGE engine varies depending on the diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 2ae3d2fd45..0ea4a81663 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -199,8 +199,8 @@ if (top != self) { <body class="loginform"> <?php - if (file_exists('./config.header.inc.php')) { - require './config.header.inc.php'; + if (file_exists(CUSTOM_HEADER_FILE)) { + require CUSTOM_HEADER_FILE; } ?> @@ -343,8 +343,8 @@ window.setTimeout('PMA_focusInput()', 500); // ]]> </script> <?php - if (file_exists('./config.footer.inc.php')) { - require './config.footer.inc.php'; + if (file_exists(CUSTOM_FOOTER_FILE)) { + require CUSTOM_FOOTER_FILE; } ?> </body> @@ -682,7 +682,7 @@ function PMA_auth_fails() } } } elseif (PMA_DBI_getError()) { - $conn_error = '#' . $GLOBALS['errno'] . ' ' . $GLOBALS['strCannotLogin']; + $conn_error = '#' . $GLOBALS['errno'] . ' ' . $GLOBALS['strCannotLogin']; } else { $conn_error = $GLOBALS['strCannotLogin']; } diff --git a/libraries/auth/http.auth.lib.php b/libraries/auth/http.auth.lib.php index af1b353b89..8d67cb4ca1 100644 --- a/libraries/auth/http.auth.lib.php +++ b/libraries/auth/http.auth.lib.php @@ -55,8 +55,8 @@ function PMA_auth() </head> <body> <?php - if (file_exists('./config.header.inc.php')) { - require './config.header.inc.php'; + if (file_exists(CUSTOM_HEADER_FILE)) { + require CUSTOM_HEADER_FILE; } ?> @@ -69,8 +69,8 @@ function PMA_auth() <?php PMA_Message::error('strWrongUser')->display(); - if (file_exists('./config.footer.inc.php')) { - require './config.footer.inc.php'; + if (file_exists(CUSTOM_FOOTER_FILE)) { + require CUSTOM_FOOTER_FILE; } ?> diff --git a/libraries/common.inc.php b/libraries/common.inc.php index fd4f3d1cb2..a81d1970d7 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -288,7 +288,7 @@ if (! function_exists('preg_replace')) { * force reading of config file, because we removed sensitive values * in the previous iteration */ -$GLOBALS['PMA_Config'] = new PMA_Config('./config.inc.php'); +$GLOBALS['PMA_Config'] = new PMA_Config(CONFIG_FILE); if (!defined('PMA_MINIMUM_COMMON')) { $GLOBALS['PMA_Config']->checkPmaAbsoluteUri(); @@ -589,7 +589,7 @@ require_once './libraries/select_lang.lib.php'; if ($GLOBALS['PMA_Config']->error_config_file) { $error = $strConfigFileError . '<br /><br />' - . ($GLOBALS['PMA_Config']->getSource() == './config.inc.php' ? + . ($GLOBALS['PMA_Config']->getSource() == CONFIG_FILE ? '<a href="show_config_errors.php"' .' target="_blank">' . $GLOBALS['PMA_Config']->getSource() . '</a>' : diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php index 09f8d5cee0..7f7f34400f 100644 --- a/libraries/footer.inc.php +++ b/libraries/footer.inc.php @@ -200,8 +200,8 @@ setURLHash("<?php echo PMA_generate_common_url($url_params, 'text', ''); ?>"); } // Include possible custom footers -if (file_exists('./config.footer.inc.php')) { - require './config.footer.inc.php'; +if (file_exists(CUSTOM_FOOTER_FILE)) { + require CUSTOM_FOOTER_FILE; } diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 18a327b489..324852b86d 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -47,8 +47,8 @@ if (empty($GLOBALS['is_header_sent'])) { <?php // Include possible custom headers - if (file_exists('./config.header.inc.php')) { - require './config.header.inc.php'; + if (file_exists(CUSTOM_HEADER_FILE)) { + require CUSTOM_HEADER_FILE; } diff --git a/libraries/vendor_config.php b/libraries/vendor_config.php index 90e8a35382..35b6dea377 100644 --- a/libraries/vendor_config.php +++ b/libraries/vendor_config.php @@ -34,4 +34,25 @@ define('SETUP_CONFIG_FILE', './config/config.inc.php'); */ define('SETUP_DIR_WRITABLE', true); +/** + * Directory where configuration files are stored. + * It is not used directly in code, just a convenient + * define used further in this file. + */ +define('CONFIG_DIR', './'); + +/** + * Filename of a configuration file. + */ +define('CONFIG_FILE', CONFIG_DIR . 'config.inc.php'); + +/** + * Filename of custom header file. + */ +define('CUSTOM_HEADER_FILE', CONFIG_DIR . 'config.header.inc.php'); + +/** + * Filename of custom footer file. + */ +define('CUSTOM_FOOTER_FILE', CONFIG_DIR . 'config.footer.inc.php'); ?> diff --git a/show_config_errors.php b/show_config_errors.php index e9bb4e5b62..8b1cd187e3 100644 --- a/show_config_errors.php +++ b/show_config_errors.php @@ -7,12 +7,14 @@ * @package phpMyAdmin */ +require './libraries/vendor_config.php'; + echo "Starting to parse config file...\n"; error_reporting(E_ALL); /** * Read config file. */ -require './config.inc.php'; +require CONFIG_FILE; ?> |