diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | README.VENDOR | 14 | ||||
-rw-r--r-- | changelog.php | 19 | ||||
-rw-r--r-- | libraries/Config.class.php | 8 | ||||
-rw-r--r-- | license.php | 7 | ||||
-rw-r--r-- | setup/lib/config_info.inc.php | 11 | ||||
-rw-r--r-- | setup/lib/index.lib.php | 14 |
7 files changed, 61 insertions, 13 deletions
@@ -6,6 +6,7 @@ $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ 3.2.0.0 (not yet released) +- [core] better support for vendor customisation (based on what Debian needs) 3.1.1.0 (not yet released) - patch #2242765 [core] Navi panel server links wrong, diff --git a/README.VENDOR b/README.VENDOR index d241829958..2b2e92d96d 100644 --- a/README.VENDOR +++ b/README.VENDOR @@ -8,14 +8,12 @@ redistribute phpMyAdmin inside other software package such as Linux distribution or some all in one package including web server and MySQL server. +Generally you can customize some basic aspects (paths to some files and +behavior) in libraries/vendor_config.php. -Setup script ------------- - -If you want to integrate setup script to your packaging, you might want -to change $cfg_db['_config_file_path'] in setup/lib/config_info.inc.php -to point to place where you want to generated config file to be saved. -Please note that directory and the file has to be writable for web -server user. +For example if you want setup script to generate config file in var, +change SETUP_CONFIG_FILE to /var/lib/phpmyadmin/config.inc.php and you +will also probably want to skip directory writable check, so set +SETUP_DIR_WRITABLE to false. # vim: et ts=4 sw=4 sts=4 tw=72 spell spelllang=en_us diff --git a/changelog.php b/changelog.php index 2066b2c1bc..f38832277a 100644 --- a/changelog.php +++ b/changelog.php @@ -8,9 +8,26 @@ */ /** + * Load paths. + */ +require('./libraries/vendor_config.php'); + +/** + * Read changelog. + */ +if (substr(CHANGELOG_FILE, -3) == '.gz') { + ob_start(); + readgzfile(CHANGELOG_FILE); + $changelog = ob_get_contents(); + ob_end_clean(); +} else { + $changelog = file_get_contents(CHANGELOG_FILE); +} + +/** * Whole changelog in variable. */ -$changelog = htmlspecialchars(file_get_contents('ChangeLog')); +$changelog = htmlspecialchars($changelog); $replaces = array( '@(http://[./a-zA-Z0-9.-]*[/a-zA-Z0-9])@' diff --git a/libraries/Config.class.php b/libraries/Config.class.php index b2d17c1769..2c443eb326 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -8,6 +8,11 @@ */ /** + * Load vendor configuration. + */ +require_once('./libraries/vendor_config.php'); + +/** * Configuration class * * @package phpMyAdmin @@ -300,7 +305,8 @@ class PMA_Config */ function __wakeup() { - if (! $this->checkConfigSource() + if (SKIP_MTIME_CONFIG_CHECK + || ! $this->checkConfigSource() || $this->source_mtime !== filemtime($this->getSource()) || $this->default_source_mtime !== filemtime($this->default_source) || $this->error_config_file diff --git a/license.php b/license.php index 0f03fcdbb3..029461129b 100644 --- a/license.php +++ b/license.php @@ -11,8 +11,13 @@ */ /** + * Load paths. + */ +require('./libraries/vendor_config.php'); + +/** * */ header('Content-type: text/plain; charset=iso-8859-1'); -readfile('LICENSE'); +readfile(LICENSE_FILE); ?> diff --git a/setup/lib/config_info.inc.php b/setup/lib/config_info.inc.php index 866dc74375..b57ea00680 100644 --- a/setup/lib/config_info.inc.php +++ b/setup/lib/config_info.inc.php @@ -12,10 +12,19 @@ * @version $Id$ */ +if (!defined('PHPMYADMIN')) { + exit; +} + +/** + * Load paths. + */ +require_once('./libraries/vendor_config.php'); + $cfg_db = array(); // path to config file, relative to phpMyAdmin's root path -$cfg_db['_config_file_path'] = './config/config.inc.php'; +$cfg_db['_config_file_path'] = SETUP_CONFIG_FILE; /** * Value meaning: diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php index eb4063000a..c3ab5f806f 100644 --- a/setup/lib/index.lib.php +++ b/setup/lib/index.lib.php @@ -12,6 +12,15 @@ * @version $Id$ */ +if (!defined('PHPMYADMIN')) { + exit; +} + +/** + * Load vendor config. + */ +require_once('./libraries/vendor_config.php'); + /** * Initializes message list */ @@ -223,7 +232,10 @@ function check_config_rw(&$is_readable, &$is_writable, &$file_exists) $file_path = ConfigFile::getInstance()->getFilePath(); $file_dir = dirname($file_path); $is_readable = true; - $is_writable = is_dir($file_dir) && is_writable($file_dir); + $is_writable = is_dir($file_dir); + if (SETUP_DIR_WRITABLE) { + $is_writable = $is_writable && is_writable($file_dir); + } $file_exists = file_exists($file_path); if ($file_exists) { $is_readable = is_readable($file_path); |