Jump to content

Recommended Posts

Posted

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.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...