PHP Classes
elePHPant
Icontem

File: Autoload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of MARY Matthieu  >  Google_Query  >  Autoload.php  >  Download  
File: Autoload.php
Role: Auxiliary script
Content type: text/plain
Description: loader
Class: Google_Query
Retrieve the count of results of Google query
Author: By
Last change:
Date: 7 years ago
Size: 963 bytes
 

Contents

Class file image Download
<?php
/**
 * $Id: Autoload.php 1595 2007-05-03 20:11:32Z matthieu $
 */
if (!function_exists('__autoload')) {
   
/**
     * load class
     * @param string $className : the class to load
     * @throw Exception
     */
   
function __autoload($className) {
        if (
class_exists('Zend', false)) {
            if (
is_int(strrpos($className, '_Interface'))) {
               
Zend :: loadClass($className);
            } else {
               
Zend :: loadInterface($className);
            }
        } else {
            if (!
defined('__CLASS_PATH__')) {
               
define('__CLASS_PATH__', realpath(dirname(__FILE__)));
            }
           
$file = __CLASS_PATH__ . '/' . str_replace('_', '/', $className) . '.php';
            if (!
file_exists($file)) {
                throw new
Exception('Cannot load class file ' . $className);
            } else {
                require_once
$file;
            }
        }
    }
}