Install dependencies globally.

@param array $dependencies
770516
private function installGlobal(array $dependencies)
    {
        $requirements = [];
        foreach ($dependencies as $package => $version) {
            $requirements[] = $version === '*' ? $package : $package . ':' . $version;
        }
        $this->runCommand(
            'composer global require '
            . '--no-progress --prefer-dist --optimize-autoloader --no-interaction '
            . implode(' ', array_map('escapeshellarg', $requirements))
        );
    }
574231
protected function resolveDependencies(array $dependencies)
    {
        foreach ($dependencies as $dependency => $type) {
            call_user_func_array([$this, $type], [$dependency]);
        }
    }
469193
public function dispatchRequirements($dependencies, $parameters) {
		$dispatches = [];

		foreach ($dependencies as $dependency) {
			list($name, $instance) = $this->extractDependency($dependency, $parameters);

			$dispatches[$name] = $instance;
		}

		return $dispatches;
	}
1303775
public function addDeferred($provider, array $dependencies)
    {
        foreach($dependencies as $name)
        {
            @list($type, $dependency) = explode('.', $name, 2);

            if(!$dependency)
            {
                $dependency = $type;

                $type = 'service';
            }
            else
            {
                if(!in_array($type, array('service', 'callable', 'factory')))
                {
                    $type = 'service';

                    $dependency = $name;
                }
            }

            $this->providersDeferred[$type.'.'.$dependency] = $provider;
        }

        return $this;
    }
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;
    }
810909
function preprocessDependencies(dependencies) {
		if (Array.isArray(dependencies)) {
			// remove .library-preload suffix from dependencies
			return dependencies.map(function (dep) {
				return dep.replace(/\.library-preload$/, '');
			});
		}
		return dependencies;
	}
61819
public function setDependencies(array $dependencies)
    {
        $this->dependencies = [];

        foreach ($dependencies as $dependency) {
            if (!($dependency instanceof ModuleInterface)) {
                throw new InvalidParamException('Dependency must implement ModuleInterface');
            }

            $this->dependencies[] = $dependency;
        }

        return $this;
    }
734422
public function check_dependencies(array $dependencies)
	{
		foreach($dependencies as $dep)
		{
			if (is_file($file = static::$path.str_replace('.', DS, $dep).'.cache'))
			{
				$filemtime = filemtime($file);
				if ($filemtime === false || $filemtime > $this->created)
				{
					return false;
				}
			}
			elseif (is_file($dep))
			{
				$filemtime = filemtime($dep);
				if ($filemtime === false || $filemtime > $this->created)
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}

		return true;
	}
428438
public function setInstallInfos(array $installInfos)
    {
        $this->installInfos = array();

        foreach ($installInfos as $installInfo) {
            $this->addInstallInfo($installInfo);
        }
    }
230636
public function addAsset($type, $assetName, $fileName, $dependencies = array())
    {
        if (!isset($this->assets[$type]) || !is_array($this->assets[$type])) {
            $this->assets[$type] = array();
        }
        
        $asset = new Asset(
            $type,
            $assetName,
            $this->buildSourceFilePath($fileName),
            $dependencies
        );
        
        $this->assets[$type][$assetName] = $asset;
        $this->saveAssets();
    }
112270
protected function init(){
        //Carga las dependencias en base a la lista de archivos definidos en configuracion global
        $this->dependencies= array();
        foreach ($this->context->getDependenciesFile() as $nameFile) {
            $this->dependencies= array_merge($this->dependencies, $this->context->readConfigurationFile($nameFile));
        }
        //Define las dependencias que se cargan segun Type
        $this->loadDependencies= array();
        foreach ($this->dependencies as $key => $value) {
            if(isset($value['load_in'])){
                $this->loadDependencies[$key]= $value;
            }
        }
    }
1093506
public function setDependencies(array $moduleNames)
    {
        $this->dependencies = array();

        foreach ($moduleNames as $moduleName) {
            $this->dependencies[$moduleName] = true;
        }
    }
557072
private function validateDependencies(array $fixtures, FixtureInterface $fixture) : void
    {
        if (! $fixture instanceof DependentFixtureInterface) {
            return;
        }

        $dependenciesClasses = $fixture->getDependencies();

        foreach ($dependenciesClasses as $class) {
            if (! array_key_exists($class, $fixtures)) {
                throw new RuntimeException(sprintf('Fixture "%s" was declared as a dependency for fixture "%s", but it was not included in any of the loaded fixture groups.', $class, get_class($fixture)));
            }
        }
    }
953620
protected function resolveDependencies( array $dependencies, array $parameters ) {

		$args = [];

		foreach ( $dependencies as $dependency ) {

			// If a dependency is set via the parameters passed in, use it.
			if ( isset( $parameters[ $dependency->getName() ] ) ) {

				$args[] = $parameters[ $dependency->getName() ];

			// If the parameter is a class, resolve it.
			} elseif ( ! is_null( $dependency->getClass() ) ) {

				$args[] = $this->resolve( $dependency->getClass()->getName() );

			// Else, use the default parameter value.
			} elseif ( $dependency->isDefaultValueAvailable() ) {

				$args[] = $dependency->getDefaultValue();
			}
		}

		return $args;
	}
1239354
public static function addDependency($locale, $dependsOn) {
		$locale = self::normalize($locale);
		$dependsOn = self::normalize($dependsOn);
		self::$dependencies[$locale] = $dependsOn;
	}
241924
protected function checkDependency($dependencies = null)
    {
        $errors = array();

        if (is_null($dependencies)) $dependencies = array();

        $i = 0;
        $clean = true;
        foreach ($dependencies as $module => $version)
        {
            if ($module == $this->systemName)
            {
                if (!$this->sysVersionDependency($version))
                    $clean = false;

                continue;
            }

            $depModule = ModuleModel::where('module_name', $module)->first();
            if (!$depModule)
            {
                $this->errors->add("module_dependency_$i", "Module $module with version $version not installed");
                $clean = false;
            }
            else
            {
                $depVersion = $depModule->module_version;
                $needVersion = $version;

                $depVersion = new Version($depVersion);
                $needVersion = new Version($needVersion);

                if (!$depVersion->isPartOf($needVersion))
                {
                    $this->errors->add("module_dependency_$i", 'Module '.$module.' v'.$needVersion->getVersion().' must install, but '.$depVersion->getVersion().' installed.');
                    $clean = false;
                }
            }
            $i++;
        }

        if(!$clean)
            return false;

        return true;
    }
786777
protected function orderByDependencies(array $dependencies): array
    {
        $ordered = [];
        $available = array_keys($dependencies);

        while (0 !== \count($dependencies)) {
            $success = $this->doResolve($dependencies, $ordered, $available);

            if (false === $success) {
                throw new UnresolvableDependenciesException(
                    "The dependencies order could not be resolved.\n".print_r($dependencies, true)
                );
            }
        }

        return $ordered;
    }