[MediaWiki-l] When loading extensions is require_once or include_once preferred?

Chris Koerner nobelx at gmail.com
Thu Nov 6 21:33:22 UTC 2014


I'm getting ready to update my wiki and noticed that extensions are not
declared the same way in LocalSettings.php. I have about 57 extensions, and
all but 7 use 'require_once'

>From a programmatic standpoint, the difference appears to be in how PHP
will handle errors.

>From http://www.w3schools.com/php/php_includes.asp

The require() function is identical to include(), except that it handles
errors differently. If an error occurs, the include() function generates a
warning, but the script will continue execution. The require() generates a
fatal error, and the script will stop.

In the general scheme of things, is one a better practice over the other?
Is it nuanced between extensions in such a way that some extensions need
one over the other?

Yours,
Chris Koerner
clkoerner.com


More information about the MediaWiki-l mailing list