1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-13 17:44:00 +02:00

Explain separate config storage in MIN.txt

This commit is contained in:
Sam Bauers
2014-02-04 12:13:33 +11:00
parent 719c22fca4
commit b8a0cac0e5

31
MIN.txt
View File

@@ -130,6 +130,37 @@ $cssUri = Minify_getUri(array(
echo "<link rel=stylesheet href='{$cssUri}'>";
STORING CONFIG FILES OUTSIDE THE MINIFY DIRECTORY
It is possible to store config files (config.php, config-test.php, groupsConfig.php)
in a custom directory outside the Minify directory. This is useful if you wish to
include Minify as an external dependency inside another project via SVN external or
Git submodule inclusion.
For example, let's assume you have a Minify directory "min" in your site root. Then
you could create a new directory called "min-configs" in the site root. Copy any
config files you wish to modify to "min-configs", and modify as desired.
Then create a new file, for example "min.php" in your site root. The contents of
this file could look like this:
<?php
define('MINIFY_CUSTOM_CONFIG_DIR', dirname(__FILE__) . '/min-configs');
include_once 'min/index.php';
You would then reference min.php in your JS and CSS links instead of min/index.php.
This method will also affect those using the Minify_getUri() function. You will need
to add options to calls to that function, e.g.:
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/min/utils.php';
$jsUri = Minify_getUri('//js/file.js', array('minAppUri' => '/min.php'));
echo "<script src='{$jsUri}'></script>";
DEBUG MODE
In debug mode, instead of compressing files, Minify sends combined files with