113 $loaderClass = get_called_class();
114 $loader =
new $loaderClass($namespace,
$path);
115 if (is_array(
$path)) {
116 foreach (
$path as $pathdir) {
117 $loader->addNamespace($namespace, $pathdir);
120 $loader->addNamespace($namespace,
$path);
131 public function register()
133 spl_autoload_register(array($this,
'loadClass'));
150 $prefix = trim($prefix,
'\\') .
'\\';
157 if (isset($this->prefixes[$prefix]) ===
false) {
158 $this->prefixes[$prefix] = array();
163 array_unshift($this->prefixes[$prefix], $base_dir);
165 array_push($this->prefixes[$prefix], $base_dir);
184 while (
false !== $pos = strrpos($prefix,
'\\')) {
186 $prefix = substr($class, 0, $pos + 1);
189 $relative_class = substr($class, $pos + 1);
193 if ($mapped_file !==
false) {
199 $prefix = rtrim($prefix,
'\\');
218 if (isset($this->prefixes[$prefix]) ===
false) {
223 foreach ($this->prefixes[$prefix] as $base_dir) {
228 . str_replace(
'\\',
'/', $relative_class)
251 if (file_exists(
$file)) {
static addLoader($namespace, $path)
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
addNamespace($prefix, $base_dir, $prepend=false)
defined('DS') or define('DS' DIRECTORY_SEPARATOR
loadMappedFile($prefix, $relative_class)