From aceef480c33d7126229258ab6c739319ee611c6b Mon Sep 17 00:00:00 2001 From: Sam Bauers Date: Mon, 3 Feb 2014 18:19:00 +1100 Subject: [PATCH] Allow definition of custom config directory. To allow "clean" checkouts of Minify we could use the possibility to define a custom config directory outside the minify directory. Using this patch a user can define MINIFY_CUSTOM_CONFIG_DIR on a new page outside the minify directory and then include minify's index.php on that page and point their rewrites etc. there instead. The config.php (and config-test.php) could be copied to the custom directory and edited without causing svn:external/git:submodule conflicts. --- min/index.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/min/index.php b/min/index.php index 79b047d..f9f994b 100644 --- a/min/index.php +++ b/min/index.php @@ -9,11 +9,17 @@ define('MINIFY_MIN_DIR', dirname(__FILE__)); +if (defined('MINIFY_CUSTOM_CONFIG_DIR')) { + define('MINIFY_CONFIG_DIR', MINIFY_CUSTOM_CONFIG_DIR); +} else { + define('MINIFY_CONFIG_DIR', MINIFY_MIN_DIR); +} + // load config -require MINIFY_MIN_DIR . '/config.php'; +require MINIFY_CONFIG_DIR . '/config.php'; if (isset($_GET['test'])) { - include MINIFY_MIN_DIR . '/config-test.php'; + include MINIFY_CONFIG_DIR . '/config-test.php'; } require "$min_libPath/Minify/Loader.php"; @@ -69,4 +75,4 @@ if (isset($_GET['f']) || isset($_GET['g'])) { } else { header("Location: /"); exit(); -} \ No newline at end of file +}