33
33
*/
34
34
class CssMin
35
35
{
36
- /**
37
- * Index of classes
38
- *
39
- * @var array
40
- */
41
- private static $ classIndex = array ();
42
36
/**
43
37
* Parse/minify errors
44
38
*
@@ -59,10 +53,7 @@ class CssMin
59
53
*/
60
54
public static function autoload ($ class )
61
55
{
62
- if (isset (self ::$ classIndex [$ class ]))
63
- {
64
- require (self ::$ classIndex [$ class ]);
65
- }
56
+ // Do nothing, this is a Composer library
66
57
}
67
58
/**
68
59
* Return errors
@@ -89,46 +80,7 @@ public static function hasErrors()
89
80
*/
90
81
public static function initialise ()
91
82
{
92
- // Create the class index for autoloading or including
93
- $ paths = array (dirname (__FILE__ ));
94
- while (list ($ i , $ path ) = each ($ paths ))
95
- {
96
- $ subDirectorys = glob ($ path . "* " , GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT );
97
- if (is_array ($ subDirectorys ))
98
- {
99
- foreach ($ subDirectorys as $ subDirectory )
100
- {
101
- $ paths [] = $ subDirectory ;
102
- }
103
- }
104
- $ files = glob ($ path . "*.php " , 0 );
105
- if (is_array ($ files ))
106
- {
107
- foreach ($ files as $ file )
108
- {
109
- $ class = substr (basename ($ file ), 0 , -4 );
110
- self ::$ classIndex [$ class ] = $ file ;
111
- }
112
- }
113
- }
114
- krsort (self ::$ classIndex );
115
- // Only use autoloading if spl_autoload_register() is available and no __autoload() is defined (because
116
- // __autoload() breaks if spl_autoload_register() is used.
117
- if (function_exists ("spl_autoload_register " ) && !is_callable ("__autoload " ))
118
- {
119
- spl_autoload_register (array (__CLASS__ , "autoload " ));
120
- }
121
- // Otherwise include all class files
122
- else
123
- {
124
- foreach (self ::$ classIndex as $ class => $ file )
125
- {
126
- if (!class_exists ($ class ))
127
- {
128
- require_once ($ file );
129
- }
130
- }
131
- }
83
+ // Do nothing, this is a Composer library
132
84
}
133
85
/**
134
86
* Minifies CSS source.
@@ -183,6 +135,4 @@ public static function triggerError(CssError $error)
183
135
}
184
136
}
185
137
}
186
- // Initialises CssMin
187
- CssMin::initialise ();
188
138
?>
0 commit comments