Skip to content

Commit

Permalink
Merge pull request #40349 from nextcloud/fix/noid/autoloader-no-apcu
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Sep 8, 2023
2 parents e21f1a9 + 603a659 commit 2078109
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ class OC {

public static string $configDir;

public static int $VERSION_MTIME = 0;

/**
* requested app
*/
Expand Down Expand Up @@ -610,10 +608,9 @@ public static function init(): void {

self::$CLI = (php_sapi_name() == 'cli');

// Add default composer PSR-4 autoloader
// Add default composer PSR-4 autoloader, ensure apcu to be disabled
self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php';
OC::$VERSION_MTIME = filemtime(OC::$SERVERROOT . '/version.php');
self::$composerAutoloader->setApcuPrefix('composer_autoload_' . md5(OC::$SERVERROOT . '_' . OC::$VERSION_MTIME));
self::$composerAutoloader->setApcuPrefix(null);

try {
self::initPaths();
Expand Down
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ private static function loadVersion() {
return;
}

$timestamp = filemtime(OC::$SERVERROOT . '/version.php');
require OC::$SERVERROOT . '/version.php';
/** @var int $timestamp */
self::$versionCache['OC_Version_Timestamp'] = \OC::$VERSION_MTIME;
self::$versionCache['OC_Version_Timestamp'] = $timestamp;
/** @var string $OC_Version */
self::$versionCache['OC_Version'] = $OC_Version;
/** @var string $OC_VersionString */
Expand Down

0 comments on commit 2078109

Please sign in to comment.