By the way, this one:
jaslorax wrote:
"15) Removed the $gCms variable from smarty.
has nothing to do with what you're talking about.
It is removed from
smarty means it is removed from
smarty. Not from the code at all.
That means you cannot use it in
templates anymore.
You won't be able to use
in a template since the var is just not available in a template anymore.
Or this one in a UDT:
won't work anymore.
But this is nothing really critical because if anyone really did use the template var gCms it will be his own fault. This code will have to fail someday.
Just consider the following: Smarty contains a reference of the gCms object and the gCms object contains a reference to smarty. Both were public. So you could do this: $smarty->_tpl_vars['gCms']->smarty->_tpl_vars['gCms']->smarty-> ...
So the code line
Code: Select all
$smarty->assign_by_ref('gCms', $gCms);
has to be removed from the include.php since it is no good design to have a public reference inside an object that contians a public reference to the other object ... (just try to use the smarty plugin {debug}; whenever it comes to the $gCms object it will crash because of endless recursion)
Thats all.
The "public global $gCms" stuff is something completely different. Even if it has also to with design. As you can see it is neccessary to make certain methods, vars or members of an object private to make sure nothing weird happens.
And this will be all that is gonna happen.
If there really is need to access private data of the CMSms internals there will be a public method to get these.
Additionally you won't be able to SET those data anymore.
Again, only if there is really any need to do so, there will be a public method that allows you to set something.
You won't have any trouble with your code if you switch from
to
in all your code
now since this function is already available in CMSms 1.8.2.
What exactly is going on inside the cmsms() function or what $gCms actually is, is completely irrelevant to you. Main thing is that it returns something that provides (hopefully well documented) public functions to you to access certain core functions. Thats all you need to know about the $gCms stuff.