Skip to content

Commit

Permalink
Wikia class cleanup: methods removed
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
macbre committed Aug 17, 2012
1 parent a727697 commit 4e55b84
Showing 1 changed file with 4 additions and 86 deletions.
90 changes: 4 additions & 86 deletions includes/wikia/Wikia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" => ".....",
Expand All @@ -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
*
Expand All @@ -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
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 4e55b84

Please sign in to comment.