Check a dependencies list against the list of installed plugins.
@param array $dependencies compenent name to required version or ANY_VERSION.
@return bool true if all the dependencies are satisfied.
968232
public function are_dependencies_satisfied($dependencies) {
        foreach ($dependencies as $component => $requiredversion) {
            $otherplugin = $this->get_plugin_info($component);
            if (is_null($otherplugin)) {
                return false;
            }

            if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
                return false;
            }
        }

        return true;
    }
986945
public function check_dependencies(array $dependencies)
	{
		foreach($dependencies as $dep)
		{
			// get the section name and identifier
			$sections = explode('.', $dep);
			if (count($sections) > 1)
			{
				$identifier = array_pop($sections);
				$sections = '.'.implode('.', $sections);

			}
			else
			{
				$identifier = $dep;
				$sections = '';
			}

			// get the cache index
			$index = xcache_get($this->config['cache_id'].$sections);

			// get the key from the index
			$key = isset($index[$identifier][0]) ? $index[$identifier] : false;

			// key found and newer?
			if ($key === false or $key[1] > $this->created)
			{
				return false;
			}
		}
		return true;
	}
606001
def check_dependencies(specs)
      missing = check_app_requirement(specs)

      present = exclude_specs(installed, specs)
      future = present + specs

      check_all_dependencies(specs, future, missing)
    end
303426
public function is_core_dependency_satisfied($moodleversion) {

        if (empty($this->versionrequires)) {
            return true;

        } else {
            return (double)$this->versionrequires <= (double)$moodleversion;
        }
    }
974981
public function install($opts = ['prod' => false])
    {
        $prod = isset($opts['prod']) && $opts['prod'] ? true : false;
        $this->info('Installing project dependencies');
        $this->composerInstall(['prod' => $prod]);
        $this->info('Project dependencies installed');
    }
1205340
public static function generate_style_dependencies( $maybe_dependencies ) {
		$dependencies = [];
		foreach ( $maybe_dependencies as $dependency ) {
			if ( ! wp_style_is( $dependency, 'enqueued' ) && ! wp_style_is( $dependency, 'registered' ) ) {
				continue;
			}
			$dependencies[] = $dependency;
		}
		return $dependencies;
	}
1261832
private function setDependencies(array $packages): self
    {
        $dependencies = [];
        foreach ($packages as $package) {
            foreach ($package->getRequires() as $link) {
                $dependencies[$link->getTarget()][$link->getSource()] = $link->getSource();
            }
        }

        $this->dependencies = $dependencies;

        return $this;
    }
625082
protected function sysVersionDependency($version)
    {
        $sysVersion = new Version($this->sysMajorVersion.'.'.$this->sysMinorVersion.'.'.$this->sysPathVersion);
        $needVersion = new Version($version);

        if (!$sysVersion->isPartOf($needVersion))
        {
            $this->errors->add('module_dependency_sys', 'This module not made for current version of '.$this->systemName.', made for '.$version);
            return false;
        }
        return false;
    }
584051
private function fixDependencies(array $tests)
    {
        $tests_dependencies = $tests_methods = [];

        foreach ($tests as $i => $test) {
            $reflected = new \ReflectionObject($test);
            $name_field = $dependencies_field = null;

            while ($reflected = $reflected->getParentClass()) {
                try {
                    if (empty($dependencies_field)) {
                        $dependencies_field = $reflected->getProperty('dependencies');
                        $dependencies_field->setAccessible(true);
                    }
                    if (empty($name_field)) {
                        $name_field = $reflected->getProperty('name');
                        $name_field->setAccessible(true);
                    }
                } catch (\ReflectionException $e ){
                    //do nothing
                }
            }

            if (empty($name_field)) {
                return $tests;
            }

            $tests_methods[$name_field->getValue($test)] = $i;

            if (empty($dependencies = $dependencies_field->getValue($test))){
                continue;
            }
            foreach ($dependencies as $dependency) {
                $tests_dependencies[$name_field->getValue($test)] = $dependency;
            }
        }

        if (empty($tests_dependencies)) {
            return $tests;
        }

        $new_order = $this->setOrder($tests_dependencies, $tests_methods);
        $new_tests_order = [];
        foreach ($new_order as $test_name) {
            $new_tests_order[] = $tests[$tests_methods[$test_name]];
        }

        return $new_tests_order;
    }
199128
def dependencies_are_newer(self, files, dependencies):
        
        dependency_mtimes = [
            os.path.getmtime(filename) for filename in dependencies]
        file_mtimes = [os.path.getmtime(filename) for filename in files]
        result = False
        for file_mtime in file_mtimes:
            for dependency_mtime in dependency_mtimes:
                if dependency_mtime > file_mtime:
                    result = True
        return result
911400
private function doResolve(array &$dependencies, array &$ordered, array $available): bool
    {
        $failed = true;

        foreach ($dependencies as $name => $requires) {
            if (true === $this->canBeResolved($requires, $available, $ordered)) {
                $failed = false;
                $ordered[] = $name;

                unset($dependencies[$name]);
            }
        }

        return !$failed;
    }
346514
private function InstallDependency(BundleDependency $dependency)
    {
        $bundle = $dependency->BundleName();
        if (array_key_exists($bundle, $this->failedBundles))
        {
            return false;
        }
        $installedVersion = $this->InstalledVersion($bundle);
        $manifest = ClassFinder::Manifest($bundle);
        if (!$installedVersion || version_compare($installedVersion, $manifest->Version()) < 0)
        {
            if (!$this->InstallBundle($bundle))
            {
                return false;
            }
        }
        return true;
    }
38220
public function requiredBy()
    {
        if ($cache = $this->config('required_by')) {
            return collection($cache);
        }

        Plugin::dropCache();
        $out = [];
        $plugins = Plugin::get()->filter(function ($v, $k) {
            return $v->name() !== $this->name();
        });

        foreach ($plugins as $plugin) {
            if ($dependencies = $plugin->dependencies($plugin->name)) {
                $packages = array_map(function ($item) {
                    list(, $package) = packageSplit($item, true);

                    return strtolower($package);
                }, array_keys($dependencies));

                if (in_array(strtolower($this->name()), $packages)) {
                    $out[] = $plugin;
                }
            }
        }

        $this->config('required_by', $out);

        return collection($out);
    }
623806
public static function prepare_for_javascript($dependencies) {
        $result = [];
        foreach ($dependencies as $d) {
            if (!isset($result[$d->dependenton])) {
                $result[$d->dependenton] = [];
            }
            if (!isset($result[$d->dependenton][$d->condition])) {
                $result[$d->dependenton][$d->condition] = [];
            }
            if (!isset($result[$d->dependenton][$d->condition][$d->value])) {
                $result[$d->dependenton][$d->condition][$d->value] = [];
            }
            $result[$d->dependenton][$d->condition][$d->value][] = $d->settingname;
        }
        return $result;
    }
433890
public function addDependencies(array $dependenciesToAdd) {
    $this->setCollectedDependencies(array_merge(array_unique(array_merge($this->getCollectedDependencies(), $dependenciesToAdd))));
    return $this;
  }
12283
public static function generate_script_dependencies( $maybe_dependencies ) {
		$dependencies = [];
		foreach ( $maybe_dependencies as $dependency ) {
			if ( ! wp_script_is( $dependency, 'enqueued' ) && ! wp_script_is( $dependency, 'registered' ) ) {
				continue;
			}
			$dependencies[] = $dependency;
		}
		return $dependencies;
	}
1272618
protected function resolveDependencies( array $dependencies )
	{
		$results = [];

		foreach( $dependencies as $dependency ) {
			// If the class is null, the dependency is a string or some other primitive type
			$results[] = !is_null( $class = $dependency->getClass() )
				? $this->resolveClass( $dependency )
				: null;
		}

		return $results;
	}