concretecms / concrete5-legacy

Legacy repository for concrete5
http://www.concrete5.org
559 stars 323 forks source link

avoid warnings for PHP7 #1917

Closed Remo closed 9 years ago

Remo commented 9 years ago

I'm not merging this anytime soon, just to show others what's needed to get concrete5 running on PHP7 beta1

Remo commented 9 years ago

Installation works, but rendering a page doesn't work, it fails with Using $this when not in object context just like hhvm..

Remo commented 9 years ago

this PR fixes the problem for PHP7 https://github.com/concrete5/concrete5-legacy/pull/1564/

KorvinSzanto commented 9 years ago

:-1: Make sure that if you do this you are reviewing your code carefully, this will hide any warnings that PHP would raise and will make it really hard to debug any issues.

I guess when PHP 8 comes out, we'll just disable all errors completely. :disappointed:

Remo commented 9 years ago

@KorvinSzanto as mentioned in the first line of this PR, I'm not going to merge this as it is. I've merely created this to see if 5.6 could work on PHP7. I've posted a release of 5.6 for PHP7 in the forums for those who want to play with it, that's all. If we're going to work with it on PHP7 it will require more effort.

KorvinSzanto commented 9 years ago

I agree with the sentiment of wanting to run smoothly on PHP7, I just want to make it clear that this method of "support" is dangerous and not recommended for production websites. If you want to use PHP 7, use a CMS that has real support for it.

Remo commented 9 years ago

True, but you know how it will be. Users will want to use it, no matter if it's recommended. My PR is just a start and if I ever have to run it I'll analyse those warnings. I don't intend to create a truly public release for this, only those reading the forum or github will find it.. Use it at your own risk and don't blame me if something breaks ;-)

KorvinSzanto commented 9 years ago

At least now if anyone happens upon this, they can see that it isn't recommended.