Just because the Framework is doing something doesn't automatically mean
the CMS is doing it too...

On Friday, April 25, 2014, George Wilson <notifications@github.com> wrote:

> In libraries/cms/controller/base.php:
>
> > +	 * @return void
> > +	 */
> > +	protected function refreshToken()
> > +	{
> > +		$session = JFactory::getSession();
> > +		$session->getToken(true);
> > +	}
> > +	
> > +	/**
> > +	 * Method to translate a string using JText::_() method
> > +	 * @param string $string
> > +	 * @return string translation result
> > +	 */
> > +	protected function translate($string)
> > +	{
> > +		return JText::_($string);
>
> Actually I would anything touching JSession just because we know the
> framework team have decided to use symfony session package so I guess the
> CMS might transition too in the not too distant future. So abstracting that
> out is a good idea in my opinion
> … <#14599fe8ed5f5269_>
> On Friday, April 25, 2014, Thomas Hunziker <notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');>>
> wrote: In libraries/cms/controller/base.php: > + * @return<https://github.com/return>void > + */ > + protected function refreshToken() > + { > + $session =
> JFactory::getSession(); > + $session->getToken(true); > + } > + > + /** > +
> * Method to translate a string using JText::_() method > + * @param<https://github.com/param>string $string > + *
> @return <https://github.com/return> string translation result > + */ > +
> protected function translate($string) > + { > + return JText::_($string); I
> did this because personally I don't like static functions spread all over
> the place. I'd say the uses in the controllers are out least concern here.
> If we ever are going to change JText::_(), we will have to change it in
> many many places. Let's do a proper replacement when JText is deprecated
> and not introduce a new method in a PR which has a completely different
> target. Personally I don't think that will happen anytime soon. As for the
> other wrappers (I think you mean the validateSession and refreshToken
> methods), I wouldn't do that neither. IMHO it just complicates the code. —
> Reply to this email directly or view it on GitHub<
> https://github.com/joomla/joomla-cms/pull/3503/files#r12007010> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/joomla/joomla-cms/pull/3503/files#r12007289>
> .
>