From ed1d2d9baf45d9de836eae813a260e3cebe29872 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 29 Sep 2015 11:29:05 -0400 Subject: [PATCH] Improve docs for Files controller --- lib/Minify/Controller/Files.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/Minify/Controller/Files.php b/lib/Minify/Controller/Files.php index 29cf712..23c54e0 100644 --- a/lib/Minify/Controller/Files.php +++ b/lib/Minify/Controller/Files.php @@ -9,20 +9,35 @@ * * E.g. the following would serve the minified Javascript for a site * - * Minify::serve('Files', array( - * 'files' => array( - * '//js/jquery.js' - * ,'//js/plugins.js' - * ,'/home/username/file.js' - * ) - * )); + * $options = [ + * 'checkAllowDirs' => false, // allow files to be anywhere + * ]; + * $sourceFactory = new Minify_Source_Factory($env, $options, $cache); + * $controller = new Minify_Controller_Files($env, $sourceFactory); + * $minify->serve($controller, [ + * 'files' => [ + * '//js/jquery.js', + * '//js/plugins.js', + * '/home/username/file.js', + * ], + * ]); * * * @package Minify * @author Stephen Clay */ class Minify_Controller_Files extends Minify_Controller_Base { - + + /** + * @param Minify_Env $env Environment + * @param Minify_Source_Factory $sourceFactory Source factory. If you need to serve files from any path, this + * component must have its "checkAllowDirs" option set to false. + */ + public function __construct(Minify_Env $env, Minify_Source_Factory $sourceFactory) + { + parent::__construct($env, $sourceFactory); + } + /** * Set up file sources *