This repository has been archived by the owner on Oct 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from LeaseWeb/dev
migrate from php5-memcached to php5-memcache
- Loading branch information
Showing
27 changed files
with
752 additions
and
4,556 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | ||
|
||
/** | ||
* Provides a command-line interface for viewing cache client stats | ||
* Provides a command-line interface for viewing cache pool stats | ||
* Based on Beryllium\CacheBundle by Kevin Boyd <[email protected]> | ||
*/ | ||
class StatisticsCommand extends ContainerAwareCommand | ||
|
@@ -27,7 +27,7 @@ protected function configure() | |
->setName('memcache:statistics') | ||
->setDescription('Display Memcache statistics') | ||
->setDefinition(array( | ||
new InputArgument('client', InputArgument::REQUIRED, 'The client'), | ||
new InputArgument('pool', InputArgument::REQUIRED, 'The pool'), | ||
)); | ||
} | ||
|
||
|
@@ -41,17 +41,17 @@ protected function configure() | |
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$client = $input->getArgument('client'); | ||
$pool = $input->getArgument('pool'); | ||
try { | ||
$memcache = $this->getContainer()->get('memcache.'.$client); | ||
$memcache = $this->getContainer()->get('memcache.'.$pool); | ||
$output->writeln($this->formatStats($memcache->getStats())); | ||
} catch (ServiceNotFoundException $e) { | ||
$output->writeln("<error>client '$client' is not found</error>"); | ||
$output->writeln("<error>pool '$pool' is not found</error>"); | ||
} | ||
} | ||
|
||
/** | ||
* Choose the client | ||
* Choose the pool | ||
* | ||
* @param InputInterface $input Input interface | ||
* @param OutputInterface $output Output interface | ||
|
@@ -61,20 +61,20 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
*/ | ||
protected function interact(InputInterface $input, OutputInterface $output) | ||
{ | ||
if (!$input->getArgument('client')) { | ||
$client = $this->getHelper('dialog')->askAndValidate( | ||
if (!$input->getArgument('pool')) { | ||
$pool = $this->getHelper('dialog')->askAndValidate( | ||
$output, | ||
'Please give the client:', | ||
function($client) | ||
'Please give the pool:', | ||
function($pool) | ||
{ | ||
if (empty($client)) { | ||
throw new \Exception('client can not be empty'); | ||
if (empty($pool)) { | ||
throw new \Exception('pool can not be empty'); | ||
} | ||
|
||
return $client; | ||
return $pool; | ||
} | ||
); | ||
$input->setArgument('client', $client); | ||
$input->setArgument('pool', $pool); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.