Skip to content

Commit c3f1a42

Browse files
committed
Remove CssMin autoloader
1 parent ec738a2 commit c3f1a42

File tree

1 file changed

+2
-52
lines changed

1 file changed

+2
-52
lines changed

src/CssMin.php

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@
3333
*/
3434
class CssMin
3535
{
36-
/**
37-
* Index of classes
38-
*
39-
* @var array
40-
*/
41-
private static $classIndex = array();
4236
/**
4337
* Parse/minify errors
4438
*
@@ -59,10 +53,7 @@ class CssMin
5953
*/
6054
public static function autoload($class)
6155
{
62-
if (isset(self::$classIndex[$class]))
63-
{
64-
require(self::$classIndex[$class]);
65-
}
56+
// Do nothing, this is a Composer library
6657
}
6758
/**
6859
* Return errors
@@ -89,46 +80,7 @@ public static function hasErrors()
8980
*/
9081
public static function initialise()
9182
{
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
13284
}
13385
/**
13486
* Minifies CSS source.
@@ -183,6 +135,4 @@ public static function triggerError(CssError $error)
183135
}
184136
}
185137
}
186-
// Initialises CssMin
187-
CssMin::initialise();
188138
?>

0 commit comments

Comments
 (0)