Login   Register  
PHP Classes
elePHPant
Icontem

File: Tool/ClosureTable/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  Closure Table  >  Tool/ClosureTable/index.php  >  Download  
File: Tool/ClosureTable/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: 2009-06-27 10:58
Size: 526 bytes
 

Contents

Class file image Download
<?php

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