Comments (5)
Thank you for the clarification.
from php-psr.
Does that mean that the extension is only for use with other extensions that depend on this?
Primarily yes. But you can easily use it for any project from PHP land as dependency provider. At least to not install the same dependencies for each of project on the same workstation/server.
Is there any advantage in standalone use of this extension instead of the standard composer package offered by PHP-FIG?
As long as this project is fully compliant with the specifications, it makes not so much sense to satisfy these specifications using PHP. Yes, you still can, but it is not clear what problem do you solve by simply copying (from packagist.org) PHP-based interfaces each time to a new project. Can you elaborate on that? On the other hand, there are some extensions (like iterators, exceptions, SPL and so on), it seems nobody not plans to port to PHP :) Actually, the more interested question for me is why this project is not part of the PHP yet?
from php-psr.
Thank you. Having to install only once is an advantage in theory, but I am not sure how effective that would be in practice.
For example, if you are using a composer package that require psr/http-message-implementation
, then the package that provides it will most probably depend on psr/http-message
. Hence it would be installed anyway.
from php-psr.
For example, if you are using a composer package that require
psr/http-message-implementation
, then the package that provides it will most probably depend onpsr/http-message
. Hence it would be installed anyway.
From this side it may seem convenient. However, AFAIK, it is not a best practice to depend for a dependency which is a dependency of another dependency. If you're agree on that, then you'll always install all the dependencies explicitly (and specify desired versions) and do not relly that library A most probably depend on B.
from php-psr.
@sergeyklay is correct, but I'll just chime in with my own thinking:
If you want to develop or consume an extension that uses the PSR interfaces, the interfaces need to be provided at the extension level. As an extension developer, you could embed them in your own extension, but that could potentially lead to conflicts if more extensions do the same. So I and others developed this extension so they can be shared between any number of extensions (and normal PHP code, of course).
As for regular PHP code, there isn't a whole lot of use outside of questions of taste or minor optimization. For example: you could also use the extension to save having to load the PSR .php
files. This may make a minor efficiency improvement to cold starts or CLI. Or maybe you just prefer extensions because once the extension is loaded, they'll never fail to autoload any of the classes. Or maybe you prefer to manage your dependencies using the system package manager instead of composer.
from php-psr.
Related Issues (20)
- Add example on how to use logger traits in an extension HOT 3
- ServerRequestInterface not implements RequestInterface methods? HOT 1
- Failed tests with PHP 5.6 HOT 5
- Is TestLogger missing HOT 3
- Thank you from Phalcon HOT 1
- PECL still says latest release is version 0.6.0 HOT 3
- PSR v7.0 fails with "symbol lookup error" HOT 2
- Failed to install with PHP 7.4 HOT 3
- 1.0? HOT 5
- Incorrect default value for methods in \Psr\Log\LoggerInterface HOT 7
- New release with PHP 8 support? HOT 2
- Error with make when installing on macOS HOT 5
- Compatibility with psr/container 1.1 HOT 9
- Compatibility with newer psr libraries HOT 8
- This extension causes major compatibly issues HOT 17
- Not compatible with PHP <7.3
- Declaration of `Psr\Http\Message\StreamInterface::__toString()` must be compatible with `Stringable::__toString()` HOT 2
- php-7.2 build psr.so extension error HOT 2
- Windows DLL available to download
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-psr.