PHP Classes

File: autoloader.php

Recommend this page to a friend!
  Classes of Michal Kowalik   majkel PHP dbase class   autoloader.php   Download  
File: autoloader.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: majkel PHP dbase class
Create and manipulate databases in DBF format
Author: By
Last change: Update of autoloader.php
Date: 1 year ago
Size: 511 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: Micha? Kowalik <maf.michal@gmail.com>
 * Date: 21.08.16 11:42
 */

spl_autoload_register(function($class){

    if (!
preg_match('#^' . preg_quote('org\majkel\dbase\\') . '(.+)$#', $class, $m)) {
        return;
    }

   
$classPath = "{$m[1]}.php";

    if (
DIRECTORY_SEPARATOR !== '\\') {
       
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $classPath);
    }

    include_once
__DIR__ . DIRECTORY_SEPARATOR . "src" . DIRECTORY_SEPARATOR . $classPath;

});