function GenerateAutoloadReferenceFile::autoloadFileCommitted

Same name in other branches
  1. 8.9.x composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php \Drupal\Composer\Plugin\Scaffold\GenerateAutoloadReferenceFile::autoloadFileCommitted()
  2. 10 composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php \Drupal\Composer\Plugin\Scaffold\GenerateAutoloadReferenceFile::autoloadFileCommitted()
  3. 11.x composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php \Drupal\Composer\Plugin\Scaffold\GenerateAutoloadReferenceFile::autoloadFileCommitted()

Determines whether or not the autoload file has been committed.

Parameters

\Composer\IO\IOInterface $io: IOInterface to write to.

string $package_name: The name of the package defining the autoload file (the root package).

string $web_root: The path to the web root.

Return value

bool True if autoload.php file exists and has been committed to the repository

1 call to GenerateAutoloadReferenceFile::autoloadFileCommitted()
Handler::scaffold in composer/Plugin/Scaffold/Handler.php
Copies all scaffold files from source to destination.

File

composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php, line 64

Class

GenerateAutoloadReferenceFile
Generates an 'autoload.php' that includes the autoloader created by Composer.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public static function autoloadFileCommitted(IOInterface $io, $package_name, $web_root) {
    $autoload_path = static::autoloadPath($package_name, $web_root);
    $autoload_file = $autoload_path->fullPath();
    $location = dirname($autoload_file);
    if (!file_exists($autoload_file)) {
        return FALSE;
    }
    return Git::checkTracked($io, $autoload_file, $location);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.