Jump to content

[Solved] Enable Object Cache On And Enable Hashing On Johnny


paladox2014

Recommended Posts

Hi please can you enable object cache because i get this error on johnny. stevie has it enabled and doesent show that warning. please fix it.

 

Warning: Could not find APC, XCache or WinCache.

Object caching is not enabled.

 

and a recent update to mediawiki 1.26 wmf 7 in resouceloader requires object caching to enable javascript. I doint get this error on stevie and javascript works for me there because object caching is enabled.

 

username = pal2015 and website = wikisaur.tk

 

Hi which cache software do you use on stevie and use that software on johnny please.

Link to comment
Share on other sites

I now do not belive object cache is the reason. On stevie it seems to be able to generate hasing for resourceloader but on johnny it wont could you follow what you did on stevie on johnny please.

 

http://searchsqlserver.techtarget.com/definition/hashing

 

Problem with this code

 

public function getVersionHash( ResourceLoaderContext $context ) {

// Cache this somewhat expensive operation. Especially because some classes

// (e.g. startup module) iterate more than once over all modules to get versions.

$contextHash = $context->getHash();

if ( !array_key_exists( $contextHash, $this->versionHash ) ) {

 

$summary = $this->getDefinitionSummary( $context );

if ( !isset( $summary['_cacheEpoch'] ) ) {

throw new Exception( 'getDefinitionSummary must call parent method' );

}

$str = json_encode( $summary );

 

$mtime = $this->getModifiedTime( $context );

if ( $mtime !== null ) {

// Support: MediaWiki 1.25 and earlier

$str .= strval( $mtime );

}

 

$mhash = $this->getModifiedHash( $context );

if ( $mhash !== null ) {

// Support: MediaWiki 1.25 and earlier

$str .= strval( $mhash );

}

 

$this->versionHash[ $contextHash ] = ResourceLoader::makeHash( $str );

}

return $this->versionHash[ $contextHash ];

}

 

problem code is if ( !array_key_exists( $contextHash, $this->versionHash ) ) {

 

if I remove ! from if ( !array_key_exists( $contextHash, $this->versionHash ) ) {

which makes it if ( array_key_exists( $contextHash, $this->versionHash ) ) {

 

it works.

 

but I shoulden do that read comment bellow from another user on gerrit.

 

 

This patch can't possibly fix anything. This method calculates the version hash of a javascript module. To avoid re-computation, it saves the hash after generating it the first time. By removing this "!", it will never compute the version and always returns "null".

"null" is not a valid version and would never change, and this code will never update once deployed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...