dmBridge PHP API
bootstrap.php
00001 <?php
00002 #
00003 # UNLVRandom: a dmBridge module for random 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("UNLVRandomAutoloader");
00017 
00018 function UNLVRandomAutoloader($class) {
00019    // All of our classes are prefixed with "UNLVRandom" 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, 10) != "UNLVRandom") {
00023       return;
00024    }
00025    $prefix = dirname(__FILE__);
00026    $all_classes = array(
00027       'UNLVRandom' => '',
00028       'UNLVRandomAddForm' => 'system',
00029       'UNLVRandomController' => 'controllers',
00030       'UNLVRandomCPController' => 'controllers',
00031       'UNLVRandomDataStore' => 'system',
00032       'UNLVRandomDataStoreFactory' => 'system',
00033       'UNLVRandomMySQLDataStore' => 'system',
00034       'UNLVRandomObject' => 'system',
00035       'UNLVRandomSQLiteDataStore' => 'system'
00036    );
00037 
00038    if (array_key_exists($class, $all_classes)) {
00039       $path = $prefix . "/" . $all_classes[$class] . "/" . $class . ".php";
00040       if (include_once($path)) {
00041          return;
00042       }
00043    }
00044 }
 All Data Structures Functions Variables