jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/400463 )
Change subject: Replace class_exists with ExtensionRegistry checks
......................................................................
Replace class_exists with ExtensionRegistry checks
class_exists calls with a string are dangerous, because they violate
the separation between extensions and do not reflect changes that
have been made elsewhere. The `require` statement for `File_Ogg` was
also removed as it is bundled with TMH, and PEAR (the alternative) is
obsolete.
Bug: T183096
Change-Id: I8cf99e9d77f4978fe3e88d1c781c77f8b17a42e6
---
M includes/Score.php
1 file changed, 1 insertion(+), 5 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Score.php b/includes/Score.php
index e6df438..b9ba471 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -266,7 +266,7 @@
$options['generate_ogg'] = array_key_exists( 'vorbis',
$args );
if ( $options['generate_ogg']
- && !class_exists( 'TimedMediaTransformOutput' )
+ && !ExtensionRegistry::getInstance()->isLoaded(
'TimedMediaHandler' )
) {
throw new ScoreException( wfMessage(
'score-nomediahandler' ) );
}
@@ -895,10 +895,6 @@
* @return float duration in seconds
*/
private static function getLength( $path ) {
- // File_Ogg is packaged in TimedMediaHandler
- if ( !class_exists( 'File_Ogg' ) ) {
- require 'File/Ogg.php';
- }
$f = new File_Ogg( $path );
return $f->getLength();
}
--
To view, visit https://gerrit.wikimedia.org/r/400463
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8cf99e9d77f4978fe3e88d1c781c77f8b17a42e6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Ebe123 <[email protected]>
Gerrit-Reviewer: Ebe123 <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits