Skip to content

Commit

Permalink
Allow definition of custom config directory.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sam Bauers committed Feb 3, 2014
1 parent 5560a66 commit aceef48
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions min/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -69,4 +75,4 @@
} else {
header("Location: /");
exit();
}
}

0 comments on commit aceef48

Please sign in to comment.