Skip to content
Snippets Groups Projects
Commit 0f565387 authored by Tim Steiner's avatar Tim Steiner
Browse files

"Updates for new location of framework files"

parent aa72efb2
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,36 @@ class Nmc extends Nmc_Friendly ...@@ -15,6 +15,36 @@ class Nmc extends Nmc_Friendly
echo "ha ha!"; echo "ha ha!";
return parent::__get($key); return parent::__get($key);
} }
static public function loadApplicationClass($class, $dirs = null)
{
$nameParts = explode('_', $class);
if($nameParts[0] != 'Application') {
throw new Nmc_Exception('Not an Application Class.');
}
if (class_exists($class, false)) {
return;
}
// autodiscover the path from the class name
$path = str_replace('_', DIRECTORY_SEPARATOR, $class);
$path = substr($path, 12);
if ($dirs === null && $path != $class) {
// use the autodiscovered path
$dirs = dirname($path);
$file = basename($path) . '.php';
} else {
$file = $class . '.php';
}
self::loadFile($file, $dirs, true);
if (!class_exists($class, false)) {
throw new Zend_Exception("File \"$file\" was loaded "
. "but class \"$class\" was not found within.");
}
}
} }
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment