? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
26 Jun 2015

JFolder is one of the few non-autoloadable classes. So, import it.

avatar mbabker mbabker - open - 26 Jun 2015
avatar mbabker mbabker - change - 26 Jun 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jun 2015
Labels Added: ?
avatar smz
smz - comment - 26 Jun 2015

Wow! That's quite a feat, @mbabker! :clap:

#test OK!

avatar smz smz - test_item - 26 Jun 2015 - Tested successfully
avatar smz
smz - comment - 26 Jun 2015

Isn't there a way to make JFolder autoloadoable, or, couldn't we create an autoloadable proxy class to for general usage?

avatar smz
smz - comment - 26 Jun 2015

I hope this one will go in 3.4.2...

avatar infograf768
infograf768 - comment - 26 Jun 2015

OK here. Urgent for 3.4.2!

RTC please

avatar rdeutz rdeutz - alter_testresult - 26 Jun 2015 - infograf768: Tested successfully
avatar rdeutz rdeutz - change - 26 Jun 2015
Status Pending Ready to Commit
avatar zero-24 zero-24 - close - 26 Jun 2015
avatar rdeutz rdeutz - change - 26 Jun 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-06-26 06:48:05
Closed_By rdeutz
avatar rdeutz rdeutz - close - 26 Jun 2015
avatar zero-24 zero-24 - close - 26 Jun 2015
avatar Bakual
Bakual - comment - 26 Jun 2015

Isn't there a way to make JFolder autoloadoable, or, couldn't we create an autoloadable proxy class for general usage?

We could add the following code to https://github.com/joomla/joomla-cms/blob/staging/libraries/cms.php:
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');

That would make them autoloading.

In the case of the language filter plugin, you probably could also just use is_dir() instead of JFolder::exists(). The only difference is that JFolder does some sanitising on the path. I'm not sure that is needed here.

avatar smz
smz - comment - 26 Jun 2015

@Bakual
Is there any particular reason for not having made those two classes autoloadable?
Couldn't had been that the fix for this issue?

I agree is_dir() could had been enough in that case: in the next few days I plan to propose a code review of languagefilter.php and I'll adopt your suggestion in it.

avatar mbabker
mbabker - comment - 26 Jun 2015

Is there any particular reason for not having made those two classes autoloadable?

It requires renaming the classes in libraries/joomla/filesystem. JFile -> JFilesystemFile for example.

Truthfully, I wouldn't bother with it at this point. The next rename should be introducing the Framework's namespaced classes (i.e. Joomla\Filesystem\File) which would all be autoloaded anyway.

avatar smz
smz - comment - 26 Jun 2015

Got it, thanks!

avatar zero-24 zero-24 - change - 30 Jun 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment