PluginProbe
CSS & JavaScript Toolbox / 7.2
CSS & JavaScript Toolbox v7.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | framework/autoload/loader.php +5 -42 11.87.2 View file →
@@ -14,15 +14,8 @@
14 14 */
15 15 class CJT_Framework_Autoload_Loader {
16 16
17 17 /**
18 - *
19 - *
20 - * @var mixed
21 - */
22 - protected static $instances = array();
23 -
24 - /**
25 18 * put your comment there...
26 19 *
27 20 * @var mixed
28 21 */
@@ -65,32 +58,18 @@
65 58 * @param mixed $prefix
66 59 * @param mixed $path
67 60 */
68 61 public static function autoLoad($prefix = null, $path = null) {
62 + // Hold all auto load instances.
63 + static $instances = array();
69 64 // Identify instances by prefixes!
70 - if (!isset(self::$instances[$prefix])) {
71 - self::$instances[$prefix] = new CJT_Framework_Autoload_Loader($prefix, $path);
65 + if (!isset($instances[$prefix])) {
66 + $instances[$prefix] = new CJT_Framework_Autoload_Loader($prefix, $path);
72 67 }
73 - return isset(self::$instances[$prefix]) ? self::$instances[$prefix] : null;
68 + return $instances[$prefix];
74 69 }
75 70
76 71 /**
77 - * Find ClassAutoloader instance used for loading specific class.
78 - *
79 - * The method is using Prefix algorithm for finding class autoloader
80 - *
81 - * @param mixed $className
82 - */
83 - public static function & findClassLoader($className) {
84 - # Getting class prefix
85 - $classComponents = explode('_', $className);
86 - $prefix = $classComponents[0];
87 - # Find autoloader
88 - $instance = isset(self::$instances[$prefix]) ? self::$instances[$prefix] : null;
89 - return $instance;
90 - }
91 -
92 - /**
93 72 * put your comment there...
94 73 *
95 74 * @param mixed $clsName
96 75 */
@@ -138,24 +117,8 @@
138 117 $component = $this->getClassComponent($name);
139 118 // Get class absolute path.
140 119 $path = $this->path . DIRECTORY_SEPARATOR . $component->path;
141 120 return $path . DIRECTORY_SEPARATOR . $file;
142 - }
143 -
144 - /**
145 - * put your comment there...
146 - *
147 - */
148 - public function getPath() {
149 - return $this->path;
150 - }
151 -
152 - /**
153 - * put your comment there...
154 - *
155 - */
156 - public function getPrefix() {
157 - return $this->prefix;
158 121 }
159 122
160 123 /**
161 124 * put your comment there...