? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
28 Mar 2015

One of the changes in PHP 7 is the platform now allows Scalar Type Hints. Implementing this change means there are now some new reserved keywords in the language that cannot be used for class names, such as "string". We have a class named just that in the Framework's String package and have managed its deprecation at that level.

This PR updates the CMS to use the latest String package which includes a new "StringHelper" class to replace the existing "String" class. JString is modified to extend this directly versus the older class.

Testing Instructions

JString is used to help create aliases on items when you save them. So you should be able to create a new item and validate the alias is still processed correctly.

B/C Implication

As JString, String, and StringHelper are all abstract, there is no practical reason to typehint against this class. However, in the very off chance someone may be, a JString object will no longer match a typehint for a String class. The typehint can be updated for StringHelper and everything will work out OK. I realize this is a fat chance, but it is a B/C break and the options are either this or Joomla 3 will not function on PHP 7.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar mbabker mbabker - open - 28 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 28 Mar 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 28 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 29 Mar 2015
Category External Library
avatar wilsonge wilsonge - change - 31 Mar 2015
Milestone Added:
avatar mbabker
mbabker - comment - 31 Mar 2015

PR is updated to include the utilities and registry packages as well due to their use of the string package.

avatar mbabker
mbabker - comment - 31 Mar 2015

Also added the application package to this because it had a reference to String that was replaced. And dropped unit tests fully for the registry and string packages (something about the string tests was causing the bad class to trigger in PHP 7 and the CMS shouldn't need to run a now partial test suite on code it is consuming).

avatar mbabker mbabker - change - 10 May 2015
Milestone Removed:
avatar mbabker
mbabker - comment - 14 May 2015

If this is pegged for 3.5, can it be merged to the 3.5 branch at some point? PHPUnit won't even run on PHP 7 right now because of the String class, so basically everything is stalled out trying to work out PHP 7 compatibility.

avatar wilsonge
wilsonge - comment - 14 May 2015

I aim to merge this tonight

avatar wilsonge wilsonge - change - 14 May 2015
Milestone Removed:
avatar wilsonge wilsonge - assigned - 14 May 15
avatar nikosdion nikosdion - test_item - 14 May 2015 - Tested successfully
avatar nikosdion
nikosdion - comment - 14 May 2015

@test I can confirm the patch. Before the patch: PHP 7 blew up telling me that string is a reserved class name. After the patch: I get the installer page. It won't go anywhere after that (loops back to the same page), but it's a good start!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6600.

avatar wilsonge wilsonge - reference | 834ad2c - 14 May 15
avatar wilsonge wilsonge - change - 14 May 2015
Milestone Removed:
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-14 18:27:44
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 14 May 2015

Merged in 834ad2c

avatar wilsonge wilsonge - close - 14 May 2015
avatar wilsonge wilsonge - close - 14 May 2015
avatar mbabker mbabker - head_ref_deleted - 14 May 2015
avatar mbabker
mbabker - comment - 14 May 2015

:+1:

Add a Comment

Login with GitHub to post a comment