-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Fixes function loading conflicts when using @include('vendor/autoload.php')
via Laravel Envoy
#52974
[11.x] Fixes function loading conflicts when using @include('vendor/autoload.php')
via Laravel Envoy
#52974
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow missed the functions are namespaced. This needs to be included in the function_exists
check.
The tests are finally passed |
@s-damian Can you provide a reproducing step for this? I tested with having |
Install Composer :curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer Install Laravel Envoy :cd ~
composer global require laravel/envoy
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc Use Laravel Envoy :cd /path-to-your-laravel-project envoy run deploy_to_remote_server
|
The latest version
And: Laravel Envoy 2.9.0 |
Still unable to replicate the issue. @servers(['localhost' => '127.0.0.1'])
@task('inspire')
php artisan inspire
echo 'Run `inspire` command'
@endtask <?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use function Illuminate\Support\defer;
Artisan::command('inspire', function () {
defer(fn () => ray(Inspiring::quote()));
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly(); |
I believe this is caused by requiring the app's autoloader as described in https://laravel.com/docs/11.x/envoy#setup @servers(['localhost' => '127.0.0.1'])
@include('vendor/autoload.php')
@task('inspire')
php artisan inspire
echo 'Run `inspire` command'
@endtask |
I have already this:
|
With
we have fatal error |
And without PHP Fatal error: Uncaught Error: Class "Dotenv\Dotenv"
|
@include('vendor/autoload.php')
via Laravel Envoy
With Laravel envoy we have this error:
We need to add
function_exists
to avoid these errors.Thanks.