PHP Classes
elePHPant
Icontem

File: examples/library/lib/autoload.inc

Recommend this page to a friend!
  Classes of Victor Bolshov  >  Tiny PHP ORM Framework  >  examples/library/lib/autoload.inc  >  Download  
File: examples/library/lib/autoload.inc
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Tiny PHP ORM Framework
Map objects to databases using composed queries
Author: By
Last change: minor update
Date: 2 years ago
Size: 258 bytes
 

Contents

Class file image Download
<?php

spl_autoload_register
(function($class) {
    if (
0 === strpos($class, "library\\")) {
       
$namespaceStripped = substr($class, 8);
       
$path = __DIR__ . "/" . str_replace("\\", "/", $namespaceStripped) . ".php";
        include
$path;
    }
});