PHP Classes

File: autoloader.php

Recommend this page to a friend!
  Classes of Cedric Maenetja   Database Handler Package   autoloader.php   Download  
File: autoloader.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Database Handler Package
Prepare and execute SQL queries with MySQL
Author: By
Last change:
Date: 1 year ago
Size: 462 bytes
 

Contents

Class file image Download
<?php

    spl_autoload_register
(function ($class_name) {
       
// load classes with namespaces in lib
       
if (strpos ($class_name, '\\'))
        {
           
// load classes by namespaces
           
$class_name = str_replace ("\\", DIRECTORY_SEPARATOR, $class_name);
            include
'MySQL/'.$class_name . '.php';
        }
        else
        {
           
// load classes
           
include 'MySQL/'.$class_name . '.php';
        }
    });

?>