Skip to content

Commit

Permalink
Allow user-defined autoload function
Browse files Browse the repository at this point in the history
  • Loading branch information
bcosca committed Sep 29, 2014
1 parent e1ba912 commit 087f832
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1606,13 +1606,9 @@ function rel($url) {
**/
protected function autoload($class) {
$class=$this->fixslashes(ltrim($class,'\\'));
$path=$this->hive['AUTOLOAD'];
$func=NULL;
if (is_array($path))
list($path,$func)=$path;
foreach ($this->split($this->hive['PLUGINS'].';'.$path) as $auto)
if ($func && $auto.$func($class) ||
is_file($file=$auto.$class.'.php') ||
foreach ($this->split($this->hive['PLUGINS'].';'.
$this->hive['AUTOLOAD']) as $auto)
if (is_file($file=$auto.$class.'.php') ||
is_file($file=$auto.strtolower($class).'.php') ||
is_file($file=strtolower($auto.$class).'.php'))
return require($file);
Expand Down

0 comments on commit 087f832

Please sign in to comment.