? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
12 Jul 2017

Summary of Changes

One of the changes in the Registry package's 2.0 branch is that the PHP formatter class now supports dumping data in its correct data type (in CMS 3.x and Framework 1.x the resulting PHP class always uses strings for the properties, Framework 2.x will now dump an integer as an integer and a boolean as true or false versus string 1 or string 0). Especially with boolean values, this actually makes it more clear what the property is, what it controls (manually editing public $offline so it's true or false versus 1 or 0 to me makes more sense), and the type of data you can expect in the field.

This PR changes the step in the install app that writes the configuration.php file and the filters in com_config when editing the global configuration to use type aware values consistently for numeric and boolean properties.

Testing Instructions

Install the 4.0 branch with this PR applied. Note that properties such as $debug, $offline, and $shared_session should now use boolean true/false versus 1/0 values when the file is written. Go to the global configuration, make a change (the change is up to you, it will be most noticeable for testing though if you change a value that should be boolean (a yes/no toggle) or numeric), and save the changes. Then manually inspect the configuration.php file. The properties should be in their correct data type still.

Documentation Changes Required

In the documentation going forward, code examples should make more consistent use of the correct data types as this is in many cases more clear. However, this would be a best practice change and not something requiring developers make code changes; given PHP's roots as a loose typed system, existing code which works with numeric and boolean designed values will continue to function OK unless they are implementing strict checks.

avatar mbabker mbabker - open - 12 Jul 2017
avatar mbabker mbabker - change - 12 Jul 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jul 2017
Category Administration com_config Installation
avatar mbabker mbabker - change - 12 Jul 2017
The description was changed
avatar mbabker mbabker - edited - 12 Jul 2017
avatar brianteeman brianteeman - change - 19 Jul 2017
Milestone Added:
avatar brianteeman brianteeman - change - 19 Jul 2017
Milestone Added:
avatar wilsonge wilsonge - change - 29 Jul 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-07-29 17:07:33
Closed_By wilsonge
avatar wilsonge wilsonge - close - 29 Jul 2017
avatar wilsonge wilsonge - merge - 29 Jul 2017

Add a Comment

Login with GitHub to post a comment