Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DoctrineBundle] made the ORM integration of DoctrineBundle usable
- Loading branch information
Showing
14 changed files
with
654 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Symfony/Framework/DoctrineBundle/Command/ClearCacheDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputArgument; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Output\Output; | ||
use Symfony\Framework\WebBundle\Util\Filesystem; | ||
use Doctrine\Common\Cli\Configuration; | ||
use Doctrine\Common\Cli\CliController as DoctrineCliController; | ||
|
||
/* | ||
* This file is part of the symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Manage the cache clearing of the Doctrine ORM. | ||
* | ||
* @package symfony | ||
* @subpackage console | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class ClearCacheDoctrineCommand extends DoctrineCommand | ||
{ | ||
/** | ||
* @see Command | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('doctrine:clear-cache') | ||
->setDescription('Clear cache from configured query, result and metadata drivers.') | ||
->setAliases(array('doctrine:cc')) | ||
->addOption('query', null, null, 'Clear the query cache.') | ||
->addOption('metadata', null, null, 'Clear the metadata cache.') | ||
->addOption('result', null, null, 'Clear the result cache.') | ||
->addOption('id', null, null, 'Clear a cache entry by its id.') | ||
->addOption('regex', null, null, 'Clear cache entries that match a regular expression.') | ||
->addOption('prefix', null, null, 'Clear cache entries that match a prefix.') | ||
->addOption('suffix', null, null, 'Clear cache entries that match a suffix.') | ||
; | ||
} | ||
|
||
/** | ||
* @see Command | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$options = $this->buildDoctrineCliTaskOptions($input, array( | ||
'query', 'metadata', 'result', 'id', 'regex', 'prefix', 'suffix' | ||
)); | ||
$this->runDoctrineCliTask('orm:clear-cache', $options); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/Symfony/Framework/DoctrineBundle/Command/ConvertMappingDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputArgument; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Output\Output; | ||
use Symfony\Framework\WebBundle\Util\Filesystem; | ||
use Doctrine\Common\Cli\Configuration; | ||
use Doctrine\Common\Cli\CliController as DoctrineCliController; | ||
|
||
/* | ||
* This file is part of the symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Convert Doctrine ORM metadata mapping information between the various supported | ||
* formats. | ||
* | ||
* @package symfony | ||
* @subpackage console | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class ConvertMappingDoctrineCommand extends DoctrineCommand | ||
{ | ||
/** | ||
* @see Command | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('doctrine:convert-mapping') | ||
->setDescription('Convert mapping information between supported formats.') | ||
->addOption('from', null, null, 'The source to convert from.') | ||
->addOption('to', null, null, 'The type of mapping to convert to.') | ||
->addOption('dest', null, null, 'Where to output the converted source.') | ||
; | ||
} | ||
|
||
/** | ||
* @see Command | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$options = $this->buildDoctrineCliTaskOptions($input, array( | ||
'from', 'to', 'dest' | ||
)); | ||
$this->runDoctrineCliTask('orm:convert-mapping', $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/Symfony/Framework/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputArgument; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Output\Output; | ||
use Symfony\Framework\WebBundle\Util\Filesystem; | ||
use Doctrine\Common\Cli\Configuration; | ||
use Doctrine\Common\Cli\CliController as DoctrineCliController; | ||
|
||
/* | ||
* This file is part of the symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Ensure the Doctrine ORM is configured properly for a production environment. | ||
* | ||
* @package symfony | ||
* @subpackage console | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class EnsureProductionSettingsDoctrineCommand extends DoctrineCommand | ||
{ | ||
/** | ||
* @see Command | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('doctrine:ensure-production-settings') | ||
->setDescription('Verify that Doctrine is properly configured for a production environment.') | ||
; | ||
} | ||
|
||
/** | ||
* @see Command | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$this->runDoctrineCliTask('orm:ensure-production-settings'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.