dmBridge PHP API
bootstrap.php
00001 <?php
00002 #
00003 # UNLVSpatial: a dmBridge module for spatial content
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("UNLVSpatialAutoloader");
00017 
00018 function UNLVSpatialAutoloader($class) {
00019    // All of our classes are prefixed with "UNLVSpatial" which is a handy way
00020    // of distinguishing them.
00021    if (substr($class, 0, 11) != "UNLVSpatial") {
00022       // We only want to autoload our own classes.
00023       return;
00024    }
00025    $prefix = dirname(__FILE__);
00026    $all_classes = array(
00027       'UNLVSpatial' => '',
00028       'UNLVSpatialAbstractSpatialObject' => 'models',
00029       'UNLVSpatialController' => 'controllers',
00030       'UNLVSpatialCPController' => 'controllers',
00031       'UNLVSpatialGenericDataStore' => 'system',
00032       'UNLVSpatialIndexer' => 'system',
00033       'UNLVSpatialJSONRepresentationV1' => 'output',
00034       'UNLVSpatialJSONPRepresentationV1' => 'output',
00035       'UNLVSpatialMySQLDataStore' => 'system',
00036       'UNLVSpatialObject' => 'models',
00037       'UNLVSpatialObjectFactory' => 'models',
00038       'UNLVSpatialPointObject' => 'models',
00039       'UNLVSpatialQuery' => 'models',
00040       'UNLVSpatialQueryTerm' => 'models',
00041       'UNLVSpatialRectObject' => 'models',
00042       'UNLVSpatialSQLiteDataStore' => 'system',
00043       'UNLVSpatialTemplateHelper' => 'template',
00044       'UNLVSpatialXMLRepresentationV1' => 'output'
00045    );
00046 
00047    if (array_key_exists($class, $all_classes)) {
00048       $path = $prefix . "/" . $all_classes[$class] . "/" . $class . ".php";
00049       if (include_once($path)) {
00050          return;
00051       }
00052    }
00053 }
 All Data Structures Functions Variables