SlimCMS\Modules\SModuleManager::loadModules PHP Method

loadModules() public method

Find and analyse the module folder
public loadModules ( $path = "" )
    public function loadModules($path = "")
    {
        if ($path && $this->filesystem->isDirectory($path)) {
            $this->path = $path;
        }
        if (!$this->cache || !$this->cacheManager->has('folder.modules')) {
            $folders = $this->filesystem->directories($this->path);
            $this->cacheManager->forever('folder.modules', json_encode($folders));
        } else {
            $folders = json_decode($this->cacheManager->get('folder.modules'));
        }
        foreach ($folders as $folder) {
            $this->initModule($folder);
        }
    }