https://bugzilla.wikimedia.org/show_bug.cgi?id=31046

       Web browser: ---
             Bug #: 31046
           Summary: Skin .deps.php using a define instead of dirname() to
                    guess the base directory
           Product: MediaWiki
           Version: 1.17.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: Unprioritized
         Component: Templates
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


The .deps.php files in the skin directory use the following snippet to load
SkinTemplate.php:

require_once( dirname( dirname( __FILE__ ) ) . '/includes/SkinTemplate.php');

This assumes that the skin directory is in a specific place (which does not
have to be the case if $wgStyleDirectory is used, especially useful for
multi-site installations with the same source code directory).

It would be more elegant to find the base path once and store it for later use,
instead of having scripts guess each time they are called.

As a workaround I currently ensure that MW_INSTALL_PATH is set in my
LocalSettings.php and use that, there is probably some other define that I
haven't noticed yet that works just as fine or is better suited.

require_once( MW_INSTALL_PATH . '/includes/SkinTemplate.php');

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to