Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OC\Server::getMemCacheFactory #40150

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/integration/features/bootstrap/RemoteContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*
*/
use Behat\Behat\Context\Context;
use OCP\ICacheFactory;
use PHPUnit\Framework\Assert;

require __DIR__ . '/../../vendor/autoload.php';
Expand Down Expand Up @@ -66,7 +67,7 @@ public function selectRemoteInstance($remoteServer) {
}
$this->lastException = null;
try {
$this->remoteInstance = new \OC\Remote\Instance($baseUri, \OC::$server->getMemCacheFactory()->createLocal(), \OC::$server->getHTTPClientService());
$this->remoteInstance = new \OC\Remote\Instance($baseUri, \OC::$server->get(ICacheFactory::class)->createLocal(), \OC::$server->getHTTPClientService());
// trigger the status request
$this->remoteInstance->getProtocol();
} catch (\Exception $e) {
Expand Down
4 changes: 3 additions & 1 deletion core/register_command.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

use OCP\ICacheFactory;
use Psr\Log\LoggerInterface;

$application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
Expand Down Expand Up @@ -167,7 +169,7 @@
$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->get(ICacheFactory::class)));

$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->get(LoggerInterface::class), \OC::$server->query(\OC\Installer::class)));
$application->add(new OC\Core\Command\Maintenance\Repair(
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Files/ObjectStore/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use OCP\Files\NotFoundException;
use OCP\Files\ObjectStore\IObjectStore;
use OCP\Files\StorageAuthException;
use OCP\ICacheFactory;
use Psr\Log\LoggerInterface;

const SWIFT_SEGMENT_SIZE = 1073741824; // 1GB
Expand All @@ -47,7 +48,7 @@ class Swift implements IObjectStore {

public function __construct($params, SwiftFactory $connectionFactory = null) {
$this->swiftFactory = $connectionFactory ?: new SwiftFactory(
\OC::$server->getMemCacheFactory()->createDistributed('swift::'),
\OC::$server->get(ICacheFactory::class)->createDistributed('swift::'),
$params,
\OC::$server->get(LoggerInterface::class)
);
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Collaboration\Resources\IManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\ICacheFactory;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
use OC\DB\Connection;
Expand Down Expand Up @@ -192,7 +193,7 @@ public static function getRepairSteps(): array {
new FixMountStorages(\OC::$server->getDatabaseConnection()),
new UpdateLanguageCodes(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
new AddLogRotateJob(\OC::$server->getJobList()),
new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OCP\Server::get(JSCombiner::class)),
new ClearFrontendCaches(\OC::$server->get(ICacheFactory::class), \OCP\Server::get(JSCombiner::class)),
\OCP\Server::get(ClearGeneratedAvatarCache::class),
new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()),
new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OC\AppConfig;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IAppConfig;
use OCP\ICacheFactory;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -559,7 +560,7 @@ private function registerAppConfig(AppConfig $appConfig) {
\OC::$server->getConfig(),
$appConfig,
\OC::$server->getGroupManager(),
\OC::$server->getMemCacheFactory(),
\OC::$server->get(ICacheFactory::class),
\OC::$server->get(IEventDispatcher::class),
\OC::$server->get(LoggerInterface::class)
));
Expand Down
Loading