Backend\Core\Engine\Model::isModuleInstalled PHP Method

isModuleInstalled() public static method

Is module installed?
public static isModuleInstalled ( string $module ) : boolean
$module string
return boolean
    public static function isModuleInstalled($module)
    {
        $modules = self::getModules();
        return in_array((string) $module, $modules);
    }

Usage Example

Example #1
0
 /**
  * Validate if the module can be installed.
  */
 private function validateInstall()
 {
     // already installed
     if (BackendModel::isModuleInstalled($this->currentModule)) {
         $this->redirect(BackendModel::createURLForAction('Modules') . '&error=already-installed&var=' . $this->currentModule);
     }
     // no installer class present
     if (!is_file(BACKEND_MODULES_PATH . '/' . $this->currentModule . '/Installer/Installer.php')) {
         $this->redirect(BackendModel::createURLForAction('Modules') . '&error=no-installer-file&var=' . $this->currentModule);
     }
 }
All Usage Examples Of Backend\Core\Engine\Model::isModuleInstalled