laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.33k stars 130 forks source link

Add support for laravel/framework < v5.4.17 #48

Closed StanAngeloff closed 6 years ago

StanAngeloff commented 6 years ago

After the update to ServiceProviders, the basePath() function in Illuminate\Foundation\Application was extended to support an additional parameter $path. This was not documented nor updated in the contract. When attempting to use laravel/tinker on a laravel/framework installation prior to v5.4.17, the following exception is thrown:

[Symfony\Component\Debug\Exception\FatalErrorException]
Laravel\Tinker\ClassAliasAutoloader::__construct(): Failed opening required '/data/projects/project' (include_path='.:/usr/share/php')

This commit relies on the base_path function which supports the $path argument and is available on all versions (and is not deprecated as of 5.6.

GrahamCampbell commented 6 years ago

This breaks using tinker outside of Lumen or Laravel though?

StanAngeloff commented 6 years ago

Whoops, I'll send a revised pull tomorrow. Should be trivial to call basePath() without arguments and do the append in the command instead.