Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Drop PHP 5.x #75

Open
Hywan opened this issue Aug 21, 2017 · 15 comments
Open

Drop PHP 5.x #75

Hywan opened this issue Aug 21, 2017 · 15 comments

Comments

@Hywan
Copy link
Member

Hywan commented Aug 21, 2017

See #74 for more information.

Progression

Library PR Tests are green Merged
Acl
Bench
Cli
Compiler
Consistency
Console
Database
Devtools
Dispatcher
Dns
Event
Eventsource
Exception
Fastcgi
File
Graph
Heap
Http
Irc
Iterator
Json
Locale
Mail
Math
Mime
Option
Praspel
Promise
Protocol
Realdom
Regex
Registry
Router
Ruler
Session
Socket
Stream
Stringbuffer
Test
Ustring
View
Visitor
Websocket
Worker
Xml
Xyl
Zformat
Zombie
@Pierozi
Copy link
Member

Pierozi commented Nov 7, 2017

@Hywan Can I help there? Which repository should I focus?

@Hywan
Copy link
Member Author

Hywan commented Nov 7, 2017

That's a good question.

Right now, it is very hard unfortunately… Let me explain why.

Assuming we would like to update hoa/console, we have to test it right? But our test infrastructure depends on Hoa, and it is a mistake at some point… So to test hoa/console, we need to update hoa/test, and to update hoa/test, we need to update hoa/cli, hoa/stream, hoa/file, hoa/ustring etc.

So far, I'm focusing on moving hoa/test and its dependencies to PHP 7.1+.

Why is it hard? Because I have to “hack” composer to not rely on remote Git repositories but on local ones, so that I can iterate more easily (I don't have to push and pull everytime I have a type issue for instance). So I'm afraid it's a lonely wolf job for few weeks :-(. Except if you replicate my weird hack setup locally.

Once it's done, we will be able to update libraries more easily.

Hint: I use https://github.com/nikic/TypeUtil/ to add types, and I use hoa/devtools to fix everything else. I've to go manually over all the code though to remove PHPDoc, and check the results.

@Pierozi
Copy link
Member

Pierozi commented Nov 12, 2017

I can see you rock on this.
You right it's hard, I'm trying to complain Hoa\Heap with php7 / kitab and even this tiny library
causing me issue.

Good luck 🚴‍♂️

@shulard
Copy link
Contributor

shulard commented Feb 5, 2018

Hello @Hywan,

I've started to work on some migration PRs but I got an error about the atoum/praspel-extension when I try to install dev-master dependencies.

Problem 1
    - atoum/praspel-extension 0.17.02.24 requires hoa/consistency ~1.0 -> satisfiable by hoa/consistency[1.16.01.11, 1.16.01.14, 1.16.03.03, 1.17.01.10, 1.17.05.02] but these conflict with your requirements or minimum-stability.
    - atoum/praspel-extension 0.17.02.24 requires hoa/consistency ~1.0 -> satisfiable by hoa/consistency[1.16.01.11, 1.16.01.14, 1.16.03.03, 1.17.01.10, 1.17.05.02] but these conflict with your requirements or minimum-stability.
    - hoa/test dev-master requires atoum/praspel-extension ~0.17 -> satisfiable by atoum/praspel-extension[0.17.02.24].
    - Installation request for hoa/test dev-master -> satisfiable by hoa/test[dev-master].

It seems that you run your tests locally, how are you bypassing that error ? Are you using a custom version for that extension ? If so maybe it can be useful to add these extension in the migration process ?

@Hywan
Copy link
Member Author

Hywan commented Jun 13, 2018

Guide to migrate to PHP 7.1

1. Require PHP 7.1

Update composer.json to require PHP 7.1:

-         "php"            : ">=5.5.0",
+         "php"            : ">=7.1",

2. Move sources to the new Source/ directory

  1. Create a Source/ directory,
  2. Move all source code to this directory (only source code, so it excludes documentation, bin, tests, and hidden files or README.md & co),
  3. Be sure to update hoa://Library paths, e.g.:
- hoa://Library/Console/Terminfo
+ hoa://Library/Console/Source/Terminfo
  1. Update the autoloader in composer.json, e.g.:
   "autoload": {
       "psr-4": {
-          "Hoa\\Console\\": "."
+          "Hoa\\Console\\"      : "Source",
+          "Hoa\\Console\\Bin\\" : "Bin",
+          "Hoa\\Console\\Test\\": "Test"

3. Update code to PHP 7.1

Pre-requisite: Install TypeUtil.

  1. Run composer install,
  2. Run hoa devtools:cs,
  3. Run …/type-util.php add --php71 Source/,
  4. Remove the PHPDoc (but keep documentation, so remove only the @* tags),
  5. Try to run test with vendor/bin/hoa test:run, have fun.

4. Put all dependencies to dev-master

Update composer.json and change all dependencies to dev-master. Maybe we should update minimum-stability too, not sure.

@Pierozi
Copy link
Member

Pierozi commented Aug 22, 2018

Hello @Hywan

If we want to run the test and therefore composer install (locally and on travis) we must set minimum-stability: dev the only issue is related to dependency.

I'm kind of struggle due to Kitab (dependency of hoa/test)
We must update master branch of kitab to use dev-master on all hoa/*

My case with a fix on hoa\socket, require hoa/test that include kitab but have conflict with hoa/exception.

@Majkl578
Copy link

Majkl578 commented Dec 18, 2018

Hi, any update here? It really becomes a blocker for Doctrine and AFAIR it is already an issue e.g. for JMS Serializer (cc @goetas). Thanks.

@vonglasow
Copy link
Member

vonglasow commented Dec 20, 2018

Some external impediments have slow down the progress, but we are still on it. We are focus on the lib which are the most directly related to your concern.

/cc @Hywan @Majkl578 @goetas

@Hywan
Copy link
Member Author

Hywan commented Dec 22, 2018

@Majkl578 My personal deadline is to finish everything before Mars. Would it work?

@Majkl578
Copy link

@Hywan Assuming you meant March (not Mars - external dependency on SpaceX may be a bit, well, unstable :P), that's fine, thanks! Let me know if I can help.

@Hywan
Copy link
Member Author

Hywan commented Dec 22, 2018

@Majkl578 Haha, yeah, hum hum, indeed! I re-scheduled my life a little bit to boost Hoa. The refactoring for PHP 7.x might come earlier. My personal target is mid-February, but let's keep March the official deadline.

Let me know if I can help.

Being patient already means a lot to us :-).

@sanmai
Copy link

sanmai commented Sep 13, 2019

Is there a way to help?

(So far switching to depend on dev-master shown being problematic. I can't even suggest people use a dev version because it may not install at all because of dependencies. It appears to me much better solution would be a beta version release for each related package.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

7 participants