Updated Runtime
This commit is contained in:
parent
c87ebf14dd
commit
f8ede74764
1 changed files with 12 additions and 2 deletions
|
@ -34,6 +34,7 @@
|
||||||
use ncc\Enums\Versions;
|
use ncc\Enums\Versions;
|
||||||
use ncc\Exceptions\ConfigurationException;
|
use ncc\Exceptions\ConfigurationException;
|
||||||
use ncc\Exceptions\ImportException;
|
use ncc\Exceptions\ImportException;
|
||||||
|
use ncc\Exceptions\IntegrityException;
|
||||||
use ncc\Exceptions\IOException;
|
use ncc\Exceptions\IOException;
|
||||||
use ncc\Exceptions\NotSupportedException;
|
use ncc\Exceptions\NotSupportedException;
|
||||||
use ncc\Exceptions\OperationException;
|
use ncc\Exceptions\OperationException;
|
||||||
|
@ -77,12 +78,14 @@
|
||||||
* This method may exit the program without returning a value
|
* This method may exit the program without returning a value
|
||||||
*
|
*
|
||||||
* @param string $package
|
* @param string $package
|
||||||
|
* @param array $arguments
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws ConfigurationException
|
* @throws ConfigurationException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
* @throws IntegrityException
|
||||||
* @throws NotSupportedException
|
* @throws NotSupportedException
|
||||||
* @throws PathNotFoundException
|
|
||||||
* @throws OperationException
|
* @throws OperationException
|
||||||
|
* @throws PathNotFoundException
|
||||||
*/
|
*/
|
||||||
public static function execute(string $package, array $arguments=[]): int
|
public static function execute(string $package, array $arguments=[]): int
|
||||||
{
|
{
|
||||||
|
@ -91,6 +94,12 @@
|
||||||
throw new InvalidArgumentException(sprintf('Package %s is not imported', $package));
|
throw new InvalidArgumentException(sprintf('Package %s is not imported', $package));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(self::$imported_packages[$package]?->getMetadata()?->getMainExecutionPolicy() === null)
|
||||||
|
{
|
||||||
|
Console::out('The package does not have a main execution policy, skipping execution');
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(self::$imported_packages[$package] instanceof PackageReader)
|
if(self::$imported_packages[$package] instanceof PackageReader)
|
||||||
{
|
{
|
||||||
return ExecutionUnitRunner::executeFromPackage(
|
return ExecutionUnitRunner::executeFromPackage(
|
||||||
|
@ -294,7 +303,7 @@
|
||||||
* @return string
|
* @return string
|
||||||
* @throws ConfigurationException
|
* @throws ConfigurationException
|
||||||
* @throws ImportException
|
* @throws ImportException
|
||||||
* @throws NotSupportedException
|
* @throws IntegrityException
|
||||||
* @throws OperationException
|
* @throws OperationException
|
||||||
*/
|
*/
|
||||||
private static function importFromPackage(string $package_path): string
|
private static function importFromPackage(string $package_path): string
|
||||||
|
@ -513,6 +522,7 @@
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws OperationException
|
* @throws OperationException
|
||||||
* @throws PathNotFoundException
|
* @throws PathNotFoundException
|
||||||
|
* @throws IntegrityException
|
||||||
*/
|
*/
|
||||||
private static function acquireFile(string $path, ?string $package=null): string
|
private static function acquireFile(string $path, ?string $package=null): string
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue