-
Notifications
You must be signed in to change notification settings - Fork 5
/
autoload.php
70 lines (45 loc) · 1.18 KB
/
autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* @package GZip Plugin
* @subpackage System.Gzip
* @copyright Copyright (C) 2005 - 2018 Thierry Bela.
*
* dual licensed
*
* @license LGPL v3
* @license MIT License
*/
defined('_JEXEC') or die;
require __DIR__.'/vendor/autoload.php';
spl_autoload_register(function ($name) {
if (strpos($name, '\\') === 0) {
$name = substr($name, 1);
}
$name = str_replace('\\', '/', $name);
switch(strtolower($name)):
case 'patchwork/jsqueeze':
require __DIR__.'/lib/JSqueeze.php';
break;
// case 'patchwork/cssmin':
//
// require __DIR__.'/lib/cssmin.php';
// break;
case 'gzip/gziphelper':
require __DIR__.'/helper.php';
break;
default:
if (stripos($name, 'gzip/helpers/') === 0) {
$path = preg_replace('#Helper$#i', '', substr($name, 13));
$file = __DIR__.'/helpers/'.$path.'.php';
if (is_file($file)) {
require $file;
break;
}
}
$file = __DIR__.'/lib/'.$name.'.php';
if(is_file($file)) {
require $file;
}
break;
endswitch;
});