User tests: Successful: Unsuccessful:
Load files in the admin app by including the required classes to the autoloader.
The admin app should still function correctly.
I have tested this item
I have tested it using automatic test suits which I have created to test content and user feature. All were successful after applying this patch. Created video for this tests here https://youtu.be/D4TKK4VUIHg
(Regarding testing instructions first I was confused by word "admin app" in testing info. But later I understand that it's mean to Joomla! Administrator tests)
|Status||Pending||⇒||Ready to Commit|
The DIR constant is an absolute path, specifically to the directory the
file is located in. IMO it's more readable to use it as able (mostly when
the path being loaded is the same level or under the file referencing it).
On Monday, July 18, 2016, infograf768 firstname.lastname@example.org wrote:
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
or mute the thread
The DIR constant is an absolute path, specifically to the directory the file is located in.
yes about "absolute path" , it is
but the benefit of it is that you don't need to care much about what is exactly this absolute path is,
it helps avoiding the hardcoding of component name
the argument , if same folder or parent folder, then we use it __ DIR __, but if parent - parent folder we don't use , sounds strange to me
It's a personal preference and AFAIK there is no style rule regarding how paths should be referenced. I'd suggest either absolute paths using
__DIR__ or one of the
JPATH_ constants referencing an application root, but I personally dislike
require __DIR__ . '/../../folder/file.php' structures and avoid using them. As for when I use
__DIR__ it really boils down to where the file in question lies in the filesystem more than anything; I don't see the need to write out the full path if I'm including a file in either the same directory or a subdirectory from the file I'm in.
If we're going to nitpick over this stuff, I'll just close my autoloader PRs. I'm also not a fan of PRs getting held up because people want to try and apply arbitrary standards to them.
Also, before I end ranting, a benefit to using absolute paths versus relative is you don't have to change the include reference if you move the file. If I move the file calling
require __DIR__ . '/../../folder/file.php' to another directory, I have to update the reference (OK, same goes for anything using
__DIR__ honestly; using
JPATH_ avoids that completely but IMO it's unnecessary overkill sometimes).
Also, before I end ranting, a benefit to using absolute paths versus relative is you don't have to change the include reference if you move the file. If I move the file calling require DIR . '/../../folder/file.php' to another directory, I have to update the reference (OK, same goes for anything using DIR honestly; using JPATH_ avoids that completely but IMO it's unnecessary overkill sometimes).
Agreed that is why i prefer to use JPATH too
I'm also not a fan of PRs getting held up because people want to try and apply arbitrary standards to them.
and i hope that you don't imply that i am preventing a good PR, i was just asking, i had said the paths are good.
Not trying to imply anything at all, sorry if it comes across that way. Just seen a lot more than I'd like lately folks requesting changes to PRs simply because they're already editing the lines they'd like to see changed.
|Status||Ready to Commit||⇒||Fixed in Code Base|
|Closed_Date||0000-00-00 00:00:00||⇒||2016-07-18 20:34:59|