mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 12:29:43 +01:00
Use the autoloader from where Rector was installed, not started (#5772)
* Use the autoloader from where Rector was installed, not started * Remove autoloader already covered in AutoloadIncluder::includeDependencyOrRepositoryVendorAutoloadIfExists() * Fix path to project autoloader When Rector is installed as a project dependency through composer, this script it will be in {vendor}/rector/rectory/bin/rector.php, so ../../.. is where autoload.php lives.
This commit is contained in:
parent
ab8a1e517d
commit
a2e36d5a04
@ -27,7 +27,6 @@ $autoloadIncluder = new AutoloadIncluder();
|
||||
$autoloadIncluder->includeDependencyOrRepositoryVendorAutoloadIfExists();
|
||||
|
||||
$autoloadIncluder->loadIfExistsAndNotLoadedYet(__DIR__ . '/../vendor/scoper-autoload.php');
|
||||
$autoloadIncluder->loadIfExistsAndNotLoadedYet(getcwd() . '/vendor/autoload.php');
|
||||
|
||||
$autoloadIncluder->autoloadProjectAutoloaderFile();
|
||||
$autoloadIncluder->autoloadFromCommandLine();
|
||||
@ -79,7 +78,7 @@ final class AutoloadIncluder
|
||||
*/
|
||||
public function autoloadProjectAutoloaderFile(): void
|
||||
{
|
||||
$this->loadIfExistsAndNotLoadedYet(__DIR__ . '/../../autoload.php');
|
||||
$this->loadIfExistsAndNotLoadedYet(__DIR__ . '/../../../autoload.php');
|
||||
}
|
||||
|
||||
public function autoloadFromCommandLine(): void
|
||||
|
Loading…
x
Reference in New Issue
Block a user