Gets the package class.

@return null|string
@throws \NewUp\Exceptions\InvalidPackageTemplateException
@throws \NewUp\Exceptions\TemplatePackageMissingException
439380
private function getPackageClass()
    {
        if ($this->packageClass !== null) {
            return $this->packageClass;
        }

        $includePath = $this->getPackageClassPath();

        if (!file_exists($includePath)) {
            Application::getOutput()->writeln("<comment>{$this->getTemplateName()} is not installed. Attempting to install it now...</comment>");
            $result = app(Kernel::class)->getApplication()->callWithSharedOutput('template:install', ['name' => $this->getTemplateName(), '--confirm' => true]);

            if ($result === Install::INSTALL_FAIL) {
                // Fail angrily.
                throw new TemplatePackageMissingException("The package template {$this->getTemplateName()} is not installed or it cannot be found. The package template must be installed before it can be built.");
            } else {
                Application::getOutput()->writeln('<comment>It looks like everything went well. We will continue building the package template...</comment>');
            }
        }

        scope_include($includePath);

        $this->packageClass = $packageClass = $this->getNamespacedPackageName();

        if (!class_exists($packageClass)) {
            throw new InvalidPackageTemplateException("{$packageClass} class does not exist.");
        }

        return $packageClass;
    }
701502
public function getPKType() {
        if ($this->_pktype === null) {
            if ($this->_pk === null) {
                $this->getPK();
            }
            $this->_pktype= $this->xpdo->getPKType($this->_class);
        }
        return $this->_pktype;
    }
1016566
final public static function getClassFile():\stdClass
    {
        $a = json_decode(file_get_contents(FEnv::get("framework.config.core.apps.file")));
        return ($a == null ? new \stdClass() : $a);
    }
928185
protected function getParentClass(PackageClass $package_class)
    {
        try {
            $base_class = new \ReflectionClass($package_class->getName());
        } catch (\ReflectionException $e) {
            return null;
        }
        if (false === ($parent_reflection = $base_class->getParentClass())
            || dirname($parent_reflection->getFileName()) !== dirname($base_class->getFileName())
        ) {
            return null;
        }

        return new PackageClass($parent_reflection->getName(), $parent_reflection->getFileName());
    }
543679
public function getPackages()
    {
        if ($this->packages === null) {
            $this->packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
            $this->packages[] = $this->composer->getPackage();
        }

        return $this->packages;
    }
600567
public function getPackage() : ?string 
    {
        if ( ! $this->hasPackage()) {
            $this->setPackage($this->getDefaultPackage());
        }
        return $this->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;
    }
1048337
protected function findPackage()
    {
        if ($this->package !== null) {
            return;
        }

        $file = $this->getFile();

        $parts = explode(DIRECTORY_SEPARATOR, $file);

        $key = array_search('src', array_reverse($parts, true), true);
        if ($key === false) {
            $this->package = new \stdClass();
            return;
        }

        $composerFile = implode(DIRECTORY_SEPARATOR, array_slice($parts, 0, $key)).DIRECTORY_SEPARATOR.'composer.json';
        if (!file_exists($composerFile)) {
            $this->package = new \stdClass();
            return;
        }

        $composerContent = file_get_contents($composerFile);
        if ($composerContent === false) {
            $this->package = new \stdClass();
            return;
        }

        $this->package = json_decode($composerContent);
        if ($this->package === null) {
            $this->package = new \stdClass();
        }
    }
1172541
protected function getContainerClass()
    {
        $class = \get_class($this);
        $class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).str_replace('.', '_', ContainerBuilder::hash($class)) : $class;
        $class = $this->name.str_replace('\\', '_', $class).ucfirst($this->environment).($this->debug ? 'Debug' : '').'Container';

        if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $class)) {
            throw new \InvalidArgumentException(sprintf('The environment "%s" contains invalid characters, it can only contain characters allowed in PHP class names.', $this->environment));
        }

        return $class;
    }
1283346
public function qualifiedName()
    {
        $parent =& $this->containingClass();
        if ($parent && $parent->name() != '' && $this->_package != $parent->name()) {
            return $this->_package.'\\'.$parent->name().'\\'.$this->_name;
        } else {
            return $this->_package.'\\'.$this->_name;
        }
    }
1272382
public function getPackageName(): string
	{
		if( $this->module_id > 0 )
		{
			$module = $this->getModule();
			if( strpos($this->class_name, "\\") === false )
			{
				$this->class_name = $module->getNamespace() . "Plugin\\" . $this->class_name;
			}
			return $module->getName();
		}
		else
		{
			return $this->name;
		}
	}
249308
private function getPluginsMetadataList(): stdClass
    {
        app()->loadDeferredProviders();
        $providers = array_keys(app()->getLoadedProviders());

        $packages = (object) [
            'core' => collect(),
            'plugins' => collect(),
        ];

        foreach ($providers as $class) {
            // attempt to retrieve the class from booted app
            $provider = app()->getProvider($class);

            if (is_null($provider))
                continue;

            // ensure the provider is a valid SeAT package
            if (! is_a($provider, AbstractSeatPlugin::class))
                continue;

            // seed proper collection according to package vendor
            $provider->getPackagistVendorName() === 'eveseat' ?
                $packages->core->push($provider) : $packages->plugins->push($provider);
        }

        return $packages;
    }
947471
public function get($name)
    {
        if (!isset($this->packages[$name])) {
            return null;
        }

        return $this->packages[$name];
    }
146677
private function getNamespacedPackageName()
    {
        $path = $this->getTemplateArgumentPath();
        $templateName = json_decode(file_get_contents($path . 'composer.json'))->name;
        $parts = explode('/', $templateName);
        return package_vendor_namespace($parts[0], $parts[1]) . '\Package';
    }
1103790
protected function getClassService()
    {
        if (is_null($this->service)) {
            $this->service = DeliveryTemplateService::singleton();
        }
        return $this->service;
    }
379429
public function getBuilderClass()
    {
        if (!empty($this->builderClassName)) {
            return $this->builderClassName;
        }

        return $this->getConfig('builder') ?: '\\think\\db\\builder\\' . ucfirst($this->getConfig('type'));
    }
755393
public function getMessageTemplate()
    {
        if ($this->messageTemplate) {
            return $this->messageTemplate;
        }
        if (isset($this->options['label'])) {
            return constant(get_class($this) . '::LABELED_MESSAGE');
        }

        return constant(get_class($this) . '::MESSAGE');
    }