mirror of
https://github.com/mrclay/minify.git
synced 2025-08-08 15:16:56 +02:00
+ shortcut for specifying files in doc_root
This commit is contained in:
@@ -11,11 +11,10 @@ require_once 'Minify/Controller/Base.php';
|
||||
* by PATH_INFO
|
||||
*
|
||||
* <code>
|
||||
* $dr = $_SERVER['DOCUMENT_ROOT'];
|
||||
* Minify::serve('Groups', array(
|
||||
* 'groups' => array(
|
||||
* 'css' => array($dr . '/css/type.css', $dr . '/css/layout.css')
|
||||
* ,'js' => array($dr . '/js/jquery.js', $dr . '/js/site.js')
|
||||
* 'css' => array('//css/type.css', '//css/layout.css')
|
||||
* ,'js' => array('//js/jquery.js', '//js/site.js')
|
||||
* )
|
||||
* ));
|
||||
* </code>
|
||||
@@ -23,6 +22,9 @@ require_once 'Minify/Controller/Base.php';
|
||||
* If the above code were placed in /serve.php, it would enable the URLs
|
||||
* /serve.php/js and /serve.php/css
|
||||
*
|
||||
* As a shortcut, the controller will replace "//" at the beginning
|
||||
* of a filename with $_SERVER['DOCUMENT_ROOT'] . '/'.
|
||||
*
|
||||
* @package Minify
|
||||
* @author Stephen Clay <steve@mrclay.org>
|
||||
*/
|
||||
@@ -55,6 +57,9 @@ class Minify_Controller_Groups extends Minify_Controller_Base {
|
||||
$sources[] = $file;
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($file, '//')) {
|
||||
$file = $_SERVER['DOCUMENT_ROOT'] . substr($file, 1);
|
||||
}
|
||||
$file = realpath($file);
|
||||
if (file_exists($file)) {
|
||||
$sources[] = new Minify_Source(array(
|
||||
|
Reference in New Issue
Block a user