From a1cbf8f2bb99e29b0b13e8e7d336f96432d683d8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 2 Apr 2016 17:55:42 +0200 Subject: [PATCH] Setting up key functionality --- Module/InfoManager.php | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Module/InfoManager.php b/Module/InfoManager.php index d0ad53b61..ecc436153 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -60,12 +60,16 @@ class InfoManager * @author Dennis Eichhorn */ public function __construct(string $module) + { + $this->path = $path; + } + + public function load() { if (($path = realpath($oldPath = ModuleAbstract::MODULE_PATH . '/' . $module . '/info.json')) === false || Validator::startsWith($path, ModuleAbstract::MODULE_PATH)) { throw new PathException($oldPath); } - $this->path = $path; $this->info = json_decode(file_get_contents($this->path), true); } @@ -111,4 +115,34 @@ class InfoManager { return $this->info; } + + public function getInternalName() : string + { + return $this->info['name']['internal']; + } + + public function getDependencies() : string + { + return $this->info['dependencies']; + } + + public function getProviding() : string + { + return $this->info['providing']; + } + + public function getDirectory() : string + { + return $this->info['directory']; + } + + public function getVersion() : string + { + return $this->info['version']; + } + + public function getLoad() : string + { + return $this->info['load']; + } }