dmBridge PHP API
bootstrap.php
00001 <?php
00002 #
00003 # UNLVHighlight: a dmBridge module for highlighting objects
00004 #
00005 # Copyright © 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00016 spl_autoload_register("UNLVHighlightAutoloader");
00017 
00018 function UNLVHighlightAutoloader($class) {
00019    // All of our classes are prefixed with "UNLVHighlight" which is a handy,
00020    // though long, way of distinguishing them. We only want to autoload our own
00021    // classes.
00022    if (substr($class, 0, 13) != "UNLVHighlight") {
00023       return;
00024    }
00025    $prefix = dirname(__FILE__);
00026    $all_classes = array(
00027       'UNLVHighlight' => '',
00028       'UNLVHighlightAddForm' => 'system',
00029       'UNLVHighlightController' => 'controllers',
00030       'UNLVHighlightCPController' => 'controllers',
00031       'UNLVHighlightDataStore' => 'system',
00032       'UNLVHighlightDataStoreFactory' => 'system',
00033       'UNLVHighlightGenericDataStore' => 'system',
00034       'UNLVHighlightMySQLDataStore' => 'system',
00035       'UNLVHighlightedObject' => 'system',
00036       'UNLVHighlightSQLiteDataStore' => 'system'
00037    );
00038 
00039    if (array_key_exists($class, $all_classes)) {
00040       $path = $prefix . "/" . $all_classes[$class] . "/" . $class . ".php";
00041       if (include_once($path)) {
00042          return;
00043       }
00044    }
00045 }
 All Data Structures Functions Variables