Skip to content

Commit 98fbcc4

Browse files
committed
Merge pull request #1 from StoreFactory/feature/fixed-bundle-structure
Fixed bundle structure and namespace
2 parents 9fbc99d + cd78ce0 commit 98fbcc4

File tree

10 files changed

+114
-11
lines changed

10 files changed

+114
-11
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Cache and logs (Symfony2)
2+
/app/cache/*
3+
/app/logs/*
4+
!app/cache/.gitkeep
5+
!app/logs/.gitkeep
6+
7+
# Cache and logs (Symfony3)
8+
/var/cache/*
9+
/var/logs/*
10+
!var/cache/.gitkeep
11+
!var/logs/.gitkeep
12+
13+
# Parameters
14+
/app/config/parameters.yml
15+
/app/config/parameters.ini
16+
17+
# Managed by Composer
18+
/app/bootstrap.php.cache
19+
/var/bootstrap.php.cache
20+
/bin/*
21+
!bin/console
22+
!bin/symfony_requirements
23+
/vendor/
24+
25+
# Assets and user uploads
26+
/web/bundles/
27+
/web/uploads/
28+
29+
# PHPUnit
30+
/app/phpunit.xml
31+
/phpunit.xml
32+
33+
# Composer PHAR
34+
/composer.phar
35+
36+
.idea
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace StoreFactory\ZohoSubscriptionBundle\Manager;
4+
5+
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6+
use Symfony\Component\Config\Definition\ConfigurationInterface;
7+
8+
/**
9+
* This is the class that validates and merges configuration from your app/config files
10+
*
11+
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12+
*/
13+
class Configuration implements ConfigurationInterface
14+
{
15+
/**
16+
* {@inheritDoc}
17+
*/
18+
public function getConfigTreeBuilder()
19+
{
20+
$treeBuilder = new TreeBuilder();
21+
$rootNode = $treeBuilder->root('zoho_subscription');
22+
23+
return $treeBuilder;
24+
}
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace StoreFactory\ZohoSubscriptionBundle\Manager;
4+
5+
use Symfony\Component\Config\FileLocator;
6+
use Symfony\Component\DependencyInjection\Loader;
7+
use Symfony\Component\DependencyInjection\ContainerBuilder;
8+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9+
10+
/**
11+
* This is the class that loads and manages your bundle configuration
12+
*
13+
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
14+
*/
15+
class MyPoseoExtension extends Extension
16+
{
17+
/**
18+
* {@inheritDoc}
19+
*/
20+
public function load(array $configs, ContainerBuilder $container)
21+
{
22+
$configuration = new Configuration();
23+
$config = $this->processConfiguration($configuration, $configs);
24+
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
25+
26+
}
27+
}

Manager/AddonManager.php

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

3-
namespace AppBundle\Manager;
3+
namespace ZohoSubscriptionBundle\Manager;
44

55
use GuzzleHttp\Client;
66
use GuzzleHttp\Psr7\Response;
@@ -16,9 +16,9 @@ class AddonManager extends DefaultManager
1616
*/
1717
public function listAllAddons($type = null)
1818
{
19-
// Si le cache est présent et actif
19+
// Si le cache est présent et actif
2020
if ($this->redis && true === $this->cache) {
21-
// Si les résultats sont déjà dans le cache
21+
// Si les r�sultats sont d�j� dans le cache
2222
if ($this->redis->exists('addons')) {
2323
return unserialize($this->redis->get('addons'));
2424
} else {

Manager/DefaultManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

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

55
class DefaultManager
66
{

Manager/PlanManager.php

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

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

55
use AppBundle\ZohoSubscription\Addon\AddonApi;
66
use AppBundle\ZohoSubscription\Plan\PlanApi;
@@ -16,9 +16,9 @@ class PlanManager extends DefaultManager
1616
*/
1717
public function listAllPlans()
1818
{
19-
// Si le cache est présent et actif
19+
// Si le cache est pr�sent et actif
2020
if ($this->redis && true === $this->cache) {
21-
// Si les résultats sont déjà dans le cache
21+
// Si les r�sultats sont d�j� dans le cache
2222
if ($this->redis->exists('plans')) {
2323
return unserialize($this->redis->get('plans'));
2424
} else {

Manager/ZohoSubscriptionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

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

55
use AddonApi;
66
use PlanApi;

Resources/config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
55
<services>
6-
<service id="zoho.subscription_manager" class="ZohoSubscriptionBundle\Manager\ZohoSubscriptionManager">
6+
<service id="zoho.subscription_manager" class="StoreFactory\ZohoSubscriptionBundle\Manager\ZohoSubscriptionManager">
77
<argument type="service" id="zoho_subscription.plan"></argument>
88
<argument type="service" id="zoho_subscription.addon"></argument>
99
<argument type="service" id="snc_redis.default"></argument>

ZohoSubscriptionBundle.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
4+
/**
5+
* ZohoSubscriptionBundle
6+
*
7+
* @author Tristan Bessoussa <tristan.bessoussa@gmail.com>
8+
*/
9+
10+
use Symfony\Component\HttpKernel\Bundle\Bundle;
11+
12+
class ZohoSubscriptionBundle extends Bundle
13+
{
14+
15+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "storefactory/zoho-subscription-bundle",
3-
"type": "bundle",
3+
"type": "symfony-bundle",
44
"autoload": {
55
"psr-4": {
6-
"ZohoSubscriptionBundle": "/"
6+
"StoreFactory\\ZohoSubscriptionBundle\\": ""
77
}
88
},
99
"description": "Zoho Subscription Bundle uses the zoho-subscription-api PHP client library",

0 commit comments

Comments
 (0)