hanze/iwa-panda2

utils/autoloader.php in datatowebsite
Repositories | Summary | Log | Files | README.md

autoloader.php (539B) download


 1<?php
 2
 3spl_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 = 'Model' . $sr . $class_name . '.php';
11        if (!file_exists($filename)) {
12            return false;
13        } else {
14            include 'Model' . $sr . $class_name . '.php';
15        }
16    } else {
17        include $class_name . '.php';
18    }
19});