Skip to content
Snippets Groups Projects
Select Git revision
  • 0f56538795061eb81e4c49392f49fc9c89c63225
  • master default
  • shib-cas
3 results

Nmc.php

Blame
  • user avatar
    Tim Steiner authored
    0f565387
    History
    Nmc.php 1.21 KiB
    <?php
    
    class Nmc extends Nmc_Friendly
    {
        protected $__friends = array('TestController');
        private $bob = 'test';
    
        private function bob()
        {
            echo "hi";
        }
    
        public function __get($key)
        {
            echo "ha ha!";
            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.");
            }
        }
    }
    
    ?>