Whether the current distribution contains all the required modules
@return bool
979064
public function hasAllRequiredModules()
    {
        $required = $this->getRequiredModules();
        $available = array_keys($this->module->getList());
        $difference = array_diff($required, array_intersect($required, $available));

        return empty($difference);
    }
1260465
public function hasConfig() {
		if ($this->_configSupplied !== null) {
			return true;
		}
		
		if ($this instanceof LocatorAwareInterface && $this->hasLocator()
			&& $this->getLocator()->has($this->getConfigServiceId())) {
			return true;
		}
		
		return false;
	}
88197
public function isAvailable(): bool
    {
        $projectEnvFileExists = false;
        foreach (self::ENV_FILES as $envFile) {
            if (file_exists("{$this->projectRootDir}/{$envFile}")) {
                $projectEnvFileExists = true;
            }
        }

        if (!$projectEnvFileExists) {
            return false;
        }

        $sourceFile = "{$this->packageInstallDir}/.installer/%s/.env";
        foreach ($this->projectType->getProjectDirs() as $projectDir) {
            $envFile = sprintf($sourceFile, $projectDir);
            if (is_file($envFile)) {
                return true;
            }
        }

        return false;
    }
168582
public function installMode(): bool
    {
        if (!isset($this->cache[self::INSTALL_MODE])) {
            $this->cache[self::INSTALL_MODE] = !is_file($this->initFile());
        }

        return $this->cache[self::INSTALL_MODE];
    }
696265
private function prepareDirectories()
	{
		if ($this->type == "com")
		{
			if ($this->hasAdminLang)
			{
				$this->_mkdir($this->getBuildFolder() . "/administrator/language");
			}

			if ($this->hasFrontLang)
			{
				$this->_mkdir($this->getBuildFolder() . "/language");
			}
		}

		if ($this->type == "mod")
		{
			$this->_mkdir($this->getBuildFolder() . "/modules/" . $this->ext . "/language");
		}

		if ($this->type == "plg")
		{
			$a = explode("_", $this->ext);

			$this->_mkdir($this->getBuildFolder() . "/plugins/" . $a[1] . "/" . $a[2] . "/administrator/language");
		}

		if ($this->type == "plug")
		{
			$a = explode("_", $this->ext);

			$this->_mkdir($this->getBuildFolder() . "/components/com_comprofiler/plugin/" . $a[1] . "/" . $this->ext . "/administrator/language");
		}

		return true;
	}
574176
protected function checkDirectoryRights()
    {
        $translator = $this->getServiceLocator()->get('translator');
        $installHelper = $this->getServiceLocator()->get('InstallerHelper');

        $configDir = $installHelper->getDir('config');
        $module = $this->getModuleSvc()->getAllModules();

        $success = 0;
        $errors = [];
        $data = [];

        for ($x = 0; $x < count($configDir); $x++) {
            $configDir[$x] = 'config/' . $configDir[$x];
        }
        array_push($configDir, 'config');

        /**
         * Add config platform, MelisSites and public dir to check permission
         */
        array_push($configDir, 'config/autoload/platforms/');
        array_push($configDir, 'module/MelisModuleConfig/');
        array_push($configDir, 'module/MelisModuleConfig/languages');
        array_push($configDir, 'module/MelisModuleConfig/config');
        array_push($configDir, 'module/MelisSites/');
        array_push($configDir, 'dbdeploy/');
        array_push($configDir, 'dbdeploy/data');
        array_push($configDir, 'public/');
        array_push($configDir, 'cache/');
        array_push($configDir, 'test/');

        for ($x = 0; $x < count($module); $x++) {
            $module[$x] = $this->getModuleSvc()->getModulePath($module[$x], false) . '/config';
        }

        $dirs = array_merge($configDir, $module);

        $results = [];
        foreach ($dirs as $dir) {
            if (file_exists($dir)) {
                if ($installHelper->isDirWritable($dir)) {
                    $results[$dir] = 1;
                } else {
                    $results[$dir] = sprintf($translator->translate('tr_melis_installer_step_1_2_dir_not_writable'), $dir);
                    array_push($errors, sprintf($translator->translate('tr_melis_installer_step_1_2_dir_not_writable'), $dir));
                }
            }
        }

        if (empty($errors)) {
            $success = 1;
        }

        $response = [
            'success' => $success,
            'errors' => $errors,
            'data' => $results,
        ];


        return $response;
    }
1103382
private function hasSchema()
    {
        return $this->database
            && ($this->schema ?: $this->database->getSchema())
            && ($platform = $this->getPlatform())
            && $platform->supportsSchemas()
        ;
    }
409504
public static function getModules()
    {
        return \Cache::remember('modules', 604800, function ()
        {
            $diskModules = Module::getModulesFromDisk();
            if ($diskModules)
                return self::checkModulesInDb($diskModules);
            else
                return [];
        });
    }
1364854
public function installModules()
    {
        foreach ($this->getRequiredModules() as $module_id) {
            if ($this->getModuleModel()->install($module_id) !== true) {
                $error = $this->translation->text('Failed to install module @module_id', array('@module_id' => $module_id));
                throw new RuntimeException($error);
            }
        }

        return true;
    }
195582
public static function are_requirements_met() {
        if (self::$requirementsmet === null) {
            $requirementsmet = self::test_unoconv_path()->status === self::UNOCONVPATH_OK;
            $requirementsmet = $requirementsmet && self::is_minimum_version_met();
            self::$requirementsmet = $requirementsmet;
        }

        return self::$requirementsmet;
    }
443356
public function findModules()
    {
        $dirs    = $this->getOption('module_dirs');
        $modules = array();
    
        foreach($dirs as $dir){
            $iterator = new DirectoryIterator($dir);
    
            foreach ($iterator as $file) {
                if (($file->isDir() && substr($file->getBasename(), 0, 1) !== '.') 
                    || ($file->isFile() && $file->getExtension() == 'phar')) {
                    
                    $modules[$file->getRealPath()] = strtolower($file->getBasename());
                }
            }
        }
    
        return $modules;
    }
434466
public function check(): bool
    {
        return $this->installable = $this->items->filter(function ($specification) {
            return $specification->check() === false && $specification->optional() === false;
        })->isEmpty();
    }
141544
public function check()
    {

        $config = $this->getConfig();

        if (isset($config['ext'])) {
            $this->setExt($config['ext']);
        }

        if (isset($config['folder'])) {

            $folder = $config['folder'];
            $this->setFolder($folder);


            if(!$this->getFileSystem()->exists($folder))
            {
                $this->getFileSystem()->createDir($folder);
                chmod($folder, 0777);
            }
        }else{

            return false;
        }

        // we have do something else

        if (function_exists('gzcompress') && function_exists('gzuncompress')) {
            return true;
        }
    }
1243644
public function hasContent() {

    if (count($this->getCategories()) == 0) {
      return FALSE;
    }

    if (count($this->getAllChildren()) == 0) {
      return FALSE;
    }

    return TRUE;
  }
1130524
public function getCoreModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $coreModules = $this->all()->filter(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $coreModules->all();
    }
680837
public function have_pakefile()
    {
        $is_windows = (strtolower(substr(PHP_OS, 0, 3)) == 'win');

        $here = getcwd();
        foreach ($this->PAKEFILES as $file) {
            $path_includes_directory = basename($file) !== $file;

            if ($path_includes_directory) {
                if ($is_windows) {
                    $is_absolute_path = ($file[0] == '\\' or $file[0] == '/' or mb_ereg('^[A-Za-z]+:', $file) === 1);
                } else {
                    $is_absolute_path = $file[0] == '/';
                }
            } else {
                $is_absolute_path = false;
            }

            if ($is_absolute_path) {
                $filepath = $file;
            } else {
                $filepath = $here . DIRECTORY_SEPARATOR . $file;
            }

            if (file_exists($filepath)) {
                $this->pakefile = realpath($filepath);
                return true;
            }
        }

        return false;
    }
627149
public function getInstalls()
    {
        if (!$this->loadRepositories()) {
            return Repository::STATUS_NO_REPOSITORIES;
        }

        $modules = $this->getModulesFromRepository();

        // Is the package already installed? If yes, is a higher version available?
        foreach ($modules as $key => $module) {
            $version = $this->packageService->getVersion($module->name);
            // Not installed yet.
            if ($version) {
                // Older version installed.
                unset($modules[$key]);
            }
        }

        return $modules;
    }