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:
Date: 4 years 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;

});


For more information send a message to info at phpclasses dot org.