vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/DependencyInjection/Configuration.php
author ymh <ymh.work@gmail.com>
Fri, 25 Nov 2011 18:55:43 +0100
changeset 39 03b14b0fe101
permissions -rw-r--r--
Documentation and add alternative wp url and label + migrations
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace Symfony\Bundle\DoctrineMigrationsBundle\DependencyInjection;
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
/**
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * DoctrineMigrationsExtension configuration structure.
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 *
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 * @author Lukas Kahwe Smith <smith@pooteeweet.org>
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 */
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
class Configuration
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
{
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    /**
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
     * Generates the configuration tree.
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
     *
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
     * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
     */
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    public function getConfigTree()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    {
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
        $treeBuilder = new TreeBuilder();
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
        $rootNode = $treeBuilder->root('doctrine_migrations', 'array');
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
        $rootNode
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
            ->children()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
                ->scalarNode('dir_name')->defaultValue('%kernel.root_dir%/DoctrineMigrations')->cannotBeEmpty()->end()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
                ->scalarNode('namespace')->defaultValue('Application\Migrations')->cannotBeEmpty()->end()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
                ->scalarNode('table_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
                ->scalarNode('name')->defaultValue('Application Migrations')->end()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
            ->end()
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
        ;
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
        return $treeBuilder->buildTree();
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    }
03b14b0fe101 Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
}