Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DrupalFinderComposerRuntime.php

function DrupalFinderComposerRuntime::getComposerRoot

Get the path to the Composer root directory.

File

vendor/webflo/drupal-finder/src/DrupalFinderComposerRuntime.php, line 27

Class

DrupalFinderComposerRuntime

Namespace

DrupalFinder

Code

public function getComposerRoot() : ?string {
    foreach (InstalledVersions::getAllRawData() as $data) {
        if (isset($data['versions']['drupal/core'])) {
            return realpath($data['root']['install_path']);
        }
    }
    $root = InstalledVersions::getRootPackage();
    return realpath($root['install_path']);
}
RSS feed
Powered by Drupal