PHP Classes

File: Tool/View/index.php

Recommend this page to a friend!
  Classes of Tom Schaefer   Closure Table   Tool/View/index.php   Download  
File: Tool/View/index.php
Role: Auxiliary script
Content type: text/plain
Description: autoloader
Class: Closure Table
Manage transitive closure tables stored in MySQL
Author: By
Last change:
Date: 15 years ago
Size: 496 bytes
 

Contents

Class file image Download
<?php

function toolViewTableAutoload($class) {
    if (
substr($class, 0, strlen("Tool_View_")) === 'Tool_View_') {
       
$file = dirname(__FILE__).DIRECTORY_SEPARATOR.strtr(substr($class, strlen("Tool_View_")), '_', DIRECTORY_SEPARATOR).'.php';
        if(
is_file($file)) {
            include
$file;
        } else {
            throw new
Exception("autoloading of class $class impossible.");
        }
    }
}
spl_autoload_register('toolViewTableAutoload');
set_include_path(get_include_path().PATH_SEPARATOR.realpath(dirname(__FILE__)));