r114393 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114392‎ | r114393 | r114394 >
Date:19:21, 21 March 2012
Author:preilly
Status:ok
Tags:
Comment:
remove WURFL to avoid, "ScientiaMobile, Inc." licensing terms
Modified paths:
  • /trunk/extensions/MobileFrontend/DeviceDetection.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.body.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/library (deleted) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.body.php
@@ -362,32 +362,6 @@
363363
364364 $userAgent = $_SERVER['HTTP_USER_AGENT'];
365365 $acceptHeader = isset( $_SERVER["HTTP_ACCEPT"] ) ? $_SERVER["HTTP_ACCEPT"] : '';
366 - $uAmd5 = md5( $userAgent );
367 -
368 - $key = wfMemcKey( 'mobile', 'ua', $uAmd5 );
369 -
370 - $props = null;
371 - try {
372 - $props = $wgMemc->get( $key );
373 - if ( !$props ) {
374 - $wurflConfigFile = RESOURCES_DIR . 'wurfl-config.xml';
375 - $wurflConfig = new WURFL_Configuration_XmlConfig( $wurflConfigFile );
376 - $wurflManagerFactory = new WURFL_WURFLManagerFactory( $wurflConfig );
377 - $wurflManager = $wurflManagerFactory->create();
378 - $device = $wurflManager->getDeviceForHttpRequest( $_SERVER );
379 -
380 - if ( $device->isSpecific() === true ) {
381 - $props = $device->getAllCapabilities();
382 - $wgMemc->set( $key, $props, 86400 );
383 - } else {
384 - $wgMemc->set( $key, 'generic', 86400 );
385 - $props = 'generic';
386 - }
387 - }
388 - } catch ( Exception $e ) {
389 - // echo $e->getMessage();
390 - }
391 -
392366 self::$title = $out->getTitle();
393367
394368 if ( self::$title->isMainPage() ) {
Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -17,15 +17,7 @@
1818
1919 // Define the extension; allows us make sure the extension is used correctly
2020 define( 'MOBILEFRONTEND', 'MobileFrontend' );
21 -// WURFL installation dir
22 -define( 'WURFL_DIR', dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'library' .
23 - DIRECTORY_SEPARATOR . 'WURFL' . DIRECTORY_SEPARATOR );
24 -// WURFL configuration files directory
25 -define( 'RESOURCES_DIR', dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'library' .
26 - DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR );
2721
28 -require_once( WURFL_DIR . 'Application.php' );
29 -
3022 // Extension credits that will show up on Special:Version
3123 $wgExtensionCredits['other'][] = array(
3224 'path' => __FILE__,
Index: trunk/extensions/MobileFrontend/DeviceDetection.php
@@ -322,7 +322,7 @@
323323
324324 if ( $formatName === '' ) {
325325 if ( strpos( $acceptHeader, 'application/vnd.wap.xhtml+xml' ) !== false ) {
326 - // Should be wap2 or in WURFL xhtmlmp
 326+ // Should be wap2
327327 $formatName = 'html';
328328 } elseif ( strpos( $acceptHeader, 'vnd.wap.wml' ) !== false ) {
329329 $formatName = 'wml';

Status & tagging log