Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (38 sloc) 1.495 kb
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
1 <?php
099441d Andrew Whitworth add changes from raymond in the mediawiki repo, r67479
authored
2 /**
ba55dce Andrew Whitworth Add a README file. Remove some more docs from EmbedVideo.php to populate...
authored
3 * EmbedVideo.php - Adds a parser function embedding video from popular sources.
4 * See README for details. For licensing information, see LICENSE. For a
5 * complete list of contributors, see CREDITS
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
6 */
7
8 # Confirm MW environment
a1f7369 Andrew Whitworth some refactors. Shouldn't be any major functional changes
authored
9 if (!defined('MEDIAWIKI')) {
e2db512 Andrew Whitworth separate out some logic into specific files.
authored
10 echo <<<EOT
11 To install EmbedVideo, put the following line in LocalSettings.php:
1bdb184 Andrew Whitworth another typo, though not as problematic
authored
12 require_once( "\$IP/extensions/EmbedVideo/EmbedVideo.php" );
e2db512 Andrew Whitworth separate out some logic into specific files.
authored
13 EOT;
14 exit( 1 );
a1f7369 Andrew Whitworth some refactors. Shouldn't be any major functional changes
authored
15 }
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
16
17 # Credits
18 $wgExtensionCredits['parserhook'][] = array(
099441d Andrew Whitworth add changes from raymond in the mediawiki repo, r67479
authored
19 'path' => __FILE__,
131229e Andrew Whitworth various cleanups, +docs, etc
authored
20 'name' => 'EmbedVideo',
544f8a6 Andrew Whitworth fix typo
authored
21 'author' => array('Jim R. Wilson', 'Andrew Whitworth',),
131229e Andrew Whitworth various cleanups, +docs, etc
authored
22 'url' => 'http://www.mediawiki.org/wiki/Extension:EmbedVideo',
e2db512 Andrew Whitworth separate out some logic into specific files.
authored
23 'description' => 'Adds a parser function embedding video from popular sources.',
131229e Andrew Whitworth various cleanups, +docs, etc
authored
24 'version' => '1.0'
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
25 );
26
e2db512 Andrew Whitworth separate out some logic into specific files.
authored
27 $dir = dirname(__FILE__) . '/';
9967535 Andrew Whitworth Autoload the correct file, now that I've renamed it.
authored
28 require_once($dir . "EmbedVideo.hooks.php");
e2db512 Andrew Whitworth separate out some logic into specific files.
authored
29 require_once($dir . "EmbedVideo.Services.php");
2dc9976 Andrew Whitworth Move the i18n messages into a separate file, as per best practices.
authored
30 $wgExtensionMessagesFiles['embedvideo'] = $dir . 'EmbedVideo.i18n.php';
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
31
32
90af0c2 Andrew Whitworth Major refactor. EmbedVideo is now static instead of being a singleton. R...
authored
33 $wgHooks['ParserFirstCallInit'][] = "EmbedVideo::setup";
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
34 if (version_compare($wgVersion, '1.7', '<')) {
35 # Hack solution to resolve 1.6 array parameter nullification for hook args
36 function wfEmbedVideoLanguageGetMagic( &$magicWords ) {
90af0c2 Andrew Whitworth Major refactor. EmbedVideo is now static instead of being a singleton. R...
authored
37 EmbedVideo::parserFunctionMagic( $magicWords );
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
38 return true;
39 }
40 $wgHooks['LanguageGetMagic'][] = 'wfEmbedVideoLanguageGetMagic';
41 } else {
90af0c2 Andrew Whitworth Major refactor. EmbedVideo is now static instead of being a singleton. R...
authored
42 $wgHooks['LanguageGetMagic'][] = 'EmbedVideo::parserFunctionMagic';
e44a729 Andrew Whitworth Initial checkin. Mostly a copy of the EmbedVideo code from Jimbojw, plus...
authored
43 }
Something went wrong with that request. Please try again.