Skip to content

Commit b4f4913

Browse files
committed
Removed site argument from aimeos:clear command
1 parent b685099 commit b4f4913

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/Aimeos/Shop/Command/ClearCommand.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class ClearCommand extends AbstractCommand
2323
*
2424
* @var string
2525
*/
26-
protected $signature = 'aimeos:clear
27-
{site? : Site codes to clear the Aimeos content cache for like "default unittest" (none for all)}
28-
';
26+
protected $signature = 'aimeos:clear';
2927

3028
/**
3129
* The console command description.
@@ -42,19 +40,11 @@ class ClearCommand extends AbstractCommand
4240
*/
4341
public function handle()
4442
{
43+
$this->info( 'Clearing Aimeos cache', 'v' );
44+
4545
$context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false, 'command' );
4646
$context->setEditor( 'aimeos:clear' );
4747

48-
$fcn = function( \Aimeos\MShop\Context\Item\Iface $lcontext )
49-
{
50-
$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
51-
$lcontext->setCache( $cache );
52-
53-
$this->info( sprintf( 'Clearing Aimeos cache for site "%1$s"', $lcontext->getLocale()->getSiteItem()->getCode() ), 'v' );
54-
55-
\Aimeos\MAdmin::create( $lcontext, 'cache' )->getCache()->clear();
56-
};
57-
58-
$this->exec( $context, $fcn, $this->argument( 'site' ) );
48+
\Aimeos\MAdmin::create( $context, 'cache' )->getCache()->clear();
5949
}
6050
}

tests/Command/ClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ class ClearCommandTest extends AimeosTestAbstract
44
{
55
public function testSetupCommand()
66
{
7-
$this->assertEquals( 0, $this->artisan( 'aimeos:clear', array( 'site' => 'unittest' ) ) );
7+
$this->assertEquals( 0, $this->artisan( 'aimeos:clear' ) );
88
}
99
}

0 commit comments

Comments
 (0)