Gets all installed software from this server

@param array $scopes optional

@return array List of PatrolSdk\Software
423328
public function allSoftware($scopes = []) {
        if (!$this->id) {
            throw new Exception("The server has no ID, can\'t get software");
        }

        $software = new Software($this->patrol);

        $software->defaults([
            'server_id' => $this->id
        ]);

        return $software->all($scopes);
    }
639122
public function getScopes()
    {
        $scopes = array();
        $repositories = $this->getEntityRepositories($this->_scope_identifier);

        foreach ($repositories as $repository) {
            $scopes[] = array('repository' => $repository,'type' => $this->_scope_type);
        }

        return $scopes;
    }
1022256
public static function getAvailablePackages($filterInstalled = true)
    {
        $app = ApplicationFacade::getFacadeApplication();

        return $app->make(PackageService::class)->getAvailablePackages($filterInstalled);
    }
1198720
public function getAvailablePackages($onlyNotInstalled = true)
    {
        $dh = $this->application->make('helper/file');
        $packages = $dh->getDirectoryContents(DIR_PACKAGES);
        if ($onlyNotInstalled) {
            $handles = $this->getInstalledHandles();
            $packages = array_diff($packages, $handles);
        }

        if (count($packages) > 0) {
            $packagesTemp = [];
            // get package objects from the file system
            foreach ($packages as $p) {
                if (file_exists(DIR_PACKAGES . '/' . $p . '/' . FILENAME_CONTROLLER)) {
                    $pkg = $this->getClass($p);
                    if (!empty($pkg)) {
                        $packagesTemp[] = $pkg;
                    }
                }
            }
            $packages = $packagesTemp;
        }

        return $packages;
    }
506357
public function authenticateForScope($scopes)
  {
    if ($this->token && $this->tokenScopes == $scopes) {
      return $this->token;
    }

    $cacheKey = self::CACHE_PREFIX;
    if (is_string($scopes)) {
      $cacheKey .= $scopes;
    } else if (is_array($scopes)) {
      $cacheKey .= implode(":", $scopes);
    }

    $this->token = $this->client->getCache()->get($cacheKey);
    if (!$this->token) {
      $this->retrieveToken($scopes, $cacheKey);
    } else if ($this->token['expiration_time'] < time()) {
      $this->client->getCache()->delete($cacheKey);
      $this->retrieveToken($scopes, $cacheKey);
    }

    $this->tokenScopes = $scopes;
    return $this->token;
  }
1207302
public function getScopes()
    {
        if ($this->scopes === null) {
            $this->scopes = $this->formatScopes(
                $this->server->getAccessTokenStorage()->getScopes($this)
            );
        }

        return $this->scopes;
    }
1070189
protected function filterActiveAppServers($appServerList)
    {
        $activeServerList = [];
        /** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $server */
        foreach ($appServerList as $server) {
            if ($server->isInUse($this->currentTime)) {
                $activeServerList[$server->getId()] = $server;
            }
        }
        return $activeServerList;
    }
230603
public function getAuthorizationUrl($scopes = [])
    {
        $this->provider;
        $authorizationUrl = $this->provider->getAuthorizationUrl([
            'scope' => join(' ', $scopes)
        ]);
        $_SESSION['oauth2_lockme_state'] = $this->provider->getState();
        return $authorizationUrl;
    }
262737
public function getInstalled()
    {
        if (!$this->db->isInitialized()) {
            return array();
        }

        $modules = &gplcart_static('module.installed.list');

        if (isset($modules)) {
            return $modules;
        }

        $options = array(
            'index' => 'module_id',
            'unserialize' => 'settings'
        );

        return $modules = $this->db->fetchAll('SELECT * FROM module', array(), $options);
    }
693146
protected function getFileLoaders($paths)
    {
        $loaders = [];

        foreach ($paths as $path) {
            $loaders[] = $this->getFileLoaderInstance($path);
        }

        return $loaders;
    }
861244
public function addScopes(array $scopes)
    {
        foreach ($scopes as $name => $config) {

            $scopeObj = $this->makeFilterScope($name, $config);

            /*
             * Check that the filter scope matches the active context
             */
            if ($scopeObj->context !== null) {
                $context = is_array($scopeObj->context) ? $scopeObj->context : [$scopeObj->context];
                if (!in_array($this->getContext(), $context)) {
                    continue;
                }
            }

            /*
             * Validate scope model
             */
            if (isset($config['modelClass'])) {
                $class = $config['modelClass'];
                $model = new $class;
                $this->scopeModels[$name] = $model;
            }

            /*
             * Ensure scope type options are set
             */
            $scopeProperties = [];
            switch ($scopeObj->type) {
                case 'date':
                case 'daterange':
                    $scopeProperties = [
                        'minDate'   => '2000-01-01',
                        'maxDate'   => '2099-12-31',
                        'firstDay'  => 0,
                        'yearRange' => 10,
                    ];

                    break;
            }

            foreach ($scopeProperties as $property => $value) {
                if (isset($config[$property])) {
                    $value = $config[$property];
                }

                $scopeObj->{$property} = $value;
            }

            $this->allScopes[$name] = $scopeObj;
        }
    }
891331
protected function _getServices($services)
    {
        if ($services) {
            foreach ($services as $index => $service) {
                if (!$this->_di->has($service)) {
                    if ($this->_di->has($service . 'Mongodb')) {
                        $services[$index] = $service . 'Mongodb';
                    } elseif ($this->_di->has($service . '_mongodb')) {
                        $services[$index] = $service . '_mongodb';
                    } else {
                        $this->console->warn(['`:service` service is not exists: ignoring', 'service' => $service]);
                        unset($services[$index]);
                    }
                }
            }
        } else {
            $services = [];
            foreach ($this->configure->components as $service => $config) {
                $config = json_encode($config, JSON_UNESCAPED_SLASHES);
                if (preg_match('#mongodb://#', $config)) {
                    $services[] = $service;
                }
            }
        }

        return $services;
    }
1298145
public function withoutGlobalScopes(array $scopes = null)
    {
        $this->model = $this->model->withoutGlobalScopes($scopes);
        return $this;
    }
792879
protected function getInstalledServices(): array
    {
        $reflection = new \ReflectionObject(new ClassLoader());
        $psr4File = dirname($reflection->getFileName()) . '/autoload_psr4.php';

        $psr4Prefixes = include $psr4File;
        $installedServices = preg_filter(
            '~^DMT\\\WebservicesNl\\\((?!Client).+)\\\~', '$1',
            array_keys((array) $psr4Prefixes)
        );

        return $installedServices;
    }
1007116
public function extract(array $scopes, array $claims)
    {
        $claimData  = [];
        $keys       = array_keys($claims);

        foreach ($scopes as $scope) {
            $scopeName = ($scope instanceof ScopeEntityInterface) ? $scope->getIdentifier() : $scope;

            $claimSet = $this->getClaimSet($scopeName);
            if (null === $claimSet) {
                continue;
            }

            $intersected = array_intersect($claimSet->getClaims(), $keys);

            if (empty($intersected)) {
                continue;
            }

            $data = array_filter($claims,
                function($key) use ($intersected) {
                    return in_array($key, $intersected);
                },
                ARRAY_FILTER_USE_KEY
            );

            $claimData = array_merge($claimData, $data);
        }

        return $claimData;
    }
411988
public function getList()
    {
        $modules = &gplcart_static('module.list');

        if (isset($modules)) {
            return $modules;
        }

        $installed = $this->getInstalled();

        $modules = array();

        foreach ($this->scan() as $module_id => $info) {
            $modules[$module_id] = $this->prepareInfo($module_id, $info, $installed);
        }

        gplcart_array_sort($modules);

        return $modules;
    }
725643
public function getInstalledPlugins()
    {
        $arr = array();

        foreach ($this->pluginInformations as $single) {
            $arr = array_merge($arr, $single->getInstalledPlugins());
        }

        return $arr;
    }