diff options
Diffstat (limited to 'extensions/TimedMediaHandler/mwEmbedLoader.php')
-rw-r--r-- | extensions/TimedMediaHandler/mwEmbedLoader.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/extensions/TimedMediaHandler/mwEmbedLoader.php b/extensions/TimedMediaHandler/mwEmbedLoader.php new file mode 100644 index 00000000..ae03a3dd --- /dev/null +++ b/extensions/TimedMediaHandler/mwEmbedLoader.php @@ -0,0 +1,24 @@ +<?php +// This is a stub entry point to load.php This is need to support valid paths for the stand alone +// mwEmbed module html test files. + +// This is useful for running stand alone test of mwEmbed components in the TimedMediaHandler +// extension. ( ie MwEmbedModules/EmbedPlayer/tests/*.html files ) + +$_GET['modules'] = 'startup'; +$_GET['only'] = 'scripts'; + +// NOTE this won't work so well with symbolic links +$loaderPath = dirname(__FILE__) . '/../../load.php'; +if( is_file( $loaderPath ) ){ + chdir( dirname( $loaderPath ) ); + include_once( $loaderPath ); +} else { + print "if( console && typeof console.log == 'function' ){ console.log('Error can't find load.php for stand alone tests' ) }"; +} +// Bootstrap some js code to make the "loader" work in stand alone tests: +// Note this has to be wrapped in a document.write to run after other document.writes +$pageStartupScript = ResourceLoader::makeInlineScript( + Xml::encodeJsCall( 'mw.loader.go', array() ) +); +echo Xml::encodeJsCall( 'document.write', array( $pageStartupScript ) ); |