ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables
autoload.php
Go to the documentation of this file.
1 <?php
2 
8 function __autoload($className)
9 {
10  if (strpos($className, '\\') === false)
11  return FALSE;
12  list($namespace, $class) = explode('\\', $className, 2);
13  $path = null;
14  switch ($namespace)
15  {
16  case "Entity":
17  $path = "core/models/{$class}.php"; break;
18  case "Tools":
19  $path = "core/tools/{$class}.php"; break;
20  case "Controller":
21  $path = "core/controllers/{$class}.php"; break;
22  case "Exception":
23  $path = "core/exceptions/{$class}.php"; break;
24  }
25  if (file_exists($path))
26  include_once ($path);
27  return $path;
28 }
29 
__autoload($className)
Definition: autoload.php:8