Is the required OCI server package installed?
@return bool
498905
protected function oci_package_installed() {
        $sql = "SELECT 1
                FROM user_objects
                WHERE object_type = 'PACKAGE BODY'
                  AND object_name = 'MOODLELIB'
                  AND status = 'VALID'";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $stmt = $this->parse_query($sql);
        $result = oci_execute($stmt, $this->commit_status);
        $this->query_end($result, $stmt);
        $records = null;
        oci_fetch_all($stmt, $records, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
        oci_free_statement($stmt);
        return isset($records[0]) && reset($records[0]) ? true : false;
    }
1008790
public function isServerValid()
    {
        return ($this->nb_server !== null &&
                ($this->nb_server->isBuiltIn() || $this->nb_server->isFetched()));
    }
613632
public function isDrupalInstalled() {
    $this->logger->debug("Verifying that Drupal is installed...");
    $result = $this->executor->drush("sqlq \"SHOW TABLES LIKE 'config'\"")->run();
    $output = trim($result->getMessage());
    $installed = $result->wasSuccessful() && $output == 'config';

    return $installed;
  }
1339002
public function isBltAliasInstalled() {
    $cli_config_file = $this->getCliConfigFile();
    if (!is_null($cli_config_file) && file_exists($cli_config_file)) {
      $contents = file_get_contents($cli_config_file);
      if (strstr($contents, 'function blt')) {
        return TRUE;
      }
    }

    return FALSE;
  }
493100
public function wizardInstallDrupal() {
    if (!$this->getInspector()->isMySqlAvailable()) {
      return FALSE;
    }
    if (!$this->getInspector()->isDrupalInstalled()) {
      $this->logger->warning('Drupal is not installed.');
      $confirm = $this->confirm("Do you want to install Drupal?");
      if ($confirm) {
        $bin = $this->getConfigValue('composer.bin');
        $this->executor
          ->execute("$bin/blt setup")
          ->interactive($this->input()->isInteractive())
          ->run();
        $this->getInspector()->clearState();
      }
    }
  }
434466
public function check(): bool
    {
        return $this->installable = $this->items->filter(function ($specification) {
            return $specification->check() === false && $specification->optional() === false;
        })->isEmpty();
    }
1336026
public static function isPiwikInstalled()
    {
        $config = Config::getInstance()->getLocalPath();
        $exists = file_exists($config);

        // Piwik is not installed if the config file is not found
        if (!$exists) {
            return false;
        }

        $general = Config::getInstance()->General;

        $isInstallationInProgress = false;
        if (array_key_exists('installation_in_progress', $general)) {
            $isInstallationInProgress = (bool) $general['installation_in_progress'];
        }
        if ($isInstallationInProgress) {
            return false;
        }

        // Check that the database section is really set, ie. file is not empty
        if (empty(Config::getInstance()->database['username'])) {
            return false;
        }
        return true;
    }
412065
public function isPackage()
	{
		// A SEC JSON package has a file called <ciknumber>-manifest.xml
		try
		{
			$manifest = $this->getFile( XBRL_SEC_XML_Package::manifestFilename );
			if ( ! $manifest )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:metadataFileNotFound", "The package does not contain a manifest.xml file" );
			}

			return $this->isValidMetaFile();
		}
		catch ( Exception $ex )
		{
			$code = $ex instanceof XBRL_TaxonomyPackageException ? $ex->error : $ex->getCode();
			$this->errors[ $code ] = $ex->getMessage();
		}

		return false;

	}
770864
public function hasPhpIniConfigIssue()
    {
        foreach ($this->requirements as $req) {
            if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
                return true;
            }
        }

        return false;
    }
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'));
    }
846212
public static function isPhpCliMode()
    {
        if (is_bool(self::$isCliMode)) {
            return self::$isCliMode;
        }

        if(PHP_SAPI == 'cli'){
            return true;
        }
        
        if(self::isPhpCgiType() && (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR']))){
            return true;
        }
        
        return false;
    }
275675
private function isInstalledGlobally($package)
    {
        if (!isset($this->globalList)) {
            $this->globalList = $this->shell->execute(
                ['npm', 'ls', '--global', '--no-progress', '--depth=0']
            );
        }

        return $this->globalList && strpos($this->globalList, $package . '@') !== false;
    }
1351701
protected function isInstalled()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        foreach (TwoStreamServiceProvider::pathsToPublish(strtolower(TwoStream::PACKAGE), 'required') as $required) {
            if (! $disk->exists(str_replace(['.stub', app_path()], ['.php', ''], $required))) {
                return false;
            }
        }
        
        return true;
    }
211460
public function isAvailable(): bool
    {
        $sourcePath = "{$this->packageInstallDir}/.installer/%s/files";
        foreach ($this->projectType->getProjectDirs() as $projectDir) {
            if (is_dir(sprintf($sourcePath, $projectDir))) {
                return true;
            }
        }

        return false;
    }
1069676
protected function validateRequirementsInstall()
    {
        if ($this->isExcluded('requirements')) {
            return null;
        }

        if ($this->config->isInitialized()) {
            $error = $this->translation->text('System already installed');
            $this->setError('installed', $error);
            return false;
        }

        $requirements = $this->install->getRequirements();
        $errors = $this->install->getRequirementErrors($requirements);

        if (empty($errors['danger'])) {
            return true;
        }

        $messages = array();
        $messages[] = $this->translation->text('Please fix all critical errors in your environment');

        foreach ($requirements as $items) {
            foreach ($items as $name => $info) {
                if (in_array($name, $errors['danger'])) {
                    $status = empty($info['status']) ? $this->translation->text('No') : $this->translation->text('Yes');
                    $messages[] = " {$info['message']} - $status";
                }
            }
        }

        $this->setError('requirements', implode(PHP_EOL, $messages));
        return false;
    }
797603
protected function requireDependencies()
    {
        if (!empty($this->pharLocation)) {
            include_once 'phar://' . $this->pharLocation . '/vendor/autoload.php';
        }

        // check 2.x version (composer/phar)
        if (class_exists('PDepend\\TextUI\\Runner')) {
            return;
        }

        $this->oldVersion = true;

        // check 1.x version (composer)
        if (class_exists('PHP_Depend_TextUI_Runner')) {
            // include_path hack for PHP_Depend 1.1.3
            $rc = new ReflectionClass('PHP_Depend');
            set_include_path(get_include_path() . ":" . realpath(dirname($rc->getFileName()) . "/../"));

            return;
        }

        @include_once 'PHP/Depend/Autoload.php';

        if (!class_exists('PHP_Depend_Autoload')) {
            throw new BuildException(
                'PhpDependTask depends on PHP_Depend being installed and on include_path',
                $this->getLocation()
            );
        }

        // register PHP_Depend autoloader
        $autoload = new PHP_Depend_Autoload();
        $autoload->register();
    }
364051
protected function installRuleset()
    {
        if (!file_exists($this->pathRulesetLocal)
            || $this->confirm('Overwrite local configuration with our copy? (y/n) [y]')
        ) {
            $copy = copy($this->pathRulesetStock, $this->pathRulesetLocal);

            return $copy;
        }

        return false;
    }