iwa-panda1

Manage Weather Data by International Weather Agency (Version 1)
Log | Files | Refs

autoloader.php (543B)


      1 <?php
      2 
      3 spl_autoload_register(function ($class_name) {
      4     if (DIRECTORY_SEPARATOR != "\\")
      5         $class_name = str_replace("\\", DIRECTORY_SEPARATOR, $class_name);
      6 
      7     $sr = DIRECTORY_SEPARATOR;
      8     $filename = $class_name . '.php';
      9     if (!file_exists($filename)) {
     10         $filename = 'classes' . $sr . $class_name . '.php';
     11         if (!file_exists($filename)) {
     12             return false;
     13         } else {
     14             include 'classes' . $sr . $class_name . '.php';
     15         }
     16     } else {
     17         include $class_name . '.php';
     18     }
     19 });