NOTE: This method can only be called after $grav['plugins']->init().

@return array List of failed requirements. If the list is empty, installation can go on.
486631
public function checkRequirements(): array
    {
        $results = [];

        $this->checkVersion($results, 'php','php', $this->requires['php'], PHP_VERSION);
        $this->checkVersion($results, 'grav', 'grav', $this->requires['grav'], GRAV_VERSION);
        $this->checkPlugins($results, $this->requires['plugins']);

        return $results;
    }
283545
public function check(array $requirements)
    {
        $results = [];

        foreach($requirements as $type => $requirement)
        {
            switch ($type) {
                // check php requirements
                case 'php':
                    foreach($requirements[$type] as $requirement)
                    {
                        $results['requirements'][$type][$requirement] = true;

                        if(!extension_loaded($requirement))
                        {
                            $results['requirements'][$type][$requirement] = false;

                            $results['errors'] = true;
                        }
                    }
                    break;
                // check apache requirements
                case 'apache':
                    foreach ($requirements[$type] as $requirement) {
                        // if function doesn't exist we can't check apache modules
                        if(function_exists('apache_get_modules'))
                        {
                            $results['requirements'][$type][$requirement] = true;

                            if(!in_array($requirement,apache_get_modules()))
                            {
                                $results['requirements'][$type][$requirement] = false;

                                $results['errors'] = true;
                            }
                        }
                    }
                    break;
            }
        }

        return $results;
    }
777777
public function missingSettings()
    {
        $missing = [];
        foreach($this->recommendedSettings() as $plugin => $settings) {
            foreach($settings as $setting) {
                /* Get value for the setting */
                $value = $_ENV[$setting] ?? null;

                if(is_null($value)) $missing[$plugin][] = $setting;
            }
        }
        return $missing;
    }
1283265
public function getRequired() : array {
        $required = [];

        foreach($this->required as $component) {
            $required[$component] = $this->getTargetBranch($component);
        }

        return $required;
    }
88551
public function getPlatformRequirements($withDevReqs = false)
    {
        $lockData = $this->getLockData();
        $versionParser = new VersionParser();
        $requirements = array();

        if (!empty($lockData['platform'])) {
            $requirements = $versionParser->parseLinks(
                '__ROOT__',
                '1.0.0',
                'requires',
                isset($lockData['platform']) ? $lockData['platform'] : array()
            );
        }

        if ($withDevReqs && !empty($lockData['platform-dev'])) {
            $devRequirements = $versionParser->parseLinks(
                '__ROOT__',
                '1.0.0',
                'requires',
                isset($lockData['platform-dev']) ? $lockData['platform-dev'] : array()
            );

            $requirements = array_merge($requirements, $devRequirements);
        }

        return $requirements;
    }
600194
private function validateComposerPackages(
        array $pluginRequirements,
        RequirementExceptionStack $exceptionStack
    ): array {
        $shopwareProjectComposer = $this->getComposer($this->projectDir);
        $pluginRequirements = $this->checkComposerDependencies(
            $pluginRequirements,
            $exceptionStack,
            $shopwareProjectComposer
        );

        return $pluginRequirements;
    }
1243398
public function getFirstErrors(): array
    {
        $errors = $this->getErrors();
        if (empty($errors)) {
            return [];
        } else {
            $errors = [];
            foreach ($errors as $name => $es) {
                if (!empty($es)) {
                    $errors[$name] = reset($es);
                }
            }

            return $errors;
        }
    }
1185796
protected function checkRequirements() {
    if (!$this->getInspector()->commandExists("vagrant")) {
      $this->logger->error("Vagrant is not installed.");
      $this->say("Please install all dependencies for Drupal VM by following the Quickstart Guide:");
      $this->say("https://github.com/geerlingguy/drupal-vm#quick-start-guide");
      throw new BltException("Drupal VM requirements are missing.");
    }
    else {
      $this->installVagrantPlugin('vagrant-hostsupdater');
    }
  }
721969
public function getInvalidReleases()
    {
        $releases = $this->getReleases();
        $invalid = array_diff($this->state, array_filter($this->state));
        $invalid = array_keys($invalid);

        return array_intersect($releases, $invalid);
    }
488189
def get_install_requires():
    """"""
    base = os.path.abspath(os.path.dirname(__file__))
    requirements_file = os.path.join(base, 'requirements.txt')
    if not os.path.exists(requirements_file):
        return []
    with open(requirements_file, mode='rt', encoding='utf-8') as f:
        return f.read().splitlines()
905360
protected function _validateContent()
    {
        if (!$this->_workingDir) {
            return false;
        }

        $errors = [];
        if (!is_readable("{$this->_workingDir}src") || !is_dir("{$this->_workingDir}src")) {
            $errors[] = __d('installer', 'Invalid package, missing "src" directory.');
        }

        if (!is_readable("{$this->_workingDir}composer.json")) {
            $errors[] = __d('installer', 'Invalid package, missing "composer.json" file.');
        } else {
            $jsonErrors = Plugin::validateJson("{$this->_workingDir}composer.json", true);
            if (!empty($jsonErrors)) {
                $errors[] = __d('installer', 'Invalid "composer.json".');
                $errors = array_merge($errors, (array)$jsonErrors);
            } else {
                $json = (new File("{$this->_workingDir}composer.json"))->read();
                $json = json_decode($json, true);
                list(, $pluginName) = packageSplit($json['name'], true);

                if ($this->params['theme'] && !str_ends_with($pluginName, 'Theme')) {
                    $this->err(__d('installer', 'The given package is not a valid theme.'));

                    return false;
                } elseif (!$this->params['theme'] && str_ends_with($pluginName, 'Theme')) {
                    $this->err(__d('installer', 'The given package is not a valid plugin.'));

                    return false;
                }

                $this->_plugin = [
                    'name' => $pluginName,
                    'packageName' => $json['name'],
                    'type' => str_ends_with($pluginName, 'Theme') ? 'theme' : 'plugin',
                    'composer' => $json,
                ];

                if (Plugin::exists($this->_plugin['name'])) {
                    $exists = plugin($this->_plugin['name']);
                    if ($exists->status) {
                        $errors[] = __d('installer', '{0} "{1}" is already installed.', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name']]);
                    } else {
                        $errors[] = __d('installer', '{0} "{1}" is already installed but disabled, maybe you want try to enable it?.', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name']]);
                    }
                }

                if ($this->_plugin['type'] == 'theme' &&
                    !is_readable("{$this->_workingDir}webroot/screenshot.png")
                ) {
                    $errors[] = __d('installer', 'Missing "screenshot.png" file.');
                }

                if (isset($json['require'])) {
                    $checker = new RuleChecker($json['require']);
                    if (!$checker->check()) {
                        $errors[] = __d('installer', '{0} "{1}" depends on other packages, plugins or libraries that were not found: {2}', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name'], $checker->fail(true)]);
                    }
                }
            }
        }

        if (!file_exists(ROOT . '/plugins') ||
            !is_dir(ROOT . '/plugins') ||
            !is_writable(ROOT . '/plugins')
        ) {
            $errors[] = __d('installer', 'Write permissions required for directory: {0}.', [ROOT . '/plugins/']);
        }

        foreach ($errors as $message) {
            $this->err($message);
        }

        return empty($errors);
    }
629891
protected function getFailedJobs()
    {
        $failed = $this->app['queue.failer']->all();

        return collect($failed)->map(function ($failed) {
            return $this->parseFailedJob((array) $failed);
        })->filter()->all();
    }
418780
public function getErrors(): array
    {
        $error = [];

        foreach ($this->list as $r) {
            $error[$r->getPropertyPath()] = $r->getMessage();
        }

        return $error;
    }
428338
public function requirements()
    {
        $phpSupportInfo = $this->requirements->checkPHPversion(
            config('installer.core.minPhpVersion')
        );
        $requirements = $this->requirements->check(
            config('installer.requirements')
        );

        return view('vendor.installer.requirements', compact('requirements', 'phpSupportInfo'));
    }
25814
public function checkPhpDependencies()
    {
        $errors = array();
        foreach($this->getDependencyPhpExtensions() as $dep)
        {
            if(!extension_loaded($dep['name'])) {
                $errors[] = $dep;
            }
        }
        if(count($errors)) {
            return $errors;
        }
        return true;
    }
961773
def get_requirements():
    """"""

    install_requires = []
    with open("requirements/project.txt") as f:
        for line in f:
            if not line.startswith("#"):
                install_requires.append(line.strip())
    return install_requires
181379
public function getValidationErrors()
    {
        $errors = $this->errors;

        if (isset($this->validator)) {
            $validator_errors = $this->validator->getErrors();
            $errors = array_merge($errors, $validator_errors);
        }

        return $errors;
    }