From 4e55b84bf40c5a27cc1c3a251d8e47c6d9e44520 Mon Sep 17 00:00:00 2001 From: macbre Date: Fri, 17 Aug 2012 11:06:36 +0000 Subject: [PATCH] Wikia class cleanup: methods removed * Wikia::json_encode * Wikia::json_decode * Wikia::binWkhtmltopdf git-svn-id: svn+ssh://svn.wikia-code.com/svn/wikia/trunk@58480 e846bd91-c042-42a7-a218-4b65e2c1904d --- includes/wikia/Wikia.php | 90 ++-------------------------------------- 1 file changed, 4 insertions(+), 86 deletions(-) diff --git a/includes/wikia/Wikia.php b/includes/wikia/Wikia.php index e29b48b1441c..9d478b25a0be 100644 --- a/includes/wikia/Wikia.php +++ b/includes/wikia/Wikia.php @@ -315,7 +315,7 @@ static public function ImageProgress( $type = "bar" ) switch ( $type ) { default: return Xml::element( 'img', array( - "src" => "{$sImagesCommonPath}/skins/quartz/images/progress_bar.gif", + "src" => "{$sImagesCommonPath}/skins/quartz/images/progress_bar.gif", // FIXME: image does not exist "width" => 100, "height" => 9, "alt" => ".....", @@ -324,74 +324,6 @@ static public function ImageProgress( $type = "bar" ) } } - /** - * json_encode - * - * json encoding function - * - * @deprecated - * - * @access public - * @static - * author eloy@wikia - * - * @param mixed $what: structure for encoding - * - * @return string: encoded string - */ - static public function json_encode( $what ) { - wfProfileIn( __METHOD__ ); - wfDeprecated(__METHOD__); - - $response = ""; - - if( 1 ) { // currently json class included in MW looks better - $json = new Services_JSON(); - $response = $json->encode( $what ); - } - else { - $response = json_encode( $what ); - } - wfProfileOut( __METHOD__ ); - - return $response; - } - - /** - * json_decode - * - * json decoding function - * - * @deprecated - * - * @access public - * @static - * author eloy@wikia - * - * @param string $what: json string for decoding - * @param boolean $assoc: returned object will be converted into associative array - * - * @return mixed: decoded structure - */ - static public function json_decode( $what, $assoc = false ) { - wfProfileIn( __METHOD__ ); - wfDeprecated(__METHOD__); - - $mResponse = null; - - if (!function_exists('json_decode')) { #--- php < 5.2 - $oJson = new Services_JSON(); - $mResponse = $oJson->decode( $what ); - } - else { - $mResponse = json_decode( $what, $assoc ); - } - - wfProfileOut( __METHOD__ ); - - return $mResponse; - } - /** * binphp * @@ -418,20 +350,6 @@ static public function binphp() { return $path; } - static public function binWkhtmltopdf() { - wfProfileIn( __METHOD__ ); - - $path = ( file_exists( "/opt/wikia/bin/wkhtmltopdf" ) - && is_executable( "/opt/wikia/bin/wkhtmltopdf" ) ) - ? "/opt/wikia/bin/wkhtmltopdf" - : "/usr/bin/wkhtmltopdf"; - - wfProfileOut( __METHOD__ ); - - return $path; - } - - /** * simple logger which log message to STDERR if devel environment is set * @@ -945,14 +863,14 @@ public static function isMainPage() { wfProfileOut(__METHOD__); return $result; } - + public static function isContentNamespace() { wfProfileIn(__METHOD__); global $wgTitle, $wgContentNamespaces; static $result = null; - + if (is_null($result)) { if (in_array($wgTitle->getNamespace(), $wgContentNamespaces)) { $result = true; @@ -1892,7 +1810,7 @@ static public function onResourceLoaderUserOptionsModuleGetOptions( ResourceLoad /** * Hook: reset recipient's name * @param array of MailAddress $to - * @return bool true + * @return bool true */ static public function onUserMailerSend( &$to ) { foreach ( $to as $u ) {