Central icon indicating copy to clipboard operation
Central copied to clipboard

Drop PHP 5.x

Open Hywan opened this issue 8 years ago • 15 comments

See https://github.com/hoaproject/Central/issues/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

Hywan avatar Aug 21 '17 08:08 Hywan

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

Pierozi avatar Nov 07 '17 09:11 Pierozi

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.

Hywan avatar Nov 07 '17 09:11 Hywan

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 :biking_man:

Pierozi avatar Nov 12 '17 10:11 Pierozi

We've decided to merge the php7 branch on master to smooth the transitions and setting up the new CI.

Hywan avatar Jan 22 '18 10:01 Hywan

Tests are still broken because we use dev-master without any aliases. I propose to continue the migration process by running test locally, and then doing another pass to fix the CI.

Hywan avatar Jan 23 '18 09:01 Hywan

nice.

Grummfy avatar Jan 23 '18 12:01 Grummfy

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 ?

shulard avatar Feb 05 '18 18:02 shulard

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.

Hywan avatar Jun 13 '18 09:06 Hywan

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.

Pierozi avatar Aug 22 '18 08:08 Pierozi

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.

Majkl578 avatar Dec 18 '18 01:12 Majkl578

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

vonglasow avatar Dec 20 '18 13:12 vonglasow

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

Hywan avatar Dec 22 '18 11:12 Hywan

@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.

Majkl578 avatar Dec 22 '18 11:12 Majkl578

@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 :-).

Hywan avatar Dec 22 '18 16:12 Hywan

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.)

sanmai avatar Sep 13 '19 04:09 sanmai