aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Memcache
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #46151 from nextcloud/enh/do-not-enforce-cache-for-cliJohn Molakvoæ2024-10-291-6/+20
|\
| * feat(cache): CLI should not fail if APCu is not availableenh/do-not-enforce-cache-for-cliMichaIng2024-08-011-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | but fallback to NullCache. This can be the case if APCu is used without apc.enable_cli=1. APCu however runs within the PHP instance and hence cannot be shared between CLI and web or used as distributed cache. The CLI call can hence only create or invalidate entries for itself. For short-living CLI calls, this is theoretically a downsides regarding performance and resource usage, and Nextcloud must not have any issues using the dummy NullCache instead of an isolated freshly created and destroyed APCu instance. This partly reverts https://github.com/nextcloud/server/pull/25770. The fallback was removed, because CLI calls started to hang after https://github.com/nextcloud/server/pull/25440. The reason however was not that a cache is generally required for CLI calls, but because the previously logged warning invoked the user backend, which invoked again the caching backend, causing a loop. This commit re-adds the fallback without logging a warning, and for APCu only. For mentioned reasons, it is okay to fallback to NullCache silently. If Redis or memcached are configured but not available, then the web UI would fail as well, and it makes sense to abort and inform CLI calls as well then. The motivation is to make apc.enable_cli=1 optional, and that hence the documentation about it can be removed. We should not enforce admins to enable APCu for CLI calls, which is reasonably disabled by default. This also reduces requirements for hosting providers to support Nextcloud. Signed-off-by: MichaIng <micha@dietpi.com>
* | chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | | | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* | fix: misc code fixes around db shardingsharding-code-fixesRobin Appelman2024-09-091-2/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: delay calculating global cache prefix untill a cache is createdRobin Appelman2024-08-281-8/+37
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-252-3/+3
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | feat: add negative compare-and-delete to imemcacheRobin Appelman2024-08-205-0/+55
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | chore: remove Redis::DEFAULT_TTL constant now that it's defined in the interfaceRobin Appelman2024-08-071-1/+0
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | chore: cleanup acpu inc and decRobin Appelman2024-08-071-28/+2
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: set default TTL for APCu cache as per docsRobin Appelman2024-08-071-0/+6
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: Add SPDX headerAndy Scherzinger2024-05-2412-245/+35
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* Update LoggerWrapperCache.phpVelwark2024-04-231-1/+1
| | | | | Extra Dollar Sign caused errors in Nextcloud. Removing the Dollar Sign Solved the Problem. Signed-off-by: Velwark <levinfrerich9@gmail.com>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-022-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Refactor `OC\Server::getGetRedisFactory`Andrew Summers2024-03-151-2/+2
| | | | Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
* set a default and max ttl for redis keysRobin Appelman2024-02-231-7/+19
| | | | | | having infinite TTL can lead to leaked keys as the prefix changes with version upgrades Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: Add missing ArrayAccess template parametersCôme Chilliet2024-02-062-0/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* adjust redis compareSetTTL to use a lua scriptRobin Appelman2023-12-211-9/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* restore shared lock ttl when releasingRobin Appelman2023-12-213-2/+35
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* feat: Add factory method for in-memory cachesChristoph Wurst2023-10-111-0/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* chore: Drop unused \OC\Memcache\Factory::createLowLatencyChristoph Wurst2023-10-111-9/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix(memcache): Fix comparison of Memcache configs to classesJoas Schilling2023-08-161-7/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore: remove version check for apc extensionDaniel Kesselberg2023-08-101-4/+1
| | | | | | APC is gone since PHP 7.0. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-1/+1
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | redis: move lua scripts to class and add type hintsVarun Patil2023-05-101-20/+20
| | | | | | | | Signed-off-by: Varun Patil <varunpatil@ucla.edu>
* | redis: use atomic operations everywhereVarun Patil2023-04-161-35/+55
|/ | | | | | | | | | | | This removes a lot of acrobatics in the code and does each operation atomically using a lua script. This also reduces several round trips to the server, and the scripts are compiled and cached server-side. Notably, since all operations work only on a single key (except clear, which is broken anyway and shouldn't be used), they will continue to function and be atomic for Redis cluster. Signed-off-by: Varun Patil <varunpatil@ucla.edu>
* Fix RedisClusterGit'Fellow2023-03-221-1/+1
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Move from DEL to UNLINKGit'Fellow2023-03-221-3/+3
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* also cache backend for user in memory instead of always going to redisRobin Appelman2023-02-101-0/+54
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* composer run cs:fixCôme Chilliet2023-01-201-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Only setup redis connection if neededJulius Härtl2022-11-221-19/+27
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Correctly handle Redis::keys returning falseCôme Chilliet2022-09-291-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* memcached should not throw arbitrary exceptionsArthur Schiwon2022-06-171-24/+6
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Enable binary protocol againCarl Schwan2022-06-171-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add hit information to profilerCarl Schwan2022-05-051-0/+1
| | | | | | | This might be helpful later on for the cache ui that is worked on in https://github.com/nextcloud/profiler/pull/21 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add a built-in profiler inside NextcloudCarl Schwan2022-04-048-141/+479
| | | | | | The webui is provided by a seperate application named profiler Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Migrate from ILogger to LoggerInterface in lib/privateCôme Chilliet2022-03-241-15/+10
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalm issues in theming appCarl Schwan2022-01-261-2/+7
| | | | | | | | After this change, we are down to only one psalm warning for this app and related to the Application.php. This also make composer psam:update-baseline not silently ignore new errors. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Always call flush() as getAllKeys() is brokenCôme Chilliet2022-01-201-21/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Check style updateCarl Schwan2022-01-131-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix a few psalm issues and moved back to psalm/phar 4.18Carl Schwan2022-01-121-0/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Check if directoy is writable instead of possibly missing fileCarl Schwan2021-12-201-10/+14
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Allow to log DB, redis and LDAP requests into filesJoas Schilling2021-12-012-5/+93
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix ArrayAccess and JsonSerializable return typesCôme Chilliet2021-11-231-3/+7
| | | | | | First round of modifications for PHP 8.1 Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix in locking cache checkMichaIng2021-07-051-1/+1
| | | | | The intention obviously was to check whether $lockingCacheClass is defined, and existing class, and available. It was however checked whether the $distributedCacheClass is an existing class, which would have caused an exception already in the previous distributed cache check. Signed-off-by: MichaIng <micha@dietpi.com>
* Migrate HintException to OCPGary Kim2021-06-302-3/+3
| | | | Signed-off-by: Gary Kim <gary@garykim.dev>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-049-9/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Don't allow executing cli if cache backend is unavailableRichard Steinmetz2021-05-261-26/+6
| | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* ensure redis returns bool for hasKeyArthur Schiwon2021-04-131-1/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>