Get the controller of a package given its handle.

@param string $pkgHandle Handle of package

@return Package
353165
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;
    }
558192
private function getErrorClass()
    {
        try {
            $package = $this->getPackage('DefaultPackage');
        } catch (PackageNotFoundException $e) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        $controller = $package['namespace'] . '\\src\\Error';

        if (!class_exists($controller)) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        return $controller;
    }
983962
public static function getListByPackage($pkg)
    {
        $db = Database::connection();
        $upaIDs = $db->GetCol('select upaID from UserPointActions where pkgID = ? order by upaName asc', array($pkg->getPackageID()));
        $actions = array();
        foreach ($upaIDs as $upaID) {
            $action = static::getByID($upaID);
            if (is_object($action)) {
                $actions[] = $action;
            }
        }

        return $actions;
    }
1272459
public function getDelegate($packageType)
    {
        if (!isset($this->_instances[$packageType]))
        {
            if (isset($this->_delegates[$packageType]))
            {
                $classname = $this->_delegates[$packageType];
                $instance  = new $classname($this->io, $this->composer, 'nooku-framework');

                $this->_instances[$packageType] = $instance;
            }
            else throw new \InvalidArgumentException('Unknown package type `'.$packageType.'`.');
        }

        return $this->_instances[$packageType];
    }
870312
protected function getNodePackageManager() {
		$is_windows = strtolower( substr( PHP_OS, 0, 3 ) ) === 'win';
		$node_package_managers = [
			'yarn' => Yarn::class,
			'npm' => Npm::class,
		];

		foreach ( $node_package_managers as $manager => $class ) {
			$command = $is_windows ? 'where ' . escapeshellarg( $manager ) : 'which ' . escapeshellarg( $manager );

			try {
				$output = App::execute( $command );
			} catch ( ProcessFailedException $e ) {
				continue;
			}

			if ( ! trim( $output ) ) {
				continue;
			}

			return new $class();
		}

		throw new RuntimeException( 'Could not find a node package manager. Please check if npm is added to your PATH.' );
	}
1132091
public function getPackageHandle()
    {
        $pkgID = $this->getPackageID();

        return $pkgID ? PackageList::getHandle($this->pkgID) : null;
    }
281754
public function getHandle()
    {
        if(!$handle = $this->getProperty($this->getIdentityColumn())) {
            $handle = parent::getHandle();
        }

        return $handle;
    }
1052250
public function getDirectoryScanner(Project $p = null)
    {
        if ($p === null) {
            $p = $this->getProject();
        }
        if ($this->isReference()) {
            $obj = $this->getRef($p);

            return $obj->getDirectoryScanner($p);
        }

        $this->loadPearPackageScanner($p);

        return $this->pps;
    }
628054
public function getHandle()
    {
        $delegate = $this->getDelegate();

        if($delegate instanceof ObjectHandlable) {
            $handle = $delegate->getHandle();
        } else {
            $handle = spl_object_hash($this);
        }

        return $handle;
    }
25378
public static function getByID($pkgID)
    {
        $app = ApplicationFacade::getFacadeApplication();

        return $app->make(PackageService::class)->getByID($pkgID);
    }
1022965
public function instanciateController() {
		$class = $this->controllerClass;
		/* @var Controller $controller */
		$controller = new $class();
		if( !($controller instanceof Controller) ) {
			throw new NotFoundException('The controller "'.$this->controllerClass.'" is not a valid controller, the class must inherit from "'.get_class().'"');
		}
		$controller->setRoute($this);
		return $controller;
	}
487943
public function getControllerObjectName()
    {
        $possibleObjectName = '@package\@subpackage\Controller\@controllerController';
        $possibleObjectName = str_replace('@package', str_replace('.', '\\', $this->controllerPackageKey), $possibleObjectName);
        $possibleObjectName = str_replace('@subpackage', $this->controllerSubpackageKey, $possibleObjectName);
        $possibleObjectName = str_replace('@controller', $this->controllerName, $possibleObjectName);
        $possibleObjectName = str_replace('\\\\', '\\', $possibleObjectName);

        $controllerObjectName = $this->objectManager->getCaseSensitiveObjectName($possibleObjectName);
        return ($controllerObjectName !== false) ? $controllerObjectName : '';
    }
711342
static function packageHandler( $handlerName )
    {
        if ( !isset( $GLOBALS['eZPackageHandlers'] ) )
        {
            $handlers = array();
        }
        else
        {
            $handlers = $GLOBALS['eZPackageHandlers'];
        }
        $handler = false;

        if( isset( $handlers[$handlerName] ) )
        {
            $handler = $handlers[$handlerName];
            $handler->reset();
        }
        else
        {
            $optionArray = array( 'iniFile'      => 'package.ini',
                                  'iniSection'   => 'PackageSettings',
                                  'iniVariable'  => 'HandlerAlias',
                                  'handlerIndex' => $handlerName );

            $options = new ezpExtensionOptions( $optionArray );

            $handler = eZExtension::getHandlerClass( $options );
            $handlers[$handlerName] = $handler;
        }

        $GLOBALS['eZPackageHandlers'] = $handlers;
        return $handler;
    }
1179313
public function getControlHandler() {
		if ($this->_controlHandler === null) {
			if ($this->hasLocator() && $this->getLocator()->has($this->_controlHandlerServiceId)) {
				$this->_controlHandler = $this->getLocator()->get($this->_controlHandlerServiceId);
				
				if (! $this->_controlHandler instanceof ControlHandlerInterface) {
					throw new RuntimeException('Pagination control handler must implement "ControlHandlerInterface"');
				}
			} else {
				$this->_controlHandler = new Sliding();
			}
		}
		
		return $this->_controlHandler;
	}
752107
protected function getPackageKey()
    {
        $packageKey = $this->getOption('packageKey');
        if ($packageKey !== null) {
            return $packageKey;
        } else {
            /** @var $request ActionRequest */
            $request = $this->controllerContext->getRequest();
            return $request->getControllerPackageKey();
        }
    }
1059751
static function instance( $package, $handlerName, $installItem )
    {
        // if no installItem is given, then this is the whole package installer
        /*if ( $installItem == null )
        {
            include_once( $package->path() . '/' . $package->installerDirectory() . '/' . $package->installerFileName() );
            $handlerClassName = $package->installerFileName();
            $handler =& new $handlerClassName( $package, null, null );
            return $handler;
        }*/

        $handlers =& $GLOBALS['eZPackageCreationInstallers'];
        if ( !isset( $handlers ) )
            $handlers = array();
        $handler = false;

        if( isset( $handlers[$handlerName] ) )
        {
            $handler =& $handlers[$handlerName];
            $handler->reset();
        }
        else
        {
            $optionArray = array( 'iniFile'       => 'package.ini',
                                  'iniSection'    => 'InstallerSettings',
                                  'iniVariable'   => 'HandlerAlias',
                                  'handlerIndex'  => $handlerName,
                                  'handlerParams' => array( $package, $handlerName, $installItem ) );

            $options = new ezpExtensionOptions( $optionArray );

            $handler = eZExtension::getHandlerClass( $options );

            if( $handler !== null and $handler !== false )
            {
                $handlers[$handlerName] =& $handler;
                // if custom install handler is available in the package, we use it
                $customInstallHandler = $handler->customInstallHandlerInfo( $package, $installItem );
                if ( $customInstallHandler )
                {
                    unset( $handler );
                    $handlerClassName = $customInstallHandler['classname'];
                    $handlerFile = $customInstallHandler['file-path'];

                    include_once( $handlerFile );
                    $handler = new $handlerClassName( $package, $handlerName, $installItem );
                }
            }
        }

        return $handler;
    }
745617
protected function getControllerClass($controllerKey)
    {
        /** Remove try catch block after routing BC is removed */
        try {
            $controllerClass = $this->resolveControllerClass($controllerKey);
        } catch (\OxidEsales\Eshop\Core\Exception\RoutingException $exception) {
            $this->handleRoutingException($exception);
            $controllerClass = $controllerKey;
        }

        return $controllerClass;
    }