Skip to content

Commit

Permalink
add new console commands
Browse files Browse the repository at this point in the history
[Closes #81]
  • Loading branch information
fprochazka committed May 27, 2017
1 parent 5ce1e1b commit aea71c4
Show file tree
Hide file tree
Showing 10 changed files with 265 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear a collection cache region.
*/
class CacheClearCollectionRegionCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new CollectionRegionCommand();
}

}
27 changes: 27 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/CacheClearEntityRegionCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\EntityRegionCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear a entity cache region.
*/
class CacheClearEntityRegionCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new EntityRegionCommand();
}

}
27 changes: 27 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/CacheClearMetadataCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear the metadata cache of the various cache drivers.
*/
class CacheClearMetadataCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new MetadataCommand();
}

}
27 changes: 27 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/CacheClearQueryCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear the query cache of the various cache drivers.
*/
class CacheClearQueryCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new QueryCommand();
}

}
27 changes: 27 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/CacheClearQueryRegionCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryRegionCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear a query cache region.
*/
class CacheClearQueryRegionCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new QueryRegionCommand();
}

}
27 changes: 27 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/CacheClearResultCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand;
use Kdyby\Doctrine\Console\OrmDelegateCommand;

/**
* Command to clear the result cache of the various cache drivers.
*/
class CacheClearResultCommand extends OrmDelegateCommand
{

protected function createCommand()
{
return new ResultCommand();
}

}
26 changes: 26 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/ImportCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Kdyby\Doctrine\Console\DbalDelegateCommand;

/**
* Loads an SQL file and executes it.
*/
class ImportCommand extends DbalDelegateCommand
{

protected function createCommand()
{
return new \Doctrine\DBAL\Tools\Console\Command\ImportCommand();
}

}
43 changes: 43 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/MappingDescribeCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Kdyby\Doctrine\Console\OrmDelegateCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class MappingDescribeCommand extends OrmDelegateCommand
{

/**
* @var \Kdyby\Doctrine\Tools\CacheCleaner
* @inject
*/
public $cacheCleaner;

public function __construct()
{
parent::__construct();
}

protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);

$this->cacheCleaner->invalidate();
}

protected function createCommand()
{
return new \Doctrine\ORM\Tools\Console\Command\MappingDescribeCommand();
}

}
23 changes: 23 additions & 0 deletions src/Kdyby/Doctrine/Console/Proxy/ReservedWordsCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008 Filip Procházka ([email protected])
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/

namespace Kdyby\Doctrine\Console\Proxy;

use Kdyby\Doctrine\Console\DbalDelegateCommand;

class ReservedWordsCommand extends DbalDelegateCommand
{

protected function createCommand()
{
return new \Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand();
}

}
17 changes: 11 additions & 6 deletions src/Kdyby/Doctrine/DI/console.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
- Doctrine\DBAL\Tools\Console\Command\ImportCommand
- Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand
- Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand
- Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearCollectionRegionCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearEntityRegionCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearMetadataCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearQueryCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearQueryRegionCommand
- Kdyby\Doctrine\Console\Proxy\CacheClearResultCommand
- Kdyby\Doctrine\Console\Proxy\ConvertMappingCommand
- Kdyby\Doctrine\Console\Proxy\GenerateEntitiesCommand
- Kdyby\Doctrine\Console\Proxy\GenerateProxiesCommand
- Kdyby\Doctrine\Console\Proxy\ImportCommand
- Kdyby\Doctrine\Console\Proxy\InfoCommand
- Kdyby\Doctrine\Console\Proxy\MappingDescribeCommand
- Kdyby\Doctrine\Console\Proxy\ReservedWordsCommand
- Kdyby\Doctrine\Console\Proxy\SchemaCreateCommand
- Kdyby\Doctrine\Console\Proxy\SchemaUpdateCommand
- Kdyby\Doctrine\Console\Proxy\SchemaDropCommand
- Kdyby\Doctrine\Console\Proxy\GenerateProxiesCommand
- Kdyby\Doctrine\Console\Proxy\ValidateSchemaCommand
- Kdyby\Doctrine\Console\Proxy\InfoCommand

0 comments on commit aea71c4

Please sign in to comment.