PHP Classes
Icontem

File: autoload.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Lacher  >  Quickload  >  autoload.php  
File: autoload.php
Role: Auxiliary script
Content type: text/plain
Description: File invoking Quickload
Class: Quickload
Load classes from multiple directories
 

Contents

Class file image Download
<?php

// directory of this file
define('AUTOLOAD_PHP'dirname(__FILE__) . '/');

require_once(
AUTOLOAD_PHP 'classes/Quickload.class.php');

/*
 * all paths for Autoload::includePath and Autoload::excludePath must be absolute paths
 * use AUTOLOAD_PHP and a relative path to get an absolute path
 */


// define the paths in which classes can be found
Quickload::$includePath = array( AUTOLOAD_PHP .'example/classes',
                               
AUTOLOAD_PHP .'example/classes2'
                               
);

// define the paths which should not be searched for classes
Quickload::$excludePath = array( AUTOLOAD_PHP .'example/classes/tmp',
                               
AUTOLOAD_PHP .'example/classes2/tmp'
                               
);


function 
__autoload($class_name)
{
    
// get the path for the specified class
    
$path Quickload::getPath($class_name);
    
    
// include the class file
    
require_once($path);
}

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products