Get the name of the custom vendor folder as set in `composer.json`.

@return string|false Name of the custom vendor folder or false if none.
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;
	}
1298140
public function getComposerJSON()
    {
        if (!$this->composerJsonLoaded && !$this->composerJson) {
            $this->composerJsonLoaded = true;
            $this->composerJson = null;
            $jsonFile = new JsonFile(__DIR__ . '/composer.json');
            if ($jsonFile->exists()) {
                $this->composerJson = $jsonFile->read();
            }
        }

        return $this->composerJson;
    }
362117
public function getDirectoryPath()
    {
        $editionsPath = VENDOR_PATH . static::EDITIONS_DIRECTORY;
        $path = getShopBasePath();
        if ($this->getEditionSelector()->isEnterprise()) {
            $path = $editionsPath  .'/'. static::ENTERPRISE_DIRECTORY;
        } elseif ($this->getEditionSelector()->isProfessional()) {
            $path = $editionsPath .'/'.  static::PROFESSIONAL_DIRECTORY;
        }

        return realpath($path) . DIRECTORY_SEPARATOR;
    }
507557
protected function _getCustomTemplateFilename() {
        $filePath = $this->_formatTemplate(
            Mage::getStoreConfig('turpentine_varnish/servers/custom_vcl_template'),
            array('root_dir' => Mage::getBaseDir())
        );
        if (is_file($filePath)) { return $filePath; } else { return null; }
    }
1260378
public function getVendorPath()
    {
        if (is_null($this->vendorPath)) {
            // We get the current package install path
            $installPath = $this->composer->getInstallationManager()->getInstallPath($this->package);
            // We get the name of the package in order to get its target path
            $targetDir = $this->package->getName();
            // We remove this target path to isolate the vendor path only
            $this->vendorPath = explode($targetDir, $installPath)[0];
        }
        return $this->vendorPath;
    }
958736
public function getTemplateName()
    {
        // assign template name
        if (($templateName = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl')))) {
            $this->_sThisTemplate = 'custom/' . $templateName;
        } elseif (($category = $this->getActiveCategory()) && $category->oxcategories__oxtemplate->value) {
            $this->_sThisTemplate = $category->oxcategories__oxtemplate->value;
        }

        return $this->_sThisTemplate;
    }
888874
private static function getComposerNamespaces()
	{
		static $result = null;
		
		if ( !is_array($result) ) {
			$result = require self::$root . 'vendor/composer/autoload_namespaces.php';
			
			foreach ( $result as $ns => &$paths ) {
				$subpath = trim(str_replace('\\', DIRECTORY_SEPARATOR, $ns), DIRECTORY_SEPARATOR);
				foreach ( $paths as &$path ) {
					$path = rtrim($path, DIRECTORY_SEPARATOR);
					if ( is_dir("$path/$subpath") ) {
						$path = "$path/$subpath";
					}
				}
				unset($path);
			}
			unset($paths);
			
			$psr4 = require self::$root . 'vendor/composer/autoload_psr4.php';
			
			foreach ( $psr4 as $ns => $paths )
			{
				if ( isset($result[$ns]) ) {
					$result[$ns] = array_merge($result[$ns], $paths);
				}
				else {
					$result[$ns] = $paths;
				}
			}
		}
		
		return $result;
	}
348070
public function getComposerInstall()
    {
        if (file_exists('composer.lock')) {
            $json = json_decode(file_get_contents('composer.lock'));
            foreach ($json->packages as $package) {
                if ($package->name === 'gestionlan/framework') {
                    return $package;
                }
            }
        }

        return false;
    }
971476
public function getConfigFilename() {
		if(!$this->Project()->exists()) {
			return '';
		}
		if(!$this->Filename) {
			return '';
		}
		return $this->DNData()->getEnvironmentDir().'/'.$this->Project()->Name.'/'.$this->Filename;
	}
314408
protected function getAppNamespace()
    {
        $composer = json_decode(file_get_contents(base_path().'/composer.json'), true);

        foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
            foreach ((array) $path as $pathChoice) {
                if (realpath(app_path()) == realpath(base_path().'/'.$pathChoice)) {
                    return $namespace;
                }
            }
        }

        throw new \RuntimeException('Unable to detect application namespace.');
    }
1150762
private function getNamespace($composerJson)
    {
        if (!file_exists($composerJson)) {
            throw new InvalidArgumentException('"' . $composerJson . '" not found.'); // @codeCoverageIgnore
        }
        $composer = json_decode(file_get_contents($composerJson), true);
        $autoload = isset($composer['autoload']['psr-4']) ? array_flip($composer['autoload']['psr-4']) : [];
        if (!isset($autoload['src/'])) {
            throw new InvalidArgumentException('psr-4 autoload directive for folder "src/" is missing in ' . $composerJson . '.');
        }

        return $autoload['src/'];
    }
861220
private static function getInstalledComposerJson()
    {
        $finder = new Finder();
        $finder->files()
            ->name('composer.json')
            ->notPath('vendor/composer')
            ->depth(2)
            ->followLinks()
        ;
        try {
            $finder->in(['vendor']);
        } catch (\InvalidArgumentException $e) {
            // Composer has not had its autoloader dumped
        }

        return $finder;
    }
1145866
function get_custom_fields_name () {
    $path = MF_PATH.'/field_types/*';
    $folders = glob($path,GLOB_ONLYDIR);

    $fields = array();

    foreach($folders as $folder) {
      $name = preg_match('/\/([\w\_]+)\_field$/i',$folder,$name_match);
      $fields[$name_match[1]] = preg_replace('/_/',' ',$name_match[1]);
    }

    return $fields;
  }
681466
public function composerFile(): string
    {
        if (!isset($this->cache[self::COMPOSER_FILE])) {
            $this->cache[self::COMPOSER_FILE] = $this->rootDir() . DIRECTORY_SEPARATOR . 'composer.json';
        }

        return $this->cache[self::COMPOSER_FILE];
    }
146677
private function getNamespacedPackageName()
    {
        $path = $this->getTemplateArgumentPath();
        $templateName = json_decode(file_get_contents($path . 'composer.json'))->name;
        $parts = explode('/', $templateName);
        return package_vendor_namespace($parts[0], $parts[1]) . '\Package';
    }
752161
public function findPackageByName($vendor, $packageName = '')
    {
        if ($packageName === '') {
            if (strpos($vendor, '/') === false) {
                throw new Exception('Invalid package name');
            }
            list($vendor, $packageName) = explode('/', $vendor);
        }

        return $this->makeRequest("/packages/{$vendor}/{$packageName}.json");
    }
1366546
public function getGetterName()
    {
        return $this->replaceReservedMethod(sprintf('get%s', ucfirst($this->getUniqueName('get'))), $this->getOwner()->getPackagedName());
    }