Added Data path for packages

This commit is contained in:
Netkas 2022-12-19 18:41:10 -05:00
parent 558c0a3212
commit 7ffbdf72c1
5 changed files with 87 additions and 1 deletions

View file

@ -4,7 +4,11 @@
use ncc\Exceptions\ConstantReadonlyException;
use ncc\Exceptions\ImportException;
use ncc\Exceptions\InvalidConstantNameException;
use ncc\ncc;
use ncc\Exceptions\InvalidPackageNameException;
use ncc\Exceptions\InvalidScopeException;
use ncc\Exceptions\PackageLockException;
use ncc\Exceptions\PackageNotFoundException;
use ncc\ncc;
use ncc\Runtime;
if(!defined('NCC_INIT'))
@ -112,4 +116,22 @@
Runtime\Constants::delete($package, $name);
}
}
if(!function_exists('get_data_path'))
{
/**
* Returns the data path of the package
*
* @param string $package
* @return string
* @throws InvalidPackageNameException
* @throws InvalidScopeException
* @throws PackageLockException
* @throws PackageNotFoundException
*/
function get_data_path(string $package): string
{
return Runtime::getDataPath($package);
}
}
}