Get outdated packages with their current and latest version.

@param array $excluded

@return array
483620
public function getOutdatedPackages(array $excluded = [])
    {
        // Get all installed and required packages.
        $installed = $this->composer->getInstalledPackages();
        $required = $this->composer->getRequiredPackages();

        $outdated = [];

        // Get the installed version number of the required packages.
        $packages = array_intersect_key($installed, $required);

        foreach ($packages as $package) {
            $name = $package['name'];
            $version = Version::normalize($package['version']);
            $prettyVersion = $required[$name]['version'];
            $devDependency = $package['devDependency'];

            if (in_array($name, $excluded)) {
                continue;
            }

            $package = new Package($name, $version, $prettyVersion, $devDependency);

            if ($package->isOutdated()) {
                $outdated[] = $package;
            }
        }

        return $outdated;
    }
1301005
public static function getByVersionNumber($version)
    {
        $updates = id(new Update())->getLocalAvailableUpdates();
        foreach ($updates as $up) {
            if ($up->getUpdateVersion() == $version) {
                return $up;
            }
        }
    }
1026089
public function getUpdates()
    {
        if (!$this->loadRepositories()) {
            return Repository::STATUS_NO_REPOSITORIES;
        }

        $modules = $this->getModulesFromRepository();

        // Is a higher version of an already installed package available?
        foreach ($modules as $key => $module) {
            $version = $this->packageService->getVersion($module->name);

            if (!$version) {
                // Not installed at all.
                unset($modules[$key]);
            } elseif (version_compare($version, $module->version, '<')) {
                // Older version installed.
                $modules[$key]->versionInstalled = $version;
            } else {
                unset($modules[$key]);
            }
        }

        return $modules;
    }
502821
private function getExcludedFiles(PackageInterface $package)
    {
        $type = self::EXCLUDE_FILES_PROPERTY;

        $autoload = $package->getAutoload();

        // Skip misconfigured or empty packages
        if (isset($autoload[$type]) && is_array($autoload[$type])) {
            return $autoload[$type];
        }

        $extra = $package->getExtra();

        // Skip misconfigured or empty packages
        if (isset($extra[$type]) && is_array($extra[$type])) {
            return $extra[$type];
        }

        return null;
    }
1096352
protected function getFilteredFieldNames(array $exclude)
    {
        $fieldNames = $this->getFieldNames(true);
        $result     = [];
        foreach ($fieldNames as $fieldName) {
            if (!in_array($fieldName, $exclude)) {
                $result[] = $fieldName;
            }
        }
        return $result;
    }
1209382
public static function get_version($package = 'project') {
		if (Config::$version_storage == 'file') {
			return self::file_get_version($package);
		} elseif (Config::$version_storage == 'database') {
			return self::database_get_version($package);
		} else {
			throw new \Exception('Incorrect "version_storage" config setting');
		}
	}
1209772
public function getCached()
    {
        if (isset(static::$packages)) {
            return static::$packages;
        }

        $path = $this->getCachePath();

        $configPath = app_path('Config/Packages.php');

        $packagesPath = base_path('vendor/nova-packages.php');

        if ($this->isCacheExpired($path, $packagesPath) || $this->isCacheExpired($path, $configPath)) {
            $packages = $this->getPackages();

            $this->writeCache($path, $packages);
        }

        // The packages cache is valid.
        else {
            $packages = collect(
                $this->files->getRequire($path)
            );
        }

        return static::$packages = $packages;
    }
1042264
public function inactiveMigrations()
    {
        $inactiveMigrations = [];
        $migration_arr = [];

        // Package Migrations
        $tables = $this->migrations_tables;

        // Application active migrations
        $migrations = DB::select('select * from '.DB::getTablePrefix().'migrations');

        foreach ($migrations as $migration_parent) { // Count active package migrations
            $migration_arr[] = $migration_parent->migration;
        }

        foreach ($tables as $table) {
            if (!in_array($table, $migration_arr)) {
                $inactiveMigrations[] = $table;
            }
        }

        return $inactiveMigrations;
    }
515861
public function getVersionAvailable($prepend = '', $append = '') : string
    {
        $version = '';
        if ($this->versionFileExists()) {
            $version = $this->getVersionFile();
        } else {
            $releaseCollection = $this->getPackageReleases();
            if ($releaseCollection->isEmpty()) {
                throw new \Exception('Retrieved version list is empty.');
            }
            $version = $releaseCollection->first()->name;
        }

        return $version;
    }
758398
public function getComponentUpdates()
    {
        $componentsToCheck = array(
            'core' => Version::VERSION
        );

        $manager = \Piwik\Plugin\Manager::getInstance();
        $plugins = $manager->getLoadedPlugins();
        foreach ($plugins as $pluginName => $plugin) {
            if ($manager->isPluginInstalled($pluginName)) {
                $componentsToCheck[$pluginName] = $plugin->getVersion();
            }
        }

        $columnsVersions = $this->columnsUpdater->getAllVersions($this);
        foreach ($columnsVersions as $component => $version) {
            $componentsToCheck[$component] = $version;
        }

        $componentsWithUpdateFile = $this->getComponentsWithUpdateFile($componentsToCheck);

        if (count($componentsWithUpdateFile) == 0) {
            $this->columnsUpdater->onNoUpdateAvailable($columnsVersions);

            return null;
        }

        return $componentsWithUpdateFile;
    }
741305
public function getMigrationStatus(Bundle $bundle)
    {
        $config = $this->getConfiguration($bundle);

        if (is_dir($config->getMigrationsDirectory())) {
            $currentVersion = $config->getCurrentVersion();
            $availableVersions = $config->getAvailableVersions();
            array_unshift($availableVersions, '0');
        } else {
            $currentVersion = '0';
            $availableVersions = [];
        }

        return [
            self::STATUS_CURRENT => $currentVersion,
            self::STATUS_AVAILABLE => $availableVersions,
            self::VERSION_LATEST => $config->getLatestVersion(),
        ];
    }
260632
public function getSortedProductionVersions($descending = false)
    {
        $versions = [];
        foreach ($this->getVersions() as $v) {
            if (strpos($v->getVersion(), Package\Version::DEV_PREFIX) !== 0) {
                $versions[] = $v;
            }
        }
        usort($versions, function (Package\Version $a, Package\Version $b) use ($descending) {
            return version_compare($a->getVersion(), $b->getVersion()) * ($descending ? -1 : 1);
        });

        return $versions;
    }
520761
private function get_excluded_tags($exclude)
	{
		$ret = array();

		foreach($this->bbcodes as $bbcode)
			if($bbcode->auto_detect_exclude() & $exclude)
				$ret[] = $bbcode->tag();

		return $ret;
	}
1033696
protected function getVersionValues(array $values)
    {
        $array = [];

        $versionedKeys = $this->model->getVersionedAttributeNames();

        foreach ($values as $key => $value) {
            if ($newKey = $this->isVersionedKey($key, $versionedKeys)) {
                $array[$newKey] = $value;
            }
        }

        return $array;
    }
427181
public static function getInstalledVersion($package)
    {
        $composer = ComposerInformation::getLock();

        $data = ArrayHelper::query($composer['packages'], ['name' => $package]);

        if (isset($data[0]['version'])) {
            return $data[0]['version'];
        }

        return null;
    }
182429
def get_version(package_name, ignore_cache=False):
    
    if ignore_cache:
        with microcache.temporarily_disabled():
            found = helpers.regex_in_package_file(
                VERSION_SET_REGEX, '_version.py', package_name, return_match=True
            )
    else:
        found = helpers.regex_in_package_file(
            VERSION_SET_REGEX, '_version.py', package_name, return_match=True
        )
    if found is None:
        raise ProjectError('found {}, but __version__ is not defined')
    current_version = found['version']
    return current_version
1257721
public static function get_include_files( $directory, $exclude_underscore = false ) {
		$return = [
			'files'       => [],
			'directories' => [],
		];

		if ( ! is_dir( $directory ) ) {
			return $return;
		}

		$directory_iterator = new \DirectoryIterator( $directory );

		foreach ( $directory_iterator as $file ) {
			if ( $file->isDot() ) {
				continue;
			}

			if ( $file->isDir() ) {
				$return['directories'][] = $file->getPathname();
				continue;
			}

			if ( 'php' !== $file->getExtension() ) {
				continue;
			}

			if ( $exclude_underscore ) {
				if ( 0 === strpos( $file->getBasename(), '_' ) ) {
					continue;
				}
			}

			$return['files'][] = $file->getPathname();
		}

		return $return;
	}