Skip to content

Naive phar self update command for 4.0 #5745

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

Closed
wants to merge 3 commits into from
Closed

Conversation

Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Nov 13, 2019

It unconditionally fetches latest codecept.phar from website.
Smarter implementation requires storing phar version (X.Y.Z.DATE) in the phar file
and the latest phar version somewhere on the website.

Please do Squash and Merge if I forget to squash commits myself.

It unconditionally fetches latest codecept.phar from website.
Smarter implementation requires storing phar version (X.Y.Z.DATE) in the phar file
and the latest phar version somewhere on the website
Because it only tested version comparison logic
which has been removed by previous commit
@Naktibalda
Copy link
Member Author

It works like this:

$ php codecept.phar self-update
Codeception version 4.0.0

Updating...

codecept.phar has been updated.

$ php codecept.phar
Codeception 3.1.2

@Naktibalda
Copy link
Member Author

self-update on older versions of PHP fails, because there is no php56/codecept.phar file until Codeception/codeception.github.com#189 is merged

$ php5.6 codecept.phar self-update
Codeception version 4.0.0

Updating...

Request failed.

@SamMousa
Copy link
Collaborator

We could look at something like this:

https://github.com/humbug/phar-updater

@Naktibalda
Copy link
Member Author

Basic SHA-1 strategy looks like a good idea, but it is a shame that phar/updater was abandoned.
It is ironic that to projects given as examples in humbug/phar-updater#53 removed selfupdate commands completely.

@SamMousa
Copy link
Collaborator

What those project recommend is using https://phar.io/
I looked at that when it was still in its infancy and it didn't go very well plugins.

@Naktibalda
Copy link
Member Author

I implemented new SelfUpdate command using phar-updater at #5747
Related change in build script at Codeception/codeception.github.com@b0ca9ec

Now I need to figure out why https://github.com/Codeception/codeception.github.com/blob/master/codecept.version doesn't work as https://codeception.com/codecept.version

@Naktibalda Naktibalda closed this Nov 15, 2019
@Naktibalda Naktibalda deleted the phar-self-update branch December 13, 2019 08:15
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy