Generate vendor directory

@param string $sVendor
418
protected function _generateVendorDir($sVendor)
    {
        $sVendorDir = $this->_sModuleDir . $sVendor . DIRECTORY_SEPARATOR;
        if (!file_exists($sVendorDir)) {
            mkdir($sVendorDir);

            // Generate vendor metadata file
            file_put_contents($sVendorDir . 'vendormetadata.php', '<?php');
        }
    }
180568
protected function createDirectory($directory)
    {
        if (!$this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }
12729
protected function get_custom_vendor_folder() {
		$maybe_composer_json = WP_CLI_ROOT . '/../../../composer.json';
		if ( ! is_readable( $maybe_composer_json ) ) {
			return false;
		}

		$composer = json_decode( file_get_contents( $maybe_composer_json ) );

		if ( ! empty( $composer->config )
			&& ! empty( $composer->config->{'vendor-dir'} )
		) {
			return $composer->config->{'vendor-dir'};
		}

		return false;
	}
738450
private function dumpSingleProviderModulesFromVendor(array &$modulesList, $providerDir)
    {
        $directoryIterator = new \DirectoryIterator($providerDir);
        foreach ($directoryIterator as $libDir) {
            if ($libDir->isDot()) {
                continue;
            }
            //creates path to Module.php file
            $moduleSettingsFile = implode(DIRECTORY_SEPARATOR, [
                $providerDir, $libDir, 'module', self::MODULE_SETTINGS_FILE
            ]);

            if (!file_exists($moduleSettingsFile)) {
                continue;
            }

            $baseName = Text::camelize($libDir->getBasename());
            if (!isset($modulesList[$baseName])) {
                $modulesList[$baseName] = [
                    'className' =>  $baseName
                        . '\\'
                        . pathinfo(self::MODULE_SETTINGS_FILE, PATHINFO_FILENAME),
                    'path'  =>  $moduleSettingsFile
                ];
            }
        }
    }
300697
private function findComposerDirectory($vendor, $file = '')
    {
        $composerDirectory = $this->normalizePath($vendor . '/composer/' . $file);

        if ($this->files->exists($composerDirectory)) {
            return $composerDirectory;
        }

        return false;
    }
1260189
public function addVendorInfo($vendor)
    {
        if ($vendor instanceof VendorInfo) {
            $this->vendorInfos[$vendor->getType()] = $vendor;

            return $vendor;
        }

        $vi = new VendorInfo();
        $vi->loadMapping($vendor);

        return $this->addVendorInfo($vi);
    }
660792
public function generate($location)
    {
        if (!empty($location)) {
            @mkdir($location);

            if (substr($location, -1) != '/') {
                $location .= '/';
            }

            file_put_contents($location . 'composer.json', $this->generateJSON());
        } else {
            throw new \Exception('A location must be provided when generating a composer.json file');
        }
    }
367864
public function add_template_directory($directory, $namespace = null) {
		if ($this->filesystem_loader === null) {
			$this->filesystem_loader = new \Twig_Loader_Filesystem($directory);
		}

		if ($namespace === null) {
			$this->filesystem_loader->addPath($directory);
		} else {
			$this->filesystem_loader->addPath($directory, $namespace);
		}
	}
118962
private function createIterator($directory)
    {
        $directoryIterator = new RecursiveDirectoryIterator($directory,
            FilesystemIterator::CURRENT_AS_FILEINFO |
            FilesystemIterator::KEY_AS_PATHNAME |
            FilesystemIterator::SKIP_DOTS
        );

        $filterIterator = new RecursiveIteratorIterator($directoryIterator,
            RecursiveIteratorIterator::LEAVES_ONLY);

        return $filterIterator;
    }
784707
public function getVendorId()
    {
        if ($this->_sVendorId === null) {
            $this->_sVendorId = false;
            if (($vendor = $this->getActVendor())) {
                $this->_sVendorId = $vendor->getId();
            }
        }

        return $this->_sVendorId;
    }
967996
public function generateSitePackage($packageKey, $siteName)
    {
        $this->packageManager->createPackage($packageKey, [
            'type' => 'neos-site',
            "require" => [
                "neos/neos" => "*",
                "neos/nodetypes" => "*"
            ],
            "suggest" => [
                "neos/seo" => "*"
            ]
        ]);

        $this->generateSitesXml($packageKey, $siteName);
        $this->generateSitesRootFusion($packageKey, $siteName);
        $this->generateSitesPageFusion($packageKey, $siteName);
        $this->generateDefaultTemplate($packageKey, $siteName);
        $this->generateNodeTypesConfiguration($packageKey);
        $this->generateAdditionalFolders($packageKey);

        return $this->generatedFiles;
    }
1319279
static public function directory($value, $message = null, $propertyPath = null)
        {
            static::string($value, $message);

            if (!is_dir($value)) {
                $message = $message ?: sprintf(
                    'Path "%s" was expected to be a directory.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_DIRECTORY, $propertyPath);
            }
        }
194474
public function makeDirectory($mode = FileSystemPermission::NORMAL)
    {
        $directoryId = $this->generateId();
        $path = sys_get_temp_dir() . '/' . $directoryId;
        $directory = new TemporaryDirectory($path, $mode);

        return $directory;
    }
1036375
public function generateTo($directory){
        $translations = array();
        
        foreach($this->extensions as $extension){
            $jsFilePath = $this->basePath . '/' . $extension . '/locales/' . $this->langCode . '/messages_po.js';
            if(file_exists($jsFilePath)){
                $translate = json_decode(file_get_contents($jsFilePath),false);
                if($translate != null){
                    $translations = array_merge($translations, (array)$translate);
                }
            }
        }
        //the bundle contains as well some translations
        $content = array(
            'serial' =>  $this->getSerial(),
            'date'   => time(),
            'translations' =>   $translations
        );
        
        if (!empty($this->taoVersion)) {
            $content['version'] = $this->taoVersion;
        }
        
        if(is_dir($directory)){
            if(!is_dir($directory. '/' . $this->langCode)){
                mkdir($directory. '/' . $this->langCode);
            }
            $file = $directory. '/' . $this->langCode . '/messages.json';
            if(@file_put_contents($file, json_encode($content))){
                return $file;
            } 
        }
        return false; 
    }
102460
protected function setVendorDir($baseDir, array $extraConfigs)
    {
        $this->vendorDir = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'];

        if (false !== getenv(static::ENV_PARAMETER_VENDOR_DIR)) {
            $this->vendorDir = getenv(static::ENV_PARAMETER_VENDOR_DIR);
        }

        if ('/' != $this->vendorDir[0]) {
            $this->vendorDir = $baseDir . $this->vendorDir;
        }
    }
685619
public static function vendors($innerPath = '')
    {
        if (defined('BAOBAB_COMPOSER_DIR')) {
            $path = untrailingslashit(BAOBAB_COMPOSER_DIR);
        } else {
            $path = untrailingslashit(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
        }

        if (!empty($innerPath)) {
            $innerPath = untrailingslashit($innerPath);
            $path .= '/' . $innerPath;
        }

        return $path;
    }
642068
private function createFileLocator($modelDir, $mixinDir, $embedDir)
    {
        $definition = new Definition(
            Utility::getLibraryClass('Metadata\Driver\FileLocator'),
            [$modelDir, $mixinDir, $embedDir]
        );
        $definition->setPublic(false);
        return $definition;
    }