-
-
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
Minimal PHP version requirement #35
Comments
Just found this project: PHP_CompatInfo |
I can not tell for everyone, but I usually deal with Linux CentOS as a basis of web server. Since CentOS is a free version of RedHat, it is common choice for the server systems, which do not require any visual interface. There are several major advantages, which Yii can benefit from using PHP 5.4: In our pursuit for the better functionality we have already raised the requirements up to 5.3.8, why stop there? We have already found that at least Ubuntu and CentOS do not support PHP 5.3.8 natively, I would not be surprised if many other Linux distributives will have same problem. If we have already overcome the common restrictions, why we can not overcome them further for the “better future”? |
Because of stats: http://w3techs.com/technologies/details/pl-php/5/all |
At these “stats” it is hard to tell which exact “5.3” version is used. I assume in this statistic “5.3” means “5.3.3”. I doubt it matches “5.3.8”. |
As I said before, I am afraid we have already overstep the most spread PHP version by requirement of “5.3.8” |
OK, let’s do some precise calculations, just in case. Summary:
|
Yeah. So while 5.3.7 looks like safer approach compared to 5.4. Featurewise there were no things we can't do with 5.3 till @cebe refactored AR to use traits. So far that's the only valid usage. Short array syntax is just a bonus, not a tech stuff. |
Can we get the list of major shared hosting providers and see what PHP versions they support by default? For Yii applications developed to run on dedicated servers, PHP version is not a problem. The problem mainly exists for applications running on shared hosting environments, especially if Yii is used to developed a generic application such as forum, CMS, whose minimum requirement should be as low as possible. |
@qiangxue which are major? And where? I think I can get stats for Russia. |
https://docs.google.com/spreadsheet/ccc?key=0Agccij5yGAXadFZBcVV4U0NaUWwyNko4MTBNcHI1T1E feel free to add more. |
added the major german hosters. |
On one side, while a good number of hoster have included 5.4, a good part is still using 5.3 as a base and that would mean more garanties of "YII spreading" On the other side I would go with 5.4 to enforce a more robust PHP base that could simplify some YII choices. Just my 2 cents thought: |
Vote for PHP 5.4 |
If we choose to go with 5.4.x, what x should it be? |
5.4.0 |
agree with 5.4.0 as long as we see there are bugs that we need to have fixed to make yii work properly. |
I vote for PHP 5.4 too. Regarding minor version the answer would be ".0 or whichever other minor version is needed to do what we want". |
The thing is that we can look at usage statistics as much as we want, but at the end of the day the choice we make now is one that will stick for the entire lifetime of Yii2 (or at least Yii 2.0), and that's probably going to outlast peoples' old PHP environments. |
vote for 5.4 |
Just collected a list of php version required by other framework/applications. Wordpress - 5.2.4 Joomla: http://www.joomla.org/technical-requirements.html, 5.3.1+ Choose 5.4 looks a bit aggressive. |
Choosing 5.4 along with using it's features doesn't seems aggressive, but progressive |
Probably there is need in public voting on related websites like yiiframework.com |
If we officially require 5.4 we also want to be a 5.4 framework that really uses the benefits that come with this version. I can't see why we should silently keep BC to 5.3.x while we are not telling it. This generates confusion about the version requirement for users so they can not be sure whether they are save with 5.3 or not. There should be one minimum requirement and that should be based on real technical requirement because of technology actually used. |
Adding to the points made by @klimov-paul; 5.4 also enables referencing the object instance from Closures which is a great feature. @samdark makes a valid point as well, it does make a nice marketing catch as well, hadn't crossed my mind. It is not a reason alone of course, but it is a side-benefit. @cebe has already made some commits on redis branch (I think?) and has reduced the LoC significantly. This is great. So, 5.4 (with a prompt to use latest stable release number) has my vote. |
EOL is important not only for marketing stuff but also to decide which functionalities can be used in YII2. As usual, my 2 cents opinion |
In my opinion, Yii 2 is far away for being in beta stage and it will take longer for the stable version release than the EOL date of PHP 5.3, so the logical decision is to go with PHP 5.4. Main reasons to go for 5.4 for me are:
As @iJackUA said, one that is serious about using Yii 2 in a web application, they will go with at least a vps, where they have control of what they can install. Debian 6 was frozen with PHP 5.3.3, but I used the dotdeb repo to update to the latest 5.3.27 to resolve some issues that I faced with the earlier versions. Debian 7 is with 5.4.4. Upgrading to 5.4 will be a great benefit for all these shared hosting providers, because of the reduced memory footprint of PHP 5.4. If Yii 2 was a couple of months away from release, then maybe I would say go for 5.3, but as @samdark said, this is just a minimum requirement, not the recommended one. |
I agree if base on 5.4 could make a better Yii2, not just for marketing reason.Actually if we can keep the lower version requirement and get much better Yii2, market will more like to see that.Because it means a much better framework can reach more potential users. What makes Yii2 a better framework? Not the new syntax we can take advantage of from new PHP version. So there are 2 things we need to weight here: |
when 2.0 was first announced, targeting 5.3.x seemed like a good idea, but that was quite some time ago and the world has moved on. 5.4 is just about everywhere and it's not in our interests to support the few remaining webhosts who don't support it - serious users will not be using shared hosting, and casual users are free to switch to shared hosts that do support 5.4 - essentially this is a problem the market will fix. Switching to 5.4 is actually quite an exciting prospect, because, potentially, almost all methods and properties could live in traits. For instance, you could have a |
@phpnode it looks like such rethinking could delay Yii2 for another 6-10 months :) |
@iJackUA right, it's unfortunate that this discussion is happening now and not 6 months ago, but this is still alpha, and I actually don't think this would be impossible to do quickly, functionally it would be the same as present - it's really just a very large refactor |
This really isn't a question of what is appropriate right now. Rather, it is a question of what Yii2 should be developed for right now so that, upon release of a stable version, it will be at the forefront of the market, not just in PHP version but in quality of framework. Let's be realistic. Just looking at the issues here in git, alpha is a month behind with 4 issues left to close, beta is 10 days past with zero closed issues (granted a lot of them are in dev or under discussion)... But a stable release is still about 3-4 months away, minimum. Now, lets take the approach of some of the folks above did in terms of PHP EOL... 4 months from now 5.3 will be 5 months from EOL? There needs to be a notion of forethought here and not, "OK, what seems appropriate for right now?". Developing with 5.4 NOW will lead to a perfect spot in the market when a stable release comes out. To those that have said, "What's the use in declaring a version that we aren't using features from?", again, we have to have a focus on what is to come. Minimum, there are 3-4 more pre-release development months to utilize those features that 5.4 offers. Then, you have to think, after Yii2 has a stable release there is still going to be active development. Things just don't stop and transition to bug fixes, at least not entirely. Remember, there was 2.5 years b/t Yii1.1 and the current Yii1.1.14 release. Sticking Yii2 with 5.3 is not a viable move in the long run. That leaves 5.4 since 5.5 will still be too far ahead of the game upon release of a stable version. Really the only matter after that is one of deciding between 5.4.0 or 5.4.x. Of course, we still need to be thinking about what will be the norm 5-6 months from now. I think it's somewhat safe to say we will ,at least, start to see the 20-40% usage each for 5.2 and 5.3 that we see right now will change to being 5.3 and 5.4 in that 6 month time frame. Furthermore, When 5.3 was widely adopted, it wasnt at the 5.3.0 level, it was a few sub-versions after that. I think the solution is to decide on 5.4 now and pick a 5.4.x closer to release. This gives the capability for traits, et al, for the rest of the duration till release while allowing flexibility for what is to come when 5.4 is actively adopted. |
PHP 5.4 👍
And @websupport-sk (biggest webhosting company in Slovakia), supports 5.4. :) |
Based on this discussion and our internal discussion, we will go for 5.4. For 2.0 release, I don't think we should introduce significant architectural change because of traits because it would otherwise significantly delay 2.0 release (again). The main work to do for 2.0 is using short array syntax and short echo syntax. Of course we also need to review the AR refactoring proposed by cebe. |
What coding style should we use for the short echo tag? How about this? |
@qiangxue I've already replaced everything to use |
If short echo tag notitation is to be used, I think it looks good like @qiangxue wrote it. No need to remove spaces, it would just make it less readable without any practical gain. It would also look weird when one enters an expression that contains a space. |
Adjusted short syntax c2dabfa |
Should short echo syntax relpace all echoes in views or there are some cases it shouldn't?
I could help adjusing those... (I am always doing doing the hard work 😄 ) |
It should except when there are multiple lines. Would be great if you'll help with these and test it. |
We've used Short-Echo Syntax extensively in gtc (for Yii 1.1). I am adding a link to give you some impressions. It improves readability a lot. https://github.com/schmunk42/gii-template-collection/blob/master/fullCrud/templates/slim/_form.php |
@schmunk42 we already applied short echo syntax all over the framework code :) |
I added it, because of samdark's comment:
I think even for multiple lines, especially for gii, short tags are great ;) |
closed as we have chosen to use 5.4. |
This ticket collects the minimal PHP version requirements from various classes. We will determine the final minimal version requirement when we finish the core framework classes.
stream_resolve_include_path
Json::decode()
: use of constant JSON_ERROR_UTF8, http://us1.php.net/manual/en/function.json-last-error.phpSecurityHelper::generateSalt()
: use ofThe text was updated successfully, but these errors were encountered: