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

rework classloader

- make it available in config
- always use classloader, no manual require
- compatible for future composer alternative
This commit is contained in:
Elan Ruusamäe
2014-10-12 16:27:43 +03:00
parent 4b495f6ae0
commit 96da497e9c
16 changed files with 35 additions and 36 deletions

View File

@@ -4,7 +4,6 @@
$pathToLib = dirname(dirname(__DIR__)) . '/min/lib';
require "$pathToLib/Minify/Loader.php";
Minify_Loader::register();
$cli = new MrClay\Cli;

View File

@@ -4,7 +4,6 @@
$pathToLib = dirname(dirname(__DIR__)) . '/min/lib';
require "$min_libPath/Minify/Loader.php";
Minify_Loader::register();
$cli = new MrClay\Cli;

View File

@@ -4,9 +4,6 @@
require dirname(__FILE__) . '/../min/config.php';
require "$min_libPath/Minify/Loader.php";
Minify_Loader::register();
$minifyCachePath = isset($min_cachePath)
? $min_cachePath
: '';

View File

@@ -1,5 +1,7 @@
<?php
require dirname(__FILE__) . '/../../min/lib/Minify/Loader.php';
function getPost($key) {
return get_magic_quotes_gpc()
? stripslashes($_POST[$key])

View File

@@ -3,6 +3,8 @@
* Fetch and minify a URL (auto-detect HTML/JS/CSS)
*/
require dirname(__FILE__) . '/../../min/lib/Minify/Loader.php';
function getPost($key) {
if (! isset($_POST[$key])) {
return null;

View File

@@ -1,4 +1,7 @@
<?php
require dirname(__FILE__) . '/../../min/lib/Minify/Loader.php';
header('Content-Type: text/html;charset=utf-8');
function h($str) { return htmlspecialchars($str, ENT_QUOTES); }
@@ -55,4 +58,4 @@ if (isset($_POST['css'])) {
<p><label>input CSS: <textarea name="css" cols="80" rows="5"><?php echo h(getPost('css', $defaultCss)); ?></textarea></label></p>
<p><input type="submit" value="rewrite()" /></p>
</form>
<?php echo $out; ?>
<?php echo $out; ?>