concrete/src/Package/PackageService.php
public function getClass($pkgHandle)
    {
        $cache = $this->application->make('cache/request');
        $item = $cache->getItem('package/class/' . $pkgHandle);
        $cl = $item->get();
        if ($item->isMiss()) {
            $item->lock();
            // loads and instantiates the object

            $cl = \Concrete\Core\Foundation\ClassLoader::getInstance();
            $cl->registerPackageController($pkgHandle);

            $class = '\\Concrete\\Package\\' . camelcase($pkgHandle) . '\\Controller';
            try {
                $cl = $this->application->make($class);
            } catch (\Exception $ex) {
                $cl = $this->application->make('Concrete\Core\Package\BrokenPackage', [$pkgHandle]);
            }
            $cache->save($item->set($cl));
        }

        return clone $cl;
    }
public function getClass($pkgHandle)
    {
        $cache = $this->application->make('cache/request');
        $item = $cache->getItem('package/class/' . $pkgHandle);
        $cl = $item->get();
        if ($item->isMiss()) {
            $item->lock();
            // loads and instantiates the object

            $cl = \Concrete\Core\Foundation\ClassLoader::getInstance();
            $cl->registerPackageController($pkgHandle);

            $class = '\\Concrete\\Package\\' . camelcase($pkgHandle) . '\\Controller';
            try {
                $cl = $this->application->make($class);
            } catch (\Exception $ex) {
                $cl = $this->application->make('Concrete\Core\Package\BrokenPackage', [$pkgHandle]);
            }
            $cache->save($item->set($cl));
        }

        return clone $cl;
    }
public function getClass ( $ pkgHandle ) { $ cache = $ this -> application -> make ( 'cache/request' ) ; $ item = $ cache -> getItem ( 'package/class/' . $ pkgHandle ) ; $ cl = $ item -> get ( ) ; if ( $ item -> isMiss ( ) ) { $ item -> lock ( ) ; // loads and instantiates the object $ cl = \ Concrete \ Core \ Foundation \ ClassLoader :: getInstance ( ) ; $ cl -> registerPackageController ( $ pkgHandle ) ; $ class = '\\Concrete\\Package\\' . camelcase ( $ pkgHandle ) . '\\Controller' ; try { $ cl = $ this -> application -> make ( $ class ) ; } catch ( \ Exception $ ex ) { $ cl = $ this -> application -> make ( 'Concrete\Core\Package\BrokenPackage' , [ $ pkgHandle ] ) ; } $ cache -> save ( $ item -> set ( $ cl ) ) ; } return clone $ cl ; }
Get the controller of a package given its handle.

@param string $pkgHandle Handle of package

@return Package
Get the controller of a package given its handle .