Remove globals for core back-end dispatch
Posted: Sun Oct 01, 2017 4:23 pm
Hi everybody!
There are several global variables which are there to support CMSimple_XH's core back-end (aka. administration) dispatch, namely: $phpinfo, $settings, $sysinfo, $validate, $xh_backups, $xh_change_password, $xh_do_validate, $xh_pagedata and $xh_plugins. These are initialized from a given GET or POST parameter, but in the following only used to set $f to an appropriate value. Of course, the detour of using global variables for this purpose is nonsentical; the respective GET or POST parameters can be checked in ::setBackendF() directly.
Simply changing the respective code (and so removing these globals) might break extensions, though, particularly since some of these globals are not documented at all, and the others are inconspicuously documented as private. Therefore I suggest to add prominent deprecation warnings for XH 1.8.0 and to finally remove them in 2.0.0 without any replacement.
Note that I'm planning to update our developer documentation from master from time to time[1], so deciding on this rather sooner than later would give extension writers more time to become aware of the scheduled change, and to act accordingly.
Thoughts?
There are several global variables which are there to support CMSimple_XH's core back-end (aka. administration) dispatch, namely: $phpinfo, $settings, $sysinfo, $validate, $xh_backups, $xh_change_password, $xh_do_validate, $xh_pagedata and $xh_plugins. These are initialized from a given GET or POST parameter, but in the following only used to set $f to an appropriate value. Of course, the detour of using global variables for this purpose is nonsentical; the respective GET or POST parameters can be checked in ::setBackendF() directly.
Simply changing the respective code (and so removing these globals) might break extensions, though, particularly since some of these globals are not documented at all, and the others are inconspicuously documented as private. Therefore I suggest to add prominent deprecation warnings for XH 1.8.0 and to finally remove them in 2.0.0 without any replacement.
Note that I'm planning to update our developer documentation from master from time to time[1], so deciding on this rather sooner than later would give extension writers more time to become aware of the scheduled change, and to act accordingly.
Thoughts?