-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Implement requirements checker #6
Comments
PHP 5.5 is almost being released, so the stable versions will be 5.4 and 5.5. Why don't you start supporting PHP 5.4+? I think until Yii 2 is ready PHP 5.3 will be deprecated. |
We have only one minor thing that doesn't work on 5.3 so far so there's basically no need to require 5.4. |
I think the word "support" is wrong here, we do support 5.4 but do not require it. |
Please focus on discussing how the requirement checker should be implemented instead of which version is required. We will choose the minimal version that suits Yii 2 the best. |
I think current 1.1 implementation is OK. As a bonus we can move detection code into a separate class and expose it to CLI. |
I would like to have requirements checker as part of the core, which allows to add extra requirements, specific to the particular application. |
Also it would be good to have both web and console (at least very simple one) interface for the requirement checker. |
Agreed with @samdark on separating it and with @klimov-paul on making it extensible for the application's own requirements. |
Sounds good to me including a requirement checker class into the core. Would you please propose some design and usage about it? |
Does anyone know a library or tool to take this a step further? I think of an analyzer that collects all used classes and functions, then looks up their requirements from some sort of database. Output might be grouped into PHP versions/ extensions with a list of source code occurrences and counters. Something that could tell you: "Your app requires PHP 5.3, with the extens x, y and z enabled. But because of those two lines of code, you need PHP 5.4 and another extension". |
There is an important question in this matter: how old PHP version should "requirements checker" support. |
Can you insert a line in front of the class to detect the minimal PHP requirement for running the requirement checker? |
Of course,I can use something like:
|
However, the higher minimum supported version, would allow creation of more gracefull implementation. |
I think PHP 5.1 should be fine. For lower versions, the only drawback is the less pretty output. |
mb_string as a required extension: #26 |
Implementation created under "yii/requirements". |
Created implementation is based on "requirements" solution from Yii 1.1.x.
|
@klimov-paul, looks nice but it has problems with 80 characters wide terminals/shells. For instance MinGW Bourne Again Shell window could not be made wider and thus affected by this limitation. Screenshot below: |
Yes, @resurtm, I see. Need to think about this problem. |
Perhaps the requirement "memo" column should be removed from the console interface. |
@klimov-paul, have you thought about expanding each requirements item on two lines? In particular when rendering on terminals narrower than hundred characters. |
the idea of 2 rows is better.. how about having the memo on the second line? |
I am not sure the list will look good in this way, although may be I should try.
Is there a reliable mechanism to determine terminal width? I suppose no. |
May be I should not try to represent results as table. |
Perhaps it would be better to list the requirements by blocks: Name: Requirement1 Name: Requirement2 Errors: 0 Warnings: 0 Total checks: 2 |
Blocks are fine. |
Allright, I will rework console view to use blocks. This seems to be most realiable solution. |
The text was updated successfully, but these errors were encountered: