Includes a controller given a controller class name

@param string $class controller class name
@return @link http://www.php.net/manual/en/function.include.php
13698
private function includeController($class)
    {
        $local = $this->_srcPath . DIRECTORY_SEPARATOR;
        $controller = explode('_', $class);
        array_splice($controller, 2, 0 , 'controllers');
        $pathToController = implode(DIRECTORY_SEPARATOR, $controller);
        $classFile = $local . $pathToController . '.php';
        if (!file_exists($classFile)) {
            return false;
        }
        return include_once $classFile;
    }
395837
public function createDefinition(string $class): Definition
    {
        $definition = new Definition($class);

        foreach ($this->providers as $provider)
        {
            try {
                $definitionPartial = $provider->getDefinition($class);
            } catch (DefinitionNotFoundException $exception) {
                continue;
            }

            $definition->merge($definitionPartial);
        }

        return $definition;
    }
1259708
public function addController(string $name, $class = null, $option = null)
    {
        return $this->controller($name, $class, $option);
    }
1976
protected function includeClass($class)
    {
        $this->updateLog("info", "Setting up {$class} class for inclusion.");

        $class_bits = explode("\\", $class);

        $package       = "";
        $package_stack = array();

        foreach ($class_bits as $bit) {
            $package = $package . $bit . "\\";

            $package_registered = $this->packageRegistered($package);

            if ($package_registered) {
                $package_stack[] = $package;
            }
        }

        $this->loadPackageStack($class, $package_stack);
    }
444756
public static function loadClass($class)
    {
        if (isset(self::$_classMap[$class]))
            return (bool)require sprintf('%s/%s', self::ROOT_DIR, self::$_classMap[$class]);
        return null;
    }
226679
public function addClass( string $class ): Tag
    {

        if ( ! isset( $this->attributes['class'] ) ) {
            $this->attributes['class'] = $class;
        } else {
            $this->attributes['class'] .= " $class";
        }

        return $this;
    }
677051
public static function classAutoLoader(string $class)
    {
        self::ensureDefines();
        
        $coreBaseNamespace = str_replace('\\', '/', __NAMESPACE__) . '/';
        
        $classWithNamespaceToLoad = str_replace('\\', '/', $class);
        $classWithRelativeNamespaceToLoad = str_replace($coreBaseNamespace, '', $classWithNamespaceToLoad);
        
        $namespaceToLoad = dirname($classWithNamespaceToLoad);
        $classToLoad = basename($classWithNamespaceToLoad);
        
        $classFileName = $classToLoad . EXT_PHP;
        
        $paths = array();
        
        $possibleParentConstants = array(
            Xentriq::CONST_DIR_CORE, // core directory
            Xentriq::CONST_DIR_LIBS, // libraries directory
            Xentriq::CONST_DIR_ADDONS, // addon directory
            Xentriq::CONST_DIR_ASSUMED_ROOT // assumed root directory
        );
        
        foreach ($possibleParentConstants as $possibleParentConstant) {
            // search core directory
            if (defined($possibleParentConstant)) {
                $parentPath = constant($possibleParentConstant);
                
                $paths[] = ($parentPath . '/' . $classFileName);
                $paths[] = ($parentPath . $classWithNamespaceToLoad . EXT_PHP);
                $paths[] = ($parentPath . strtolower(dirname($classWithRelativeNamespaceToLoad)) . '/' . $classFileName);
                
                // search paths with hyphen
                $segments = explode('/', $namespaceToLoad);
                
                for ($sidx = 1; $sidx <= (sizeof($segments)); $sidx++) {
                    $baseHyphenPath = implode('-', array_slice($segments, 0, $sidx));
                    $completeHyphenPath = $baseHyphenPath . CHAR_SLASH . implode('/', array_slice($segments, $sidx));
                    
                    $paths[] = ($parentPath . $baseHyphenPath . '/' . $classFileName);
                    $paths[] = ($parentPath . $completeHyphenPath . '/' . $classFileName);
                    $paths[] = ($parentPath . strtolower($baseHyphenPath) . '/' . $classFileName);
                    $paths[] = ($parentPath . strtolower($completeHyphenPath) . '/' . $classFileName);
                }
            }
        }
        
        foreach ($paths as $path) {
            if (is_file($path) && !class_exists($path)) {
                require_once $path;
                
                // exit loader
                return;
            }
        }
        
        // search in addons
        $classFile = Addons::searchAddonClassFile($class);
        if (is_file($classFile)) {
            require_once $classFile;
        }
    }
569197
public function addClass($class) {
		$class = trim($class);
		
		if (strpos($class, ' ') !== false) {
			$this->addClasses(explode(' ', $class));
			return $this;
		}
		
		$this->_classes[$class] = $class;
		$this->_tagCached       = null;
		
		return $this;
	}
674903
public static function getControllerMethods($class)
    {
        if (!class_exists($class)) {
            throw new TaskManagerException('class ' . $class . ' not found');
        }
        $class_methods = get_class_methods($class);
        if ($parent_class = get_parent_class($class)) {
            $parent_class_methods = get_class_methods($parent_class);
            return array_diff($class_methods, $parent_class_methods);
        }
        return $class_methods;
    }
1357975
public static function autoload($class) {
        $name = $class;
        if(false !== strpos($name,'\\')){
          $name = strstr($class, '\\', true);
        }
        
        $filename = TOP_AUTOLOADER_PATH."/top/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/top/request/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/top/domain/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/request/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/domain/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }         
    }
1194579
public function remove_class( $class ) {
		if ( !isset( $this->attr['class'] ) || !is_array( $this->attr['class'] ) ) {
			$this->_sanitize_class();
		}
		$this->attr['class'] = array_diff( $this->attr['class'], array( $class ) );
		return $this;
	}
106011
public static function autoloader($class) {
		$class = ltrim($class, '\\');
		if (class_exists($class, false) || interface_exists($class, false)) {
			return;
		}
		$whitelisted = ['Memcached', 'PHPUnit', 'Symfony'];
		foreach ($whitelisted as $v) {
			if (strpos($class, $v) === 0) return;
		}
		// we need to check if we have customization for classes, we only allow 
		// customizaton for models and controllers
		$file = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class) . '.php';
		// we need to store class path so we can load js, css and scss files
		self::$settings['application']['loaded_classes'][$class] = [
			'class' => $class,
			'file' => $file,
			'media' => []
		];
		// debuging
		if (class_exists('Debug', false) && \Debug::$debug) {
			\Debug::$data['classes'][] = ['class' => $class, 'file' => $file];
		}
		require_once($file);
	}
421900
private function loadController($class)
    {
        $controller = new $class($this->currentControllerAliasConfig);
        if (!is_a($controller, '\\mpf\\web\\Controller')) {
            $this->critical('Controller `' . $class . '` must extend \\mpf\\web\\Controller!', array(
                'requestedController' => $this->request()->getController(),
                'requestedModule' => $this->request()->getModule()
            ));
            return null;
        }
        return $controller;
    }
672676
protected function bindToClass($url, $class)
    {
        $array  = explode('|', $url, 2);
        $action = !empty($array[0]) ? $array[0] : $this->router->config('default_action');
        $param  = [];

        if (!empty($array[1])) {
            $this->parseUrlParams($array[1], $param);
        }

        return new CallbackDispatch($this, [$class, $action], $param);
    }
602757
public function loadClass($class)
    {
        if (array_key_exists($class, $aliases = $this->classAliasList->getRegisteredAliases())) {
            // we have an alias for it, but we don't have it yet loaded
            // (because after all, we're in the auto loader.)
            $fullClass = $aliases[$class];
            if (!class_exists($fullClass, false)) {
                spl_autoload_call($fullClass);
            }
            // finally, we set up a class alias for this list. We do this now because
            // we don't know earlier what namespace it'll be in
            class_alias($fullClass, $class);
        }
    }
636042
public static function autoload($class)
    {
        if (substr($class, -10) == "Controller") {
            self::loadController($class);
        } else if (substr($class, -5) == "Model") {
            self::loadModel($class);
        } else if (substr($class, -6) == "Helper") {
            self::loadHelper($class);
        }
    }
841474
protected function getControllerInstance($class)
    {
        if (!isset($this->controllerInstances[$class])) {
            $this->controllerInstances[$class] = new $class(array(
                'wei' => $this->wei,
                'app' => $this,
            ));
        }

        return $this->controllerInstances[$class];
    }