All Data Structures Namespaces Files Functions Variables
autoload.php File Reference

Go to the source code of this file.

## Functions

| __autoload ($className)

## Function Documentation

__autoload | ( |  | $className | ) |

Load classes from core directories

Parameters

  string | $classname | Class to load

Returns
  file path loaded

Definition at line 8 of file autoload.php.

{
if (strpos($className, '\\') === false)
return FALSE;
list($namespace, $class) = explode('\\', $className, 2);
$path = null;
switch ($namespace)
{
case "Entity":
$path = "core/models/{$class}.php"; break;
case "Tools":
$path = "core/tools/{$class}.php"; break;
case "Controller":
$path = "core/controllers/{$class}.php"; break;
case "Exception":
$path = "core/exceptions/{$class}.php"; break;
}
if (file_exists($path))
include_once ($path);
return $path;
}