From 233d5ce6d2c8853ccf1173c754df9d499cf0eb1e Mon Sep 17 00:00:00 2001 From: Netkas Date: Fri, 23 Dec 2022 01:27:30 -0500 Subject: [PATCH] Implemented DataPaths for packages --- src/ncc/Utilities/Functions.php | 8 ++++---- src/ncc/Utilities/PathFinder.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ncc/Utilities/Functions.php b/src/ncc/Utilities/Functions.php index 9f6f6b0..7c9c568 100644 --- a/src/ncc/Utilities/Functions.php +++ b/src/ncc/Utilities/Functions.php @@ -959,8 +959,8 @@ try { - if($filesystem->exists(PathFinder::getDataPath() . DIRECTORY_SEPARATOR . 'data')) - $filesystem->chmod(PathFinder::getDataPath() . DIRECTORY_SEPARATOR . 'data', 0777, 0000, true); + if($filesystem->exists(PathFinder::getDataPath(Scopes::System))) + $filesystem->chmod(PathFinder::getDataPath(Scopes::System), 0777, 0000, true); } catch(Exception $e) { @@ -969,8 +969,8 @@ try { - if($filesystem->exists(PathFinder::getCachePath())) - $filesystem->chmod(PathFinder::getCachePath(), 0777, 0000, true); + if($filesystem->exists(PathFinder::getCachePath(Scopes::System))) + $filesystem->chmod(PathFinder::getCachePath(Scopes::System), 0777, 0000, true); } catch(Exception $e) { diff --git a/src/ncc/Utilities/PathFinder.php b/src/ncc/Utilities/PathFinder.php index df457fc..1e37d33 100644 --- a/src/ncc/Utilities/PathFinder.php +++ b/src/ncc/Utilities/PathFinder.php @@ -218,7 +218,7 @@ if(!Validate::packageName($package)) throw new InvalidPackageNameException($package); - return self::getDataPath() . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . $package; + return self::getDataPath(Scopes::System) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . $package; } /**