Skip to content

Commit 29977d9

Browse files
committed
Merge branch 'master' of github.com:StoreFactory/ZohoSubscriptionBundle
# Conflicts: # .gitignore
2 parents f2ec41a + 6dd288f commit 29977d9

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

CompilerPass/DynmaicServiceCacheCompilerPass.php renamed to CompilerPass/DynamicServiceCacheCompilerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class DynamicServiceCacheCompilerPass implements CompilerPassInterface
1919
*/
2020
public function process(ContainerBuilder $container)
2121
{
22-
if ($container->getParameter('my_poseo.api.cache_service_id') !== null) {
22+
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: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace StoreFactory\ZohoSubscriptionBundle\Manager;
3+
namespace StoreFactory\ZohoSubscriptionBundle\DependencyInjection;
44

55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
@@ -28,20 +28,17 @@ public function getConfigTreeBuilder()
2828
->isRequired()
2929
->info('The service is not free. You must provide an API Key which can be found on : https://www.zoho.com/subscriptions/')
3030
->end()
31-
->scalarNode('organisation_id')
31+
->scalarNode('organization_id')
3232
->isRequired()
3333
->info('Organization ID from Zoho Subscription')
3434
->end()
3535
->end()
36-
->childrenNode('cache')
36+
->end()
37+
->arrayNode('cache')
3738
->children()
38-
->booleanNode('enabled')
39-
->info('If cache is active or not')
40-
->defaultValue(false)
41-
->end()
4239
->scalarNode('service')
4340
->info('Defines the service id of the cache that will be used')
44-
->defaultValue(null)
41+
->defaultValue('zoho.array.cache')
4542
->end()
4643
->integerNode('ttl')
4744
->info('Defines the TTL of the cache')

DependencyInjection/ZohoSubscriptionExtension.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace StoreFactory\ZohoSubscriptionBundle\Manager;
3+
namespace StoreFactory\ZohoSubscriptionBundle\DependencyInjection;
44

55
use Symfony\Component\Config\FileLocator;
66
use Symfony\Component\DependencyInjection\Loader;
@@ -12,7 +12,7 @@
1212
*
1313
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
1414
*/
15-
class MyPoseoExtension extends Extension
15+
class ZohoSubscriptionExtension extends Extension
1616
{
1717
/**
1818
* {@inheritDoc}
@@ -26,9 +26,8 @@ public function load(array $configs, ContainerBuilder $container)
2626
$loader->load('services.xml');
2727

2828
$container->setParameter('zoho_subscription.api_key', $config['api']['key']);
29-
$container->setParameter('zoho_subscription.org_id', $config['api']['organisation_id']);
29+
$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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
<service id="zoho.api.manager" class="Zoho\Subscription\Client\Client" abstract="true">
88
<argument>%zoho_subscription.api_key%</argument>
99
<argument>%zoho_subscription.org_id%</argument>
10-
<argument>%zoho_cache_enabled%</argument>
11-
<argument />
10+
<argument>null</argument>
1211
<argument>%zoho_subscription.cache.ttl%</argument>
1312
</service>
1413

1514
<service id="zoho.api.addon" class="Zoho\Subscription\Api\Addon" parent="zoho.api.manager"></service>
1615
<service id="zoho.api.plan" class="Zoho\Subscription\Api\Plan" parent="zoho.api.manager"></service>
16+
<service id="zoho.api.invoice" class="Zoho\Subscription\Api\Invoice" parent="zoho.api.manager"></service>
17+
<service id="zoho.api.customer" class="Zoho\Subscription\Api\Customer" parent="zoho.api.manager"></service>
18+
<service id="zoho.api.subscription" class="Zoho\Subscription\Api\Subscription" parent="zoho.api.manager"></service>
19+
20+
<service id="zoho.array.cache" class="Doctrine\Common\Cache\ArrayCache"></service>
1721

1822

1923
</services>

ZohoSubscriptionBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @author Tristan Bessoussa <tristan.bessoussa@gmail.com>
88
*/
99

10+
namespace StoreFactory\ZohoSubscriptionBundle;
11+
1012
use Symfony\Component\DependencyInjection\ContainerBuilder;
1113
use Symfony\Component\HttpKernel\Bundle\Bundle;
1214

0 commit comments

Comments
 (0)