Skip to content

Commit

Permalink
Explain separate config storage in MIN.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Bauers committed Feb 4, 2014
1 parent 719c22f commit b8a0cac
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion MIN.txt
Expand Up @@ -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
Expand All @@ -142,4 +173,4 @@ Known issue: files with comment-like strings/regexps can cause problems in this

QUESTIONS?

http://groups.google.com/group/minify
http://groups.google.com/group/minify

0 comments on commit b8a0cac

Please sign in to comment.