From 7c2735ce1b53752783697cb614be3278d0ed6fd3 Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 2 Jan 2023 16:20:32 -0500 Subject: [PATCH] Added Logging calls to \ncc\Managers > ConfigurationManager --- src/ncc/Managers/ConfigurationManager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ncc/Managers/ConfigurationManager.php b/src/ncc/Managers/ConfigurationManager.php index 7df457e..8dd2b50 100644 --- a/src/ncc/Managers/ConfigurationManager.php +++ b/src/ncc/Managers/ConfigurationManager.php @@ -5,7 +5,6 @@ namespace ncc\Managers; use Exception; - use ncc\Abstracts\LogLevel; use ncc\Abstracts\Scopes; use ncc\Exceptions\AccessDeniedException; use ncc\Exceptions\FileNotFoundException; @@ -50,6 +49,8 @@ */ public function load(): void { + Console::outDebug(sprintf('loading configuration file from %s', PathFinder::getConfigurationFile())); + $this->Configuration = RuntimeCache::get('ncc.yaml'); if($this->Configuration !== null) return; @@ -68,6 +69,8 @@ */ public function save(): void { + Console::outDebug(sprintf('saving configuration file to %s', PathFinder::getConfigurationFile())); + if(Resolver::resolveScope() !== Scopes::System) throw new AccessDeniedException('Cannot save configuration file, insufficient permissions'); @@ -89,6 +92,8 @@ */ public function getProperty(string $property) { + Console::outDebug(sprintf('getting property %s', $property)); + Console::outDebug($property); $current_selection = $this->getConfiguration(); foreach(explode('.', strtolower($property)) as $property) @@ -121,6 +126,8 @@ */ public function updateProperty(string $property, $value): bool { + Console::outDebug(sprintf('updating property %s', $property)); + $keys = explode('.', $property); $current = &$this->Configuration; foreach ($keys as $k)