Skip to content

Remove pre-update-cmd #3687

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

Merged
merged 1 commit into from
Mar 16, 2016
Merged

Remove pre-update-cmd #3687

merged 1 commit into from
Mar 16, 2016

Conversation

barryvdh
Copy link
Contributor

Can't rely on being able to run php artisan, before updating. See composer/composer#5066

Before, running install without a lock file did an install that was almost an update, but still ran the pre/post-install-cmd scripts. Now we normalized it to actually run an update and fire pre/post-update-cmd, because that's what it is doing. If you have a lock file though it will run install as before.

When installing without lockfile, Composer now behaves as upgrade. It also executes the pre-upgrade-cmd instead of pre-install-cmd. Behaviour with composer.lock available is not changed.

With the latest composer version, doing a fresh install will fail because the vendor files are not yet present.

Can't rely on being able to run php artisan, before updating.
taylorotwell added a commit that referenced this pull request Mar 16, 2016
@taylorotwell taylorotwell merged commit 91c6e71 into laravel:master Mar 16, 2016
@barryvdh barryvdh deleted the patch-1 branch March 16, 2016 17:47
@vlakoff
Copy link
Contributor

vlakoff commented Mar 16, 2016

You should make the change to laravel/laravel 5.1 as well, let's not worsen the support nightmare that is coming.

@Fuxy22
Copy link
Contributor

Fuxy22 commented Mar 17, 2016

Running php artisan clear-complied after update will use the old compiled laravel code which can cause errors when updating.

That is why i changed it in commit c334e47.

@barryvdh
Copy link
Contributor Author

Yes I know, but we can't rely on having a working install before..
Ideally, it would be done with running php artisan at all. So for example:

"php -r \"@unlink('bootstrap/cache/compiled.php');@unlink('bootstrap/cache/services.json');\""

But that would have the downside of not being able to change it.

Or we could check if the autoload exists in the artisan file. If not, assume we're on a fresh install and just skip, without producing an error/stopping composer.

@Fuxy22
Copy link
Contributor

Fuxy22 commented Mar 17, 2016

Your suggestion for the check seems to be the best option.

We can't rely on composer and the location of the files can change for instance I have bootstrap/cache/compiled.php and bootstrap/cache/services.php.

@mcampa
Copy link

mcampa commented Mar 18, 2016

Is this needed for Laravel 4.2?

@GrahamCampbell
Copy link
Member

4.2 is not supported

@mcampa
Copy link

mcampa commented Mar 18, 2016

I just need to know if I need to apply this change to my 4.2 projects

@vlakoff
Copy link
Contributor

vlakoff commented Mar 29, 2016

As people encountering the issue may land on this page, note an improved fix has been implemented since then. See laravel/framework#12827 and #3699.

@omarjebari
Copy link

What about people with old 5.1 projects that they are checking out from source control, ie not installing Laravel from scratch?

@Promixius
Copy link

@omarjebari Well what i've found useful was first running
composer install --no-script
the run a normal composer install after to execute the scripts as a workaround not the best but will have to do for now for me.

@ramseyjiang
Copy link

The latest version which can be installed on command line, it still has the same problem. And "composer install --no-script" does not work on this version. How can I fix it?

@vlakoff
Copy link
Contributor

vlakoff commented Jul 27, 2016

You should apply #3699 to your existing projects.

@ramseyjiang
Copy link

I have viewed that, but I think I cannot fix the problem.

I always use "composer create-project --prefer-dist laravel/laravel blog" to install laravel
but now it does not work.
After install, if success, I run : php artisan -V
it will show "Laravel Framework version 5.2.32"

But now, it just show error. bootstrap/autoload.php on line 17

Please help me.

@ramseyjiang
Copy link

I fixed it

@dalenguyen
Copy link

@ramseyjiang I got the same problem. What did you do with it?

@ito2307
Copy link

ito2307 commented Sep 23, 2016

@ramseyjiang i have the same issue but i downloaded a project in my company and i'm trying to do composer install but display this http://stackoverflow.com/questions/39665219/why-does-composer-install-show-this-error-message what i should do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.