Skip to content

Commit 9ca46ce

Browse files
Updated cache handling with Doctrine/ArrayCache as default
1 parent 0b95757 commit 9ca46ce

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

CompilerPass/DynamicServiceCacheCompilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function process(ContainerBuilder $container)
2222
if ($container->getParameter('zoho_subscription.cache.service') !== null) {
2323
$container
2424
->getDefinition('zoho.api.manager')
25-
->addArgument(new Reference($container->getParameter('zoho_subscription.cache.service')))
25+
->replaceArgument(2, new Reference($container->getParameter('zoho_subscription.cache.service')))
2626
;
2727
}
2828
}

DependencyInjection/Configuration.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@ public function getConfigTreeBuilder()
3636
->end()
3737
->arrayNode('cache')
3838
->children()
39-
->booleanNode('enabled')
40-
->info('If cache is active or not')
41-
->defaultValue(false)
42-
->end()
4339
->scalarNode('service')
4440
->info('Defines the service id of the cache that will be used')
45-
->defaultValue(null)
41+
->defaultValue('zoho.array.cache')
4642
->end()
4743
->integerNode('ttl')
4844
->info('Defines the TTL of the cache')

DependencyInjection/ZohoSubscriptionExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function load(array $configs, ContainerBuilder $container)
2828
$container->setParameter('zoho_subscription.api_key', $config['api']['key']);
2929
$container->setParameter('zoho_subscription.org_id', $config['api']['organization_id']);
3030
$container->setParameter('zoho_subscription.cache.service', $config['cache']['service']);
31-
$container->setParameter('zoho_subscription.cache.enabled', $config['cache']['enabled']);
3231
$container->setParameter('zoho_subscription.cache.ttl', $config['cache']['ttl']);
3332
}
3433
}

Resources/config/services.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
<argument>%zoho_subscription.api_key%</argument>
99
<argument>%zoho_subscription.org_id%</argument>
1010
<argument>%zoho_subscription.cache.enabled%</argument>
11-
<argument></argument>
11+
<argument>null</argument>
1212
<argument>%zoho_subscription.cache.ttl%</argument>
1313
</service>
1414

1515
<service id="zoho.api.addon" class="Zoho\Subscription\Api\Addon" parent="zoho.api.manager"></service>
1616
<service id="zoho.api.plan" class="Zoho\Subscription\Api\Plan" parent="zoho.api.manager"></service>
1717

18+
<service id="zoho.array.cache" class="Doctrine\Common\Cache\ArrayCache"></service>
19+
1820

1921
</services>
2022
</container>

0 commit comments

Comments
 (0)