User tests: Successful: Unsuccessful:
JFolder is one of the few non-autoloadable classes. So, import it.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Isn't there a way to make JFolder autoloadoable, or, couldn't we create an autoloadable proxy class to for general usage?
I hope this one will go in 3.4.2...
OK here. Urgent for 3.4.2!
RTC please
Status | Pending | ⇒ | Ready to Commit |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-26 06:48:05 |
Closed_By | ⇒ | rdeutz |
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.
@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.
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.
Got it, thanks!
Labels |
Added:
?
|
Labels |
Removed:
?
|
Wow! That's quite a feat, @mbabker!
#test OK!