Added Data path for packages
This commit is contained in:
parent
558c0a3212
commit
7ffbdf72c1
5 changed files with 87 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue