Change Knplabs to Knp. BC break before Symfony2 release.

This commit is contained in:
Matthieu Bontemps 2011-07-03 11:38:38 +02:00
parent ecac97ce67
commit 6ca918cc26
20 changed files with 52 additions and 52 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\Command;
namespace Knp\Bundle\GaufretteBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Compiler;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -15,11 +15,11 @@ class AdapterFactoryManagerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('knplabs_gaufrette.adapter_factory_manager')) {
if (!$container->hasDefinition('knp_gaufrette.adapter_factory_manager')) {
return;
}
$definition = $container->getDefinition('knplabs_gaufrette.adapter_factory_manager');
$definition = $container->getDefinition('knp_gaufrette.adapter_factory_manager');
$calls = $definition->getMethodCalls();
$definition->setMethodCalls(array());

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Compiler;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -15,11 +15,11 @@ class AdapterManagerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('knplabs_gaufrette.adapter_manager')) {
if (!$container->hasDefinition('knp_gaufrette.adapter_manager')) {
return;
}
$definition = $container->getDefinition('knplabs_gaufrette.adapter_manager');
$definition = $container->getDefinition('knp_gaufrette.adapter_manager');
$calls = $definition->getMethodCalls();
$definition->setMethodCalls(array());

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -19,7 +19,7 @@ class InMemoryAdapterFactory implements AdapterFactoryInterface
public function create(ContainerBuilder $container, $id, array $config)
{
$container
->setDefinition($id, new DefinitionDecorator('knplabs_gaufrette.adapter.in_memory'))
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.in_memory'))
->replaceArgument(0, $config['files'])
;
}

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -19,7 +19,7 @@ class LocalAdapterFactory implements AdapterFactoryInterface
public function create(ContainerBuilder $container, $id, array $config)
{
$container
->setDefinition($id, new DefinitionDecorator('knplabs_gaufrette.adapter.local'))
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.local'))
->replaceArgument(0, $config['directory'])
->replaceArgument(1, $config['create'])
;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -19,7 +19,7 @@ class SafeLocalAdapterFactory implements AdapterFactoryInterface
public function create(ContainerBuilder $container, $id, array $config)
{
$container
->setDefinition($id, new DefinitionDecorator('knplabs_gaufrette.adapter.safe_local'))
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.safe_local'))
->replaceArgument(0, $config['directory'])
->replaceArgument(1, $config['create'])
;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
@ -22,7 +22,7 @@ class FactoryConfiguration implements ConfigurationInterface
$treeBuilder = new TreeBuilder();
$treeBuilder
->root('knplabs_gaufrette')
->root('knp_gaufrette')
->ignoreExtraKeys()
->fixXmlConfig('factory', 'factories')
->children()

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\FileLocator;
@ -15,7 +15,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class KnplabsGaufretteExtension extends Extension
class KnpGaufretteExtension extends Extension
{
private $factories = null;
@ -50,7 +50,7 @@ class KnplabsGaufretteExtension extends Extension
$map[$name] = $this->createFilesystem($name, $filesystem, $container, $adapters);
}
$container->getDefinition('knplabs_gaufrette.filesystem_map')
$container->getDefinition('knp_gaufrette.filesystem_map')
->replaceArgument(0, $map);
}
@ -82,7 +82,7 @@ class KnplabsGaufretteExtension extends Extension
$id = sprintf('gaufrette.%s_filesystem', $name);
$container
->setDefinition($id, new DefinitionDecorator('knplabs_gaufrette.filesystem'))
->setDefinition($id, new DefinitionDecorator('knp_gaufrette.filesystem'))
->replaceArgument(0, new Reference($adapter))
;

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\DependencyInjection;
namespace Knp\Bundle\GaufretteBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@ -33,7 +33,7 @@ class MainConfiguration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('knplabs_gaufrette');
$rootNode = $treeBuilder->root('knp_gaufrette');
$this->addAdaptersSection($rootNode, $this->factories);
$this->addFilesystemsSection($rootNode);

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle;
namespace Knp\Bundle\GaufretteBundle;
/**
* Holds references to all declared filesystems

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle;
namespace Knp\Bundle\GaufretteBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
@ -10,6 +10,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class KnplabsGaufretteBundle extends Bundle
class KnpGaufretteBundle extends Bundle
{
}

View File

@ -20,15 +20,15 @@ As this bundle is an integration for Symfony of the [Gaufrette][gaufrette-homepa
## Download the bundle
You can download an archive of the bundle and unpack it in the `vendor/bundles/Knplabs/Bundle/GaufretteBundle` directory of your application.
You can download an archive of the bundle and unpack it in the `vendor/bundles/Knp/Bundle/GaufretteBundle` directory of your application.
If you are versioning your project with git, you had better to embed it as a submodule:
$ git submodule add https://github.com/knplabs/GaufretteBundle.git vendor/bundles/Knplabs/Bundle/GaufretteBundle
$ git submodule add https://github.com/knplabs/KnpGaufretteBundle.git vendor/bundles/Knp/Bundle/GaufretteBundle
## Add the namespace in the autoloader
If the `Knplabs` namespace is not already defined in your autoloader, you must add it:
If the `Knp` namespace is not already defined in your autoloader, you must add it:
``` php
<?php
@ -37,7 +37,7 @@ If the `Knplabs` namespace is not already defined in your autoloader, you must a
$loader->registerNamespaces(array(
'Knplabs\Bundle' => __DIR__.'/../vendor/bundles'
'Knp\Bundle' => __DIR__.'/../vendor/bundles'
// ...
@ -59,7 +59,7 @@ public function registerBundles()
// ...
new Knplabs\Bundle\GaufretteBundle\KnplabsGaufretteBundle()
new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle()
);
// ...
@ -78,7 +78,7 @@ The configuration of the Gaufrette bundle is divided into two parts: the `adapte
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
local:
@ -91,7 +91,7 @@ The defined adapters are usable to create the filesystems.
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
# ...
filesystems:
@ -111,7 +111,7 @@ You can access to all declared filesystems through the map service.
In the previous exemple, we declared a `bar` filesystem:
``` php
$container->get('knplabs_gaufrette.filesystem_map')->get('bar');
$container->get('knp_gaufrette.filesystem_map')->get('bar');
```
Returns the instance of `Gaufrette\Filesystem` for `bar`.
@ -132,7 +132,7 @@ A simple local filesystem based adapter.
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
local:
@ -153,7 +153,7 @@ Almost as simple as the **local** adapter, but it encodes key to avoid having to
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
safe_local:
@ -173,7 +173,7 @@ Allows you to use a user defined adapter service.
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
service:
@ -194,7 +194,7 @@ The `files` is an array of files where each file is a sub-array having the `cont
``` yaml
# app/config/config.yml
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
in_memory:

View File

@ -5,16 +5,16 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="knplabs_gaufrette.adapter.factory.in_memory" class="Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory\InMemoryAdapterFactory">
<service id="knp_gaufrette.adapter.factory.in_memory" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\InMemoryAdapterFactory">
<tag name="gaufrette.adapter.factory" />
</service>
<service id="knplabs_gaufrette.adapter.factory.service" class="Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory\ServiceAdapterFactory">
<service id="knp_gaufrette.adapter.factory.service" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\ServiceAdapterFactory">
<tag name="gaufrette.adapter.factory" />
</service>
<service id="knplabs_gaufrette.adapter.factory.local" class="Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory\LocalAdapterFactory">
<service id="knp_gaufrette.adapter.factory.local" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\LocalAdapterFactory">
<tag name="gaufrette.adapter.factory" />
</service>
<service id="knplabs_gaufrette.adapter.factory.safe_local" class="Knplabs\Bundle\GaufretteBundle\DependencyInjection\Factory\SafeLocalAdapterFactory">
<service id="knp_gaufrette.adapter.factory.safe_local" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\SafeLocalAdapterFactory">
<tag name="gaufrette.adapter.factory" />
</service>
</services>

View File

@ -5,21 +5,21 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="knplabs_gaufrette.filesystem" class="Gaufrette\Filesystem" abstract="true">
<service id="knp_gaufrette.filesystem" class="Gaufrette\Filesystem" abstract="true">
<argument /><!-- The Adapter -->
</service>
<service id="knplabs_gaufrette.adapter.in_memory" class="Gaufrette\Adapter\InMemory" abstract="true" public="false">
<service id="knp_gaufrette.adapter.in_memory" class="Gaufrette\Adapter\InMemory" abstract="true" public="false">
<argument /><!-- Files -->
</service>
<service id="knplabs_gaufrette.adapter.local" class="Gaufrette\Adapter\Local" abstract="true" public="false">
<service id="knp_gaufrette.adapter.local" class="Gaufrette\Adapter\Local" abstract="true" public="false">
<argument /><!-- Directory -->
<argument /><!-- Create -->
</service>
<service id="knplabs_gaufrette.adapter.safe_local" class="Gaufrette\Adapter\SafeLocal" abstract="true" public="false">
<service id="knp_gaufrette.adapter.safe_local" class="Gaufrette\Adapter\SafeLocal" abstract="true" public="false">
<argument /><!-- Directory -->
<argument /><!-- Create -->
</service>
<service id="knplabs_gaufrette.filesystem_map" class="Knplabs\Bundle\GaufretteBundle\FilesystemMap">
<service id="knp_gaufrette.filesystem_map" class="Knp\Bundle\GaufretteBundle\FilesystemMap">
<argument /> <!-- map of filesystems -->
</service>
</services>

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\Tests;
namespace Knp\Bundle\GaufretteBundle\Tests;
use Symfony\Component\HttpKernel\Util\Filesystem;

View File

@ -1,4 +1,4 @@
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
local:

View File

@ -1,7 +1,7 @@
imports:
- { resource: config.yml }
knplabs_gaufrette:
knp_gaufrette:
adapters:
foo:
in_memory: ~

View File

@ -1,6 +1,6 @@
<?php
namespace Knplabs\Bundle\GaufretteBundle\Tests;
namespace Knp\Bundle\GaufretteBundle\Tests;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
@ -15,7 +15,7 @@ class TestKernel extends Kernel
public function registerBundles()
{
return array(
new \Knplabs\Bundle\GaufretteBundle\KnplabsGaufretteBundle(),
new \Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
);
}