Skip to content

Commit

Permalink
Fixes #10600, this should fix any issues with using the os x .app wit…
Browse files Browse the repository at this point in the history
…h mythweb.

Signed-off-by: Rob Smith <[email protected]>
  • Loading branch information
karog authored and kormoc committed Apr 7, 2013
1 parent 6b1671b commit 1e73a73
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions includes/class_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
function autoload($className) {
global $Path;
$className = str_replace('_', '/', $className);
if (file_exists("classes/$className.php")) {
if (file_exists("classes/$className.php"))
include_once "classes/$className.php";
return true;
}
foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) {
if (!file_exists("$path/$className.php"))
continue;
include_once "$path/$className.php";
return true;
}
if (file_exists(modules_path.'/'.module."/classes/$className.php"))
elseif (file_exists(modules_path.'/'.module."/classes/$className.php"))
include_once modules_path.'/'.module."/classes/$className.php";
elseif (file_exists(modules_path.'/'.$Path[1]."/classes/$className.php"))
include_once modules_path.'/'.$Path[1]."/classes/$className.php";
elseif (file_exists(modules_path.'/'.$Path[0]."/classes/$className.php"))
include_once modules_path.'/'.$Path[0]."/classes/$className.php";
else
else {
foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) {
if (!file_exists("$path/$className.php"))
continue;
include_once "$path/$className.php";
return true;
}
return false;
}
return true;
}

spl_autoload_register('autoload');

0 comments on commit 1e73a73

Please sign in to comment.