mirror of
https://github.com/mrclay/minify.git
synced 2025-08-12 00:54:35 +02:00
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.
This commit is contained in:
@@ -9,11 +9,17 @@
|
|||||||
|
|
||||||
define('MINIFY_MIN_DIR', dirname(__FILE__));
|
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
|
// load config
|
||||||
require MINIFY_MIN_DIR . '/config.php';
|
require MINIFY_CONFIG_DIR . '/config.php';
|
||||||
|
|
||||||
if (isset($_GET['test'])) {
|
if (isset($_GET['test'])) {
|
||||||
include MINIFY_MIN_DIR . '/config-test.php';
|
include MINIFY_CONFIG_DIR . '/config-test.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
require "$min_libPath/Minify/Loader.php";
|
require "$min_libPath/Minify/Loader.php";
|
||||||
|
Reference in New Issue
Block a user