r75693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75692‎ | r75693 | r75694 >
Date:11:43, 30 October 2010
Author:hashar
Status:ok (Comments)
Tags:
Comment:
Follow up r74684 : use default path if MW_INSTALL_PATH is not present.
Modified paths:
  • /trunk/phase3/extensions/README (modified) (history)

Diff [purge]

Index: trunk/phase3/extensions/README
@@ -15,8 +15,13 @@
1616
1717
1818 Please note that under POSIX systems (Linux...), parent of a symbolic path
19 -refers to the link source, NOT to the target! If you need to include a
20 -file from mediawiki/, you will want to set and use MW_INSTALL_PATH env.
 19+refers to the link source, NOT to the target! You should check the env
 20+variable MW_INSTALL_PATH in case the extension is not in the default location.
2121
22 - $IP = getenv( 'MW_INSTALL_PATH' ); // points to mediawiki/
23 - require( "$IP/maintenance/Maintenance.php" ); // a MediaWiki file
 22+The following code snippet let you override the default path:
 23+
 24+ $IP = getenv( 'MW_INSTALL_PATH' );
 25+ if( $IP === false ) {
 26+ $IP = dirname( __FILE__ ) . '/../..';
 27+ }
 28+ require( "$IP/maintenance/Maintenance.php" ); // a MediaWiki core file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74684A note about symbolic link and dirname() / include() ...hashar18:20, 12 October 2010

Comments

#Comment by Nikerabbit (talk | contribs)   11:49, 30 October 2010

What does the extension location have to do with this? It's the location of MediaWiki itself. Typo: snippet lets. Maybe it also say that the amount of levels to go backwards in the fallback case depend how deep you are in your extension directory.

#Comment by MarkAHershberger (talk | contribs)   19:26, 11 January 2011

Marking OK since r74684 is marked as resolved.

Status & tagging log