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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Administration |
I have tested this item
with this patch applyed for a couple of days the admin side still works as expected
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
This PR has received new commits.
CC: @alikon, @pritalpatel
Fixed. Copy/Paste errors suck.
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 notifications@github.com wrote:
@mbabker https://github.com/mbabker
I am also curious: why use DIR in some cases and full path in others?
Shall we not use all over the fullpath?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10881 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfobpl7lMnlKTAhJnWvAnw8eU3lqbCks5qWzuFgaJpZM4I6I8J
.
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
e.g.
/components/com_installer/
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 JPATH_
or __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.
I have tested this item
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).
anyhow, this works fine here and solves the issue we had with the gsoc project.
@andrepereiradasilva can you test again so that we get this in staging?
I have tested this item
on code review
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).
@mbabker
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 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
I have tested this item✅ successfully on b7afe6c
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)
Thanks.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10881.