1.0.0 Alpha Release #59

Merged
netkas merged 213 commits from v1.0.0_alpha into master 2023-01-29 23:27:58 +00:00
Showing only changes of commit a5c1124b6b - Show all commits

View file

@ -285,42 +285,6 @@
return $results; return $results;
} }
/**
* Returns an existing ExecutionUnit for a package version
*
* @param string $package
* @param string $version
* @param string $name
* @return ExecutionPointers\ExecutionPointer
* @throws AccessDeniedException
* @throws FileNotFoundException
* @throws IOException
*/
public function getUnit(string $package, string $version, string $name): ExecutionPointers\ExecutionPointer
{
/** @noinspection DuplicatedCode */
if(Resolver::resolveScope() !== Scopes::System)
throw new AccessDeniedException('Cannot remove ExecutionUnit \'' . $name .'\' for ' . $package . ', insufficient permissions');
Console::outVerbose(sprintf('Removing ExecutionUnit \'%s\' for %s', $name, $package));
$package_id = $this->getPackageId($package, $version);
$package_config_path = $this->RunnerPath . DIRECTORY_SEPARATOR . $package_id . '.inx';
$package_bin_path = $this->RunnerPath . DIRECTORY_SEPARATOR . $package_id;
Console::outDebug(sprintf('package_id=%s', $package_id));
Console::outDebug(sprintf('package_config_path=%s', $package_config_path));
Console::outDebug(sprintf('package_bin_path=%s', $package_bin_path));
$filesystem = new Filesystem();
if(!$filesystem->exists($package_config_path))
{
throw new FileNotFoundException(sprintf('Path \'%s\' does not exist', $package_config_path));
}
$execution_pointers = ExecutionPointers::fromArray(ZiProto::decode(IO::fread($package_config_path)));
return $execution_pointers->getUnit($name);
}
/** /**
* Executes a unit * Executes a unit
* *