Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: laminas/laminas-cache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.10.1
Choose a base ref
...
head repository: laminas/laminas-cache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.11.0
Choose a head ref

Commits on Jan 16, 2023

  1. Lock file maintenance

    Signed-off-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] committed Jan 16, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    71dff62 View commit details

Commits on Mar 31, 2023

  1. Merge pull request #260 from laminas/3.10.x-merge-up-into-3.11.x_fc4A…

    …kjor
    
    Merge release 3.10.1 into 3.11.x
    boesing authored Mar 31, 2023
    Copy the full SHA
    970b4a9 View commit details

Commits on Jul 17, 2023

  1. qa: remove PHP 8.0 support

    We have to drop PHP 8.0 support as the minimum `laminas-servicemanager` version had to be raised due to BC break in test trait.
    
    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 17, 2023
    Copy the full SHA
    99e8293 View commit details
  2. qa: remove unused method calls

    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 17, 2023
    Copy the full SHA
    d91638e View commit details
  3. Merge pull request #264 from boesing/qa/remove-php-8.0

    Remove PHP 8.0 support
    boesing authored Jul 17, 2023
    Copy the full SHA
    1e687c0 View commit details
  4. qa: replace stella-maris/clock with psr/clock

    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 17, 2023
    Copy the full SHA
    256ec40 View commit details
  5. qa: opt-in for backward compatibility check

    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 17, 2023
    Copy the full SHA
    dc0dc32 View commit details
  6. qa: use PHP to detect current PHP version rather than parsing JOB json

    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 17, 2023
    Copy the full SHA
    5746af1 View commit details
  7. Merge pull request #263 from boesing/qa/remove-stellar-maris-requirement

    Replace `stella-maris/clock` with `psr/clock`
    boesing authored Jul 17, 2023
    Copy the full SHA
    c0b8cf6 View commit details
  8. Lock file maintenance

    Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 17, 2023
    Copy the full SHA
    4958daa View commit details

Commits on Jul 18, 2023

  1. qa: optimize some code and extend psalm configuration

    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 18, 2023
    Copy the full SHA
    e06baef View commit details
  2. Merge pull request #255 from laminas/renovate/lock-file-maintenance

    Lock file maintenance
    boesing authored Jul 18, 2023
    Copy the full SHA
    fcc91ac View commit details
  3. #197 added config for AdapterPluginManager

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    81d4af4 View commit details
  4. declare ServiceManagerConfiguration type for better psalm analyze

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    7b2fc83 View commit details
  5. import function as required by phpcodesniffer

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    cd9d819 View commit details
  6. move constant

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    0ee950b View commit details
  7. restore accidentally deleted doc

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    17e2dc1 View commit details
  8. phpcs

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 18, 2023
    Copy the full SHA
    187c903 View commit details

Commits on Jul 19, 2023

  1. create docs for adapter plugin manager

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 19, 2023
    Copy the full SHA
    f6c614c View commit details

Commits on Jul 20, 2023

  1. remove old bookdown file

    Signed-off-by: Romain Perez <romain.perez@check24.de>
    romain-perez24 committed Jul 20, 2023
    Copy the full SHA
    349027a View commit details

Commits on Jul 21, 2023

  1. Lock file maintenance

    Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] committed Jul 21, 2023
    Copy the full SHA
    57fb6b9 View commit details

Commits on Jul 26, 2023

  1. Lock file maintenance

    Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] committed Jul 26, 2023
    Copy the full SHA
    5669729 View commit details

Commits on Jul 28, 2023

  1. Lock file maintenance

    Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] committed Jul 28, 2023
    Copy the full SHA
    a57a9d7 View commit details

Commits on Jul 31, 2023

  1. docs: drop documentation for the plugin manager configuration

    Frank will provide a more detailed configuration for mezzio/MVC/non-laminas applications in the future and thus, we drop this documentation as it does not provide a benefit for endusers.
    
    Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
    boesing committed Jul 31, 2023
    Copy the full SHA
    7b93996 View commit details
  2. Merge pull request #266 from rohm1/rfc/adapter-plugin-manager-config

    Allow configuration of `AdapterPluginManager` via config file
    boesing authored Jul 31, 2023
    Copy the full SHA
    76cc49a View commit details
6 changes: 2 additions & 4 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"ignore_php_platform_requirements": {
"8.2": true
},
"extensions": [
"apcu"
],
"ini": [
"apc.enabled=1",
"apc.enable_cli=1"
]
],
"backwardCompatibilityCheck": true
}
3 changes: 1 addition & 2 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@

WORKING_DIRECTORY=$2
JOB=$3
PHP_VERSION=$(echo "${JOB}" | jq -r '.php')

PHP_VERSION=$(php -nr "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;")

if [ ! -z "$GITHUB_BASE_REF" ] && [[ "$GITHUB_BASE_REF" =~ ^[0-9]+\.[0-9] ]]; then
readarray -td. TARGET_BRANCH_VERSION_PARTS <<<"${GITHUB_BASE_REF}.";
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
"process-timeout": 600,
"sort-packages": true,
"platform": {
"php": "8.0.99"
"php": "8.1.99"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
@@ -34,14 +34,14 @@
}
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0",
"laminas/laminas-cache-storage-implementation": "1.0",
"laminas/laminas-eventmanager": "^3.4",
"laminas/laminas-servicemanager": "^3.18.0",
"laminas/laminas-servicemanager": "^3.21",
"laminas/laminas-stdlib": "^3.6",
"psr/cache": "^1.0",
"psr/simple-cache": "^1.0",
"stella-maris/clock": "^0.1.5",
"psr/clock": "^1.0",
"webmozart/assert": "^1.9"
},
"require-dev": {
@@ -61,7 +61,8 @@
"vimeo/psalm": "^5.4"
},
"conflict": {
"symfony/console": "<5.1"
"symfony/console": "<5.1",
"stella-maris/clock": "<0.1.7"
},
"provide": {
"psr/cache-implementation": "1.0",
734 changes: 320 additions & 414 deletions composer.lock

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions docs/bookdown.json

This file was deleted.

903 changes: 589 additions & 314 deletions psalm-baseline.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedPsalmSuppress="true"
findUnusedBaselineEntry="true"
findUnusedCode="true"
>
<projectFiles>
<directory name="src"/>
2 changes: 2 additions & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@

class ConfigProvider
{
public const ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY = 'storage_adapters';

/**
* Return default configuration for laminas-cache.
*
10 changes: 5 additions & 5 deletions src/Pattern/CaptureCache.php
Original file line number Diff line number Diff line change
@@ -314,14 +314,14 @@ protected function createDirectoryStructure($pathname)
// built-in mkdir function is enough

$umask = $umask !== false ? umask($umask) : false;
$res = mkdir($pathname, $perm !== false ? $perm : 0775, true);
$res = mkdir($pathname, 0775, true);

if ($umask !== false) {
umask($umask);
}

if (! $res) {
$oct = $perm === false ? '775' : decoct($perm);
$oct = '775';
$err = ErrorHandler::stop();
throw new Exception\RuntimeException("mkdir('{$pathname}', 0{$oct}, true) failed", 0, $err);
}
@@ -354,20 +354,20 @@ protected function createDirectoryStructure($pathname)

// create a single directory, set and reset umask immediately
$umask = $umask !== false ? umask($umask) : false;
$res = mkdir($path, $perm === false ? 0775 : $perm, false);
$res = mkdir($path, $perm, false);
if ($umask !== false) {
umask($umask);
}

if (! $res) {
$oct = $perm === false ? '775' : decoct($perm);
$oct = decoct($perm);
ErrorHandler::stop();
throw new Exception\RuntimeException(
"mkdir('{$path}', 0{$oct}, false) failed"
);
}

if ($perm !== false && ! chmod($path, $perm)) {
if (! chmod($path, $perm)) {
$oct = decoct($perm);
ErrorHandler::stop();
throw new Exception\RuntimeException(
2 changes: 1 addition & 1 deletion src/Psr/CacheItemPool/CacheItem.php
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
use DateTimeImmutable;
use DateTimeInterface;
use Psr\Cache\CacheItemInterface;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;

use function gettype;
use function is_int;
2 changes: 1 addition & 1 deletion src/Psr/CacheItemPool/CacheItemPoolDecorator.php
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
use Laminas\Cache\Storage\StorageInterface;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;

use function array_diff;
use function array_diff_key;
2 changes: 0 additions & 2 deletions src/Service/StorageAdapterFactory.php
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
use Webmozart\Assert\Assert;

use function assert;
use function is_array;
use function is_string;
use function sprintf;

@@ -103,7 +102,6 @@ private function assertValidPluginConfigurationStructure(string $adapter, array
{
Assert::allIsArray($plugins, 'All plugin configurations are expected to be an array.');
foreach ($plugins as $pluginConfiguration) {
assert(is_array($pluginConfiguration));
try {
$this->pluginFactory->assertValidConfigurationStructure($pluginConfiguration);
if (isset($pluginConfiguration['priority'])) {
33 changes: 32 additions & 1 deletion src/Service/StorageAdapterPluginManagerFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
<?php

declare(strict_types=1);

namespace Laminas\Cache\Service;

use Laminas\Cache\ConfigProvider;
use Laminas\Cache\Storage\AdapterPluginManager;
use Laminas\ServiceManager\ServiceManager;
use Psr\Container\ContainerInterface;

use function is_array;

/**
* @psalm-import-type ServiceManagerConfiguration from ServiceManager
*/
final class StorageAdapterPluginManagerFactory
{
public function __invoke(ContainerInterface $container): AdapterPluginManager
{
return new AdapterPluginManager($container);
$pluginManager = new AdapterPluginManager($container);

// If we do not have a config service, nothing more to do
if (! $container->has('config')) {
return $pluginManager;
}

$config = $container->get('config');

// If we do not have a configuration, nothing more to do
if (
! isset($config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY])
|| ! is_array($config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY])
) {
return $pluginManager;
}

// Wire service configuration
/** @var ServiceManagerConfiguration $config */
$config = $config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY];
$pluginManager->configure($config);

return $pluginManager;
}
}
2 changes: 1 addition & 1 deletion test/Psr/CacheItemPool/CacheItemPoolDecoratorTest.php
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Cache\CacheItemInterface;
use Psr\Clock\ClockInterface;
use stdClass;
use StellaMaris\Clock\ClockInterface;
use Throwable;

use function array_keys;
2 changes: 1 addition & 1 deletion test/Psr/CacheItemPool/CacheItemTest.php
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
use Laminas\Cache\Psr\CacheItemPool\CacheItem;
use Laminas\Cache\Psr\CacheItemPool\InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;

use function date_default_timezone_get;
use function date_default_timezone_set;
1 change: 0 additions & 1 deletion test/Psr/SimpleCache/SimpleCacheDecoratorTest.php
Original file line number Diff line number Diff line change
@@ -128,7 +128,6 @@ private function mockCapabilities(
public function setSuccessReference(SimpleCacheDecorator $cache, bool $success): void
{
$r = new ReflectionProperty($cache, 'success');
$r->setAccessible(true);
$r->setValue($cache, $success);
}

5 changes: 1 addition & 4 deletions test/Storage/Adapter/AbstractAdapterTest.php
Original file line number Diff line number Diff line change
@@ -161,8 +161,7 @@ public function testInternalTriggerPre(): void
]);

// call protected method
$method = new ReflectionMethod($storage::class, 'triggerPre');
$method->setAccessible(true);
$method = new ReflectionMethod($storage::class, 'triggerPre');
$rsCollection = $method->invoke($storage, 'setItem', $params);
self::assertInstanceOf(ResponseCollection::class, $rsCollection);

@@ -192,7 +191,6 @@ public function testInternalTriggerPost(): void

// call protected method
$method = new ReflectionMethod($storage::class, 'triggerPost');
$method->setAccessible(true);
$result = $method->invokeArgs($storage, ['setItem', $params, &$result]);

// test called event
@@ -225,7 +223,6 @@ public function testInternalTriggerExceptionThrowRuntimeException(): void

// call protected method
$method = new ReflectionMethod($storage::class, 'triggerException');
$method->setAccessible(true);

$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('test');
2 changes: 1 addition & 1 deletion test/Storage/AdapterPluginManagerTest.php
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public function testPluginAliasesResolve(string $alias, string $expected)
$this->addToAssertionCount(1);
}

protected function getPluginManager(): AdapterPluginManager
protected static function getPluginManager(): AdapterPluginManager
{
return new AdapterPluginManager(new ServiceManager());
}
2 changes: 1 addition & 1 deletion test/Storage/PluginManagerTest.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class PluginManagerTest extends TestCase
{
use CommonPluginManagerTrait;

protected function getPluginManager(): PluginManager
protected static function getPluginManager(): PluginManager
{
return new PluginManager(new ServiceManager());
}