You are here

protected static function GenerateAutoloadReferenceFile::autoloadPath in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php \Drupal\Composer\Plugin\Scaffold\GenerateAutoloadReferenceFile::autoloadPath()

Generates a scaffold file path object for the autoload file.

Parameters

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

\Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath Object wrapping the relative and absolute path to the destination file.

2 calls to GenerateAutoloadReferenceFile::autoloadPath()
GenerateAutoloadReferenceFile::autoloadFileCommitted in composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php
Determines whether or not the autoload file has been committed.
GenerateAutoloadReferenceFile::generateAutoload in composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php
Generates the autoload file at the specified location.

File

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

Class

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

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected static function autoloadPath($package_name, $web_root) {
  $rel_path = 'autoload.php';
  $dest_rel_path = '[web-root]/' . $rel_path;
  $dest_full_path = $web_root . '/' . $rel_path;
  return new ScaffoldFilePath('autoload', $package_name, $dest_rel_path, $dest_full_path);
}