jenkins-bot has submitted this change and it was merged. Change subject: Fix memory cache (v 5.5.0 Runtime 8) ......................................................................
Fix memory cache (v 5.5.0 Runtime 8) Now, function getBytecode() always return bytecode that never used early. Change-Id: I1fc41748b225f654adec4d79fbde82603898aab7 --- M PhpTags.php M includes/Renderer.php 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Pastakhov: Looks good to me, approved jenkins-bot: Verified diff --git a/PhpTags.php b/PhpTags.php index 4be9612..dee1ead 100644 --- a/PhpTags.php +++ b/PhpTags.php @@ -16,12 +16,12 @@ } const PHPTAGS_MAJOR_VERSION = 5; -const PHPTAGS_MINOR_VERSION = 4; +const PHPTAGS_MINOR_VERSION = 5; const PHPTAGS_RELEASE_VERSION = 0; define( 'PHPTAGS_VERSION', PHPTAGS_MAJOR_VERSION . '.' . PHPTAGS_MINOR_VERSION . '.' . PHPTAGS_RELEASE_VERSION ); const PHPTAGS_HOOK_RELEASE = 8; -const PHPTAGS_RUNTIME_RELEASE = 7; +const PHPTAGS_RUNTIME_RELEASE = 8; const PHPTAGS_JSONLOADER_RELEASE = 3; // Register this extension on Special:Version diff --git a/includes/Renderer.php b/includes/Renderer.php index 3904fca..ea71664 100644 --- a/includes/Renderer.php +++ b/includes/Renderer.php @@ -134,7 +134,7 @@ if ( true === isset( self::$bytecodeCache[$revID][$md5Source] ) ) { \wfDebugLog( 'PhpTags', 'Memory hiting with key ' . $revID ); self::$memoryHit++; - return self::$bytecodeCache[$revID][$md5Source]; + return unserialize( self::$bytecodeCache[$revID][$md5Source] ); } if ( $wgPhpTagsBytecodeExptime > 0 && $revID > 0 && false === isset( self::$bytecodeLoaded[$revID] ) ) { @@ -147,21 +147,21 @@ if ( true === isset( self::$bytecodeCache[$revID][$md5Source] ) ) { \wfDebugLog( 'PhpTags', 'Cache hiting with key ' . $revID ); self::$cacheHit++; - return self::$bytecodeCache[$revID][$md5Source]; + return unserialize( self::$bytecodeCache[$revID][$md5Source] ); } } \wfDebugLog( 'PhpTags', 'Cache missing with key ' . $revID ); } - $bytecode = Compiler::compile( $source, $frameTitleText ); + $bytecode = serialize( Compiler::compile( $source, $frameTitleText ) ); self::$bytecodeCache[$revID][$md5Source] = $bytecode; if ( $revID > 0 ) { // Don't save bytecode of unsaved pages - self::$bytecodeNeedsUpdate[$revID][$md5Source] = unserialize( serialize( $bytecode ) ); + self::$bytecodeNeedsUpdate[$revID][$md5Source] = $bytecode; } self::$compileHit++; Timer::addCompileTime( $parser ); - return $bytecode; + return unserialize( $bytecode ); } /** -- To view, visit https://gerrit.wikimedia.org/r/254371 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fc41748b225f654adec4d79fbde82603898aab7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PhpTags Gerrit-Branch: master Gerrit-Owner: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits