Skip to content
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

[NFR]: Support of PHP-PSR 1.1.0 #15504

Closed
StudioMaX opened this issue May 26, 2021 · 6 comments · Fixed by #15506
Closed

[NFR]: Support of PHP-PSR 1.1.0 #15504

StudioMaX opened this issue May 26, 2021 · 6 comments · Fixed by #15506
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release new feature request Planned Feature or New Feature Request

Comments

@StudioMaX
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Docs says that we are required to use php-psr 1.0.*.

NOTE: You will need the PSR 1.0 extension installed.

But this is a problem if other frameworks are used at the same time like Symfony, which in new versions requires psr/container ^1.1. The PHP-PSR 1.0.x specifies version 1.0.0 for psr/container. Because of this, we are in an incomprehensible situation when a project requires psr/container ^1.1 in the composer.json, successfully installs it, and in fact, psr/container from PHP-PSR extension is used, since it has priority over the composer's library.

Describe the solution you'd like
Allow to install PHP-PSR extension 1.1.0

Additional context
According to the PHP-PSR changelog, the difference between version 1.0.1 and version 1.1.0 is only in fixing support for psr/container to version 1.1.1.

Also I have installed the PSR extension 1.1.0 locally and don't see any problems with my project. Maybe this only needs to be fixed in the documentation?

@StudioMaX StudioMaX added the new feature request Planned Feature or New Feature Request label May 26, 2021
@Jeckerson Jeckerson added the 5.0 The issues we want to solve in the 5.0 release label May 26, 2021
@niden niden mentioned this issue May 27, 2021
5 tasks
@niden
Copy link
Member

niden commented May 27, 2021

@StudioMaX We rely on PECL's PSR package. As of this moment there is no extension that offers container 1.1.1. The PR has been put on draft until that happens.

@StudioMaX
Copy link
Contributor Author

Thanks! As one of the possible improvements to the support of PSR interfaces - do you see the possibility of removing the requirement for the mandatory presence of the PSR extension in runtime?
Since most projects now work through Composer, I think it would be nice to determine the presence of PSR interfaces through autoloading. Thus, it was possible to use two ways to find interfaces:

  1. As now, with an installed PSR extension
  2. By autoloading, installed via composer or manually

And just throw an exception if someone try to use the Logger/Cache and any other component if the required interfaces are not found.

@StudioMaX
Copy link
Contributor Author

Further to my previous comment.
I found this issue related to my problem - jbboehr/php-psr#88
It seems impossible to abandon the use of the PHP-PSR extension in favor of autoloading, since only in this way the extension (Phalcon) can load the interfaces.

@niden
Copy link
Member

niden commented May 28, 2021

Anton and I saw that 1.1.1 is included in the 1.1.0 PSR package. We will work on this once the new Zephir version is released.

As to the PSR requirement, yes it is necessary to load PSR before Phalcon, otherwise it will not know where the interfaces are. This is a Zend Engine requirement.

@Jeckerson Jeckerson self-assigned this Aug 7, 2021
@Jeckerson
Copy link
Member

Related #15610

@niden niden linked a pull request Aug 12, 2021 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Aug 12, 2021

Resolved in #15506

@niden niden closed this as completed Aug 12, 2021
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release new feature request Planned Feature or New Feature Request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants