Add required dependencies.

@param \Phar $phar
494559
private function addDependencies($phar)
    {
        /* add teleport if this is a project using it as a library */
        if (file_exists($this->path . '/vendor/modxcms/teleport/src/Teleport/Teleport.php')) {
            $teleport = new Finder();
            $teleport->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->notName('Compiler.php')->notName('Composer.php')->in($this->path . '/vendor/modxcms/teleport/src');
            foreach ($teleport as $file) {
                $this->addFile($phar, $file);
            }
        }

        /* add symfony/filesystem */
        $filesystem = new Finder();
        $filesystem->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/symfony/filesystem');
        foreach ($filesystem as $file) {
            $this->addFile($phar, $file);
        }

        /* add symfony/finder */
        $finder = new Finder();
        $finder->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/symfony/finder');
        foreach ($finder as $file) {
            $this->addFile($phar, $file);
        }

        /* add react libs */
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/child-process');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/event-loop');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/http');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }
        $psr7 = new Finder();
        $psr7->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/guzzlehttp/psr7/src');
        foreach ($psr7 as $file) {
            $this->addFile($phar, $file);
        }
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/promise/src');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/socket/src');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }
        $react = new Finder();
        $react->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/react/stream/src');
        foreach ($react as $file) {
            $this->addFile($phar, $file);
        }

        $evenement = new Finder();
        $evenement->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.php')->in($this->path . '/vendor/evenement/evenement/src');
        foreach ($evenement as $file) {
            $this->addFile($phar, $file);
        }
    }
484296
public function addDependency($type, $path)
	{
		if (null === $this->dependencies)
			$this->dependencies = array();
		if (!isset($this->dependencies[$type]))
			$this->dependencies[$type] = array();
		
		if (!isset($this->dependencies[$type][$path]))
			//in order to not register the first file
			$this->dependencies[$type][$path] = true;
	}
277467
protected function addModulesDependencies(array $modules = [])
    {
        if (empty($modules)) {
            return [];
        }

        // Thelia is always a dependency
        if (!\in_array('Thelia', $modules)) {
            $modules[] = 'Thelia';
        }

        foreach ($modules as $module) {
            // Thelia is not a real module, do not try to get its dependencies
            if ($module === 'Thelia') {
                continue;
            }

            $moduleValidator = new ModuleValidator("{$this->theliaModuleDir}/{$module}");
            $dependencies = $moduleValidator->getCurrentModuleDependencies(true);
            foreach ($dependencies as $dependency) {
                if (!\in_array($dependency['code'], $modules)) {
                    $modules[] = $dependency['code'];
                }
            }
        }

        return $modules;
    }
195262
def add_dependency(self,my_dep):
        
        if self.dependency_layer is None:
            self.dependency_layer = Cdependencies()
            self.root.append(self.dependency_layer.get_node())
        self.dependency_layer.add_dependency(my_dep)
767884
protected function addFile($phar, $file, $strip = true)
    {
        $path = strtr(str_replace($this->projectPath, '', $file->getRealPath()), '\\', '/');
        $content = file_get_contents($file);

        $this->logger->log('<comment>Adding file</comment> ' . $path);

        switch (true) {
            case ('LICENSE' === basename($file)):
                $content = "\n" . $content . "\n";
                break;

            case preg_match('#/In2pire/Cli/Configuration/PhpConfiguration.php$#', $path):
                if ($this->flag & STATIC::FLAG_CACHE) {
                    $configuration = $this->getAllConfiguration();
                    $content = str_replace('// [CONFIGURATION]', '$this->configuration = ' . var_export($configuration, 1) . ';', $content);
                    $content = str_replace(['@version', '@build'], [$this->buildVersion, $this->buildDate], $content);
                }
                break;

            case (pathinfo($file, PATHINFO_EXTENSION) == 'yml'):
                $content = str_replace(['@version', '@build'], [$this->buildVersion, $this->buildDate], $content);
                break;

            case $strip:
                $content = $this->stripWhitespace($content);
                break;
        }

        $phar->addFromString($path, $content);
        $this->increaseFileCounter();
    }
916878
protected function addBinFile(Phar $phar)
    {
        $fileBin = $this->files->combine($this->pathBase, $this->fileNameBin);
        if (! $this->files->exists($fileBin)) {
            return;
        }

        $this->fireEvent('BIN: file main');

        $content = $this->files->get($fileBin);
        $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content);
        $phar->addFromString('artisan', $content);
    }
339530
protected function addBinFile($phar, $binFile)
    {
        $relativeBinFile = str_replace($this->projectPath, '', $binFile);
        $this->logger->log('<comment>Adding file</comment> ' . $relativeBinFile);

        $content = file_get_contents($binFile);
        $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content);

        $phar->addFromString($relativeBinFile, $content);
        $this->increaseFileCounter();
    }
378256
public function mergeDependencies($dependency = [])
    {
        $this->dependencies = array_merge((array) $dependency, (array) $this->getDependencies());
        $this->dependencies = Conversion::arrayObject($this->dependencies);
    }
1070423
protected function addUpdateFile(Phar $phar)
    {
        $file = $this->files->combine($this->pathBase, 'update.json');
        if ($this->files->exists($file)) {
            $this->addFile($phar, new SplFileInfo($file), false);
        }
    }
617207
private function addComposerVendorFiles(Phar $phar)
    {
        $vendorPath = __DIR__.'/../../vendor/';

        $this
            ->addFile($phar, new \SplFileInfo($vendorPath.'autoload.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_namespaces.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_psr4.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_classmap.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_real.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_static.php'))
            ->addFile($phar, new \SplFileInfo($vendorPath.'composer/ClassLoader.php'));

        return $this;
    }
585529
public function addConstraints()
    {
        if (static::$constraints) {
            parent::addConstraints();

            $this->query->where($this->morphType, $this->morphClass);
        }
    }
805352
public function compile($pharFile = 'bowerphp.phar')
    {
        if (file_exists($pharFile)) {
            unlink($pharFile);
        }

        $phar = new \Phar($pharFile, 0, 'bowerphp.phar');
        $phar->setSignatureAlgorithm(\Phar::SHA1);

        $phar->startBuffering();

        $finder = new Finder();
        $finder->files()
            ->ignoreVCS(true)
            ->name('*.php')
            ->notName('Compiler.php')
            ->notName('ClassLoader.php')
            ->in(__DIR__ . '/..')
        ;

        foreach ($finder as $file) {
            $this->addFile($phar, $file);
        }

        $finder = new Finder();
        $finder->files()
            ->ignoreVCS(true)
            ->name('*.php')
            ->name('*.pem')
            ->name('*.pem.md5')
            ->exclude('Tests')
            ->in(__DIR__ . '/../../vendor/symfony/')
            ->in(__DIR__ . '/../../vendor/guzzle/guzzle/src/')
            ->in(__DIR__ . '/../../vendor/ircmaxell/password-compat/lib/')
            ->in(__DIR__ . '/../../vendor/paragonie/random_compat/lib/')
            ->in(__DIR__ . '/../../vendor/knplabs/github-api/lib/')
            ->in(__DIR__ . '/../../vendor/samsonasik/package-versions/src/PackageVersions/')
            ->in(__DIR__ . '/../../vendor/vierbergenlars/php-semver/src/vierbergenlars/LibJs/')
            ->in(__DIR__ . '/../../vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/')
            ->in(__DIR__ . '/../../vendor/hamcrest/hamcrest-php/hamcrest/')
        ;

        foreach ($finder as $file) {
            $this->addFile($phar, $file);
        }

        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/autoload.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_psr4.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_files.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_namespaces.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_classmap.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_real.php'));
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/autoload_static.php'));
        if (file_exists(__DIR__ . '/../../vendor/composer/include_paths.php')) {
            $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/include_paths.php'));
        }
        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/composer/ClassLoader.php'));
        $this->addBin($phar);

        // Stubs
        $phar->setStub($this->getStub());

        $phar->stopBuffering();

        if ($this->gz) {
            $phar->compressFiles(\Phar::GZ);
        }

        $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../LICENSE'), false);

        unset($phar);
        chmod('bowerphp.phar', 0700);
    }
596911
public function installDependencies(InstallerInterface $installer)
    {
        $decode = $this->config->getBowerFileContent();
        if (!empty($decode['dependencies'])) {
            foreach ($decode['dependencies'] as $name => $requiredVersion) {
                if (false !== strpos($requiredVersion, 'github')) {
                    list($name, $requiredVersion) = explode('#', $requiredVersion);
                }
                $package = new Package($name, $requiredVersion);
                $this->installPackage($package, $installer, true);
            }
        }
    }
1005279
protected function init_dependencies() {
		array_walk( $this->handlers,
			function ( $handler, $dependency_type ) {
				if ( $this->hasConfigKey( $dependency_type ) ) {
					$this->dependencies[ $dependency_type ] = $this->init_dependency_type( $dependency_type );
				}
			} );
	}
1332602
public function phar($dest = null)
    {
        $this->taskComposerInstall()
            ->printed(false)
            ->noDev()
            ->run();

        if (!$dest) {
            $dest = __DIR__ . '/../peridot-php.github.io';
        }
        $src = __DIR__ . '/peridot.phar';
        $this->taskCleanDir([$dest . '/downloads'])->run();
        if (file_exists($src)) {
            unlink($src);
        }
        $this->taskExec('box build')->run();
        $destPhar = $dest . '/downloads/peridot.phar';
        $this->say("copying phar to $destPhar");
        rename($src, $destPhar);
    }
101911
public function addPublicDependency($value)
    {
        if ($this->public_dependency === null) {
            $this->public_dependency = new \Protobuf\ScalarCollection();
        }

        $this->public_dependency->add($value);
    }
642364
protected void addDependencies(Archive<?> archive) {
        String version = getConfiguration().getCitrusVersion();
        CitrusArchiveBuilder archiveBuilder;

        if (version != null) {
            archiveBuilder = CitrusArchiveBuilder.version(version);
        } else {
            archiveBuilder = CitrusArchiveBuilder.latestVersion();
        }

        if (archive instanceof EnterpriseArchive) {
            EnterpriseArchive ear = (EnterpriseArchive) archive;
            ear.addAsModules(archiveBuilder.all().build());
        } else if (archive instanceof WebArchive) {
            WebArchive war = (WebArchive) archive;
            war.addAsLibraries(archiveBuilder.all().build());
        }
    }