[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_1RC1-1141-g7b75439
Michal Čihař
nijel at users.sourceforge.net
Wed Mar 31 12:29:32 CEST 2010
The branch, master has been updated
via 7b754395e9b2fa7eb231f6aedb6ba88f9be55925 (commit)
via a6371c10d56cbcbe5d6dfb2562cd9f3674994810 (commit)
from dc50f8bac53cb9954a86df063bbbbea7bf51edc2 (commit)
- Log -----------------------------------------------------------------
commit 7b754395e9b2fa7eb231f6aedb6ba88f9be55925
Author: Michal Čihař <mcihar at novell.com>
Date: Wed Mar 31 12:29:21 2010 +0200
Provide way for vendors to easily change paths to config files.
commit a6371c10d56cbcbe5d6dfb2562cd9f3674994810
Author: Michal Čihař <mcihar at novell.com>
Date: Wed Mar 31 12:20:44 2010 +0200
Remove Id.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
README.VENDOR | 2 --
libraries/auth/cookie.auth.lib.php | 10 +++++-----
libraries/auth/http.auth.lib.php | 8 ++++----
libraries/common.inc.php | 4 ++--
libraries/footer.inc.php | 4 ++--
libraries/header.inc.php | 4 ++--
libraries/vendor_config.php | 21 +++++++++++++++++++++
show_config_errors.php | 4 +++-
9 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 23198f2..165dd4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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/README.VENDOR b/README.VENDOR
index 5f824af..3da155c 100644
--- a/README.VENDOR
+++ b/README.VENDOR
@@ -1,5 +1,3 @@
-$Id: README 10967 2007-12-08 12:46:36Z lem9 $
-
phpMyAdmin - hints for distributing phpMyAdmin
==============================================
diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php
index 2ae3d2f..0ea4a81 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 af1b353..8d67cb4 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 fd4f3d1..a81d197 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 09f8d5c..7f7f344 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 18a327b..324852b 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 90e8a35..35b6dea 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 e9bb4e5..8b1cd18 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;
?>
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list