Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Compatibility issues with php 7.3? #447

Closed
galvao opened this issue Sep 13, 2019 · 13 comments
Closed

Compatibility issues with php 7.3? #447

galvao opened this issue Sep 13, 2019 · 13 comments

Comments

@galvao
Copy link

galvao commented Sep 13, 2019

The MVC skeleton-application is generating the following warning and notices after installation:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/test_app/vendor/zendframework/zend-stdlib/src/ArrayObject.php on line 428

Notice: compact(): Undefined variable: extras in /var/www/html/test_app/vendor/zendframework/zend-view/src/Helper/HeadLink.php on line 404

Notice: compact(): Undefined variable: extras in /var/www/html/test_app/vendor/zendframework/zend-view/src/Helper/HeadLink.php on line 404

Notice: compact(): Undefined variable: extras in /var/www/html/test_app/vendor/zendframework/zend-view/src/Helper/HeadLink.php on line 404

Happens both with and without -s dev.

Not sure if it's related, but I saw a tweet from the devel account about the release of zend-component-installer 2.1.2, which supports php 7.3, while the skeleton-applicaton installs the version 0.7.0 of the same component.

I even tried clearing composer's cache and running it again. Same results.

@geerteltink
Copy link
Member

what command did you use to create the project?

@galvao
Copy link
Author

galvao commented Sep 13, 2019

@xtreamwayz composer create-project -s dev zendframework/skeleton-application /var/www/html/test_app

@geerteltink
Copy link
Member

Running php 7.3 here and I did not have any warnings while running composer create-project zendframework/skeleton-application. However I can confirm that version 0.7 of zend-component-installer is installed. Changing the dependency constrain to "zendframework/zend-component-installer": "^2.0 || ^1.0", and running composer update installed 2.1.2 for me.

@geerteltink
Copy link
Member

I guess you mean you have the warning and notices while running a local server.

@galvao
Copy link
Author

galvao commented Sep 13, 2019

@xtreamwayz Never happened before to me either. Interestingly enough, updating zend-component-installer caused a cascade of updates (a LOT of patches) AND fixed the issue.

And yes, I'm running a local server, which I was before (re: never happened).

Anyway: updating after correcting the zend-component-installer dependency fixed the issue.

Ah, thank you btw =)

@geerteltink
Copy link
Member

The zend-component-installer is running during a composer installation and update and not when running a server, hence my confusion. I'm guessing something else is/was causing the notices and warning.

@geerteltink
Copy link
Member

But running composer update you were updating all packages which fixed your issue. The only thing I can think of is that the 0.7 | 1.0 constrain is preventing some crucial updated packages from being installed.

@galvao
Copy link
Author

galvao commented Sep 13, 2019

Yes, some previous version of one of the components is the culprit: in one of the more extreme cases (zend-view, interestingly enough) it jumped from 2.8.1 to 2.11.2.

@galvao
Copy link
Author

galvao commented Sep 13, 2019

Full update:

  - Updating zendframework/zend-component-installer (0.7.0 => 2.1.2): Downloading (100%)         
  - Updating zfcampus/zf-development-mode (3.1.0 => 3.2.0): Downloading (100%)           - Updating zendframework/zend-stdlib (3.1.0 => 3.2.1): Downloading (100%)         
  - Updating zendframework/zend-servicemanager (3.3.0 => 3.4.0): Downloading (100%)           - Updating zendframework/zend-eventmanager (3.1.0 => 3.2.1): Downloading (100%)         
  - Installing psr/simple-cache (1.0.1): Downloading (100%)           - Installing psr/cache (1.0.1): Downloading (100%)         
  - Updating zendframework/zend-cache (2.7.2 => 2.9.0): Downloading (100%)           - Updating zendframework/zend-hydrator (2.4.1 => 3.0.2): Downloading (100%)         
  - Updating zendframework/zend-config (2.6.0 => 3.3.0): Downloading (100%)         
  - Updating zendframework/zend-modulemanager (2.7.2 => 2.8.2): Downloading (100%)           - Updating zendframework/zend-validator (2.8.2 => 2.12.0): Downloading (100%)           - Updating zendframework/zend-escaper (2.5.2 => 2.6.1): Downloading (100%)         
  - Updating zendframework/zend-uri (2.5.2 => 2.7.0): Downloading (100%)           - Updating zendframework/zend-loader (2.5.1 => 2.6.1): Downloading (100%)         
  - Updating zendframework/zend-http (2.6.0 => 2.10.0): Downloading (100%)           - Updating zendframework/zend-router (3.0.2 => 3.3.0): Downloading (100%)           - Updating zendframework/zend-view (2.8.1 => 2.11.2): Downloading (100%)           - Updating zendframework/zend-mvc (3.0.4 => 3.1.1): Downloading (100%)         
  - Updating zendframework/zend-filter (2.7.2 => 2.9.2): Downloading (100%)         
  - Updating zendframework/zend-inputfilter (2.7.6 => 2.10.1): Downloading (100%)         
  - Updating zendframework/zend-form (2.10.2 => 2.14.1): Downloading (100%)         
  - Updating zendframework/zend-mvc-plugin-fileprg (1.0.0 => 1.1.0): Downloading (100%)         
  - Updating zendframework/zend-mvc-plugin-flashmessenger (1.0.0 => 1.1.0): Downloading (100%)         
  - Updating zendframework/zend-authentication (2.6.0 => 2.7.0): Downloading (100%)

@galvao
Copy link
Author

galvao commented Sep 13, 2019

One additional information: I applied the same fix in an older project (which didn't had the problem) and only zend-component-installer was updated, since it was already at version 1.1.1.

And now I know exactly what's happening:

On new projects - created with coposer create-project - the 0.7.0 version is installed. Once you run composer update it updates zend-component-installer to 1.1.1 and cascades the other updates.

@geerteltink
Copy link
Member

geerteltink commented Sep 13, 2019

Running composer update doesn't make sense in your case. neither zend-view or zend-component-installer is updated.

Running the update command on a new install gets me this:

  - Updating zendframework/zend-component-installer (0.7.0 => 1.1.1): Loading from cache
  - Installing zendframework/zend-json (3.1.1): Loading from cache
  - Updating zendframework/zend-stdlib (3.1.0 => 3.2.1): Loading from cache
  - Updating zendframework/zend-loader (2.5.1 => 2.6.1): Loading from cache
  - Updating zendframework/zend-eventmanager (3.1.0 => 3.2.1): Loading from cache
  - Updating zendframework/zend-view (2.8.1 => 2.11.2): Loading from cache
  - Updating zendframework/zend-servicemanager (3.3.0 => 3.4.0): Loading from cache
  - Updating zendframework/zend-validator (2.8.2 => 2.12.0): Loading from cache
  - Updating zendframework/zend-escaper (2.5.2 => 2.6.1): Loading from cache
  - Updating zendframework/zend-uri (2.5.2 => 2.7.0): Loading from cache
  - Updating zendframework/zend-http (2.6.0 => 2.10.0): Loading from cache
  - Updating zendframework/zend-router (3.0.2 => 3.3.0): Loading from cache
  - Updating zendframework/zend-config (2.6.0 => 3.3.0): Loading from cache
  - Updating zendframework/zend-modulemanager (2.7.2 => 2.8.2): Loading from cache
  - Updating zendframework/zend-mvc (3.0.4 => 3.1.1): Loading from cache
  - Updating zfcampus/zf-development-mode (3.1.0 => 3.2.0): Loading from cache

But it is weird. The skeleton installer should install the latest versions, respecting the constraints. Running composer update shouldn't be necessary. At least that's how zend-expressive-installer works.

@galvao
Copy link
Author

galvao commented Sep 13, 2019

Yes, my point exactly; The older project is one I update regularly, hence the issue never happening.

@weierophinney
Copy link
Member

This should be resolved with the 3.1.0 version of the skeleton.

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

No branches or pull requests

3 participants