@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:disable"); |
| 22 | 22 | $this->setDescription("Disable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:disable $cacheType"; |
@@ -9,13 +9,13 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @var string |
| 11 | 11 | */ |
| 12 | - protected $_apiUrl = "https://api.magestead.com/v1/usage"; |
|
| 12 | + protected $_apiUrl="https://api.magestead.com/v1/usage"; |
|
| 13 | 13 | // protected $_apiUrl = "http://magestead-api.app/v1/usage"; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * @var array |
| 17 | 17 | */ |
| 18 | - protected $_params = []; |
|
| 18 | + protected $_params=[]; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * UsageApi constructor. |
@@ -23,16 +23,16 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct($data) |
| 25 | 25 | { |
| 26 | - $this->_params['os_type'] = urlencode($data['os']); |
|
| 27 | - $this->_params['server_type'] = urlencode($data['server']); |
|
| 28 | - $this->_params['php_version'] = urlencode($data['phpver']); |
|
| 29 | - $this->_params['application_version'] = urlencode($data['app']); |
|
| 30 | - $this->_params['vm_memory_limit'] = urlencode($data['memory_limit']); |
|
| 31 | - $this->_params['vm_cpu_count'] = urlencode($data['cpus']); |
|
| 32 | - $this->_params['ip_address'] = urlencode($data['ip_address']); |
|
| 33 | - $this->_params['box'] = urlencode($data['box']); |
|
| 34 | - $this->_params['locale'] = urlencode($data['locale']); |
|
| 35 | - $this->_params['default_currency'] = urlencode($data['default_currency']); |
|
| 26 | + $this->_params['os_type']=urlencode($data['os']); |
|
| 27 | + $this->_params['server_type']=urlencode($data['server']); |
|
| 28 | + $this->_params['php_version']=urlencode($data['phpver']); |
|
| 29 | + $this->_params['application_version']=urlencode($data['app']); |
|
| 30 | + $this->_params['vm_memory_limit']=urlencode($data['memory_limit']); |
|
| 31 | + $this->_params['vm_cpu_count']=urlencode($data['cpus']); |
|
| 32 | + $this->_params['ip_address']=urlencode($data['ip_address']); |
|
| 33 | + $this->_params['box']=urlencode($data['box']); |
|
| 34 | + $this->_params['locale']=urlencode($data['locale']); |
|
| 35 | + $this->_params['default_currency']=urlencode($data['default_currency']); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -40,16 +40,16 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function send() |
| 42 | 42 | { |
| 43 | - $fields_string = $this->getFieldsString(); |
|
| 43 | + $fields_string=$this->getFieldsString(); |
|
| 44 | 44 | |
| 45 | - $ch = curl_init(); |
|
| 45 | + $ch=curl_init(); |
|
| 46 | 46 | |
| 47 | - curl_setopt($ch,CURLOPT_URL, $this->_apiUrl); |
|
| 48 | - curl_setopt($ch,CURLOPT_POST, count($this->_params)); |
|
| 49 | - curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); |
|
| 47 | + curl_setopt($ch, CURLOPT_URL, $this->_apiUrl); |
|
| 48 | + curl_setopt($ch, CURLOPT_POST, count($this->_params)); |
|
| 49 | + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); |
|
| 50 | 50 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 51 | 51 | |
| 52 | - $result = curl_exec($ch); |
|
| 52 | + $result=curl_exec($ch); |
|
| 53 | 53 | |
| 54 | 54 | curl_close($ch); |
| 55 | 55 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function getFieldsString() |
| 62 | 62 | { |
| 63 | - $fields_string = ''; |
|
| 63 | + $fields_string=''; |
|
| 64 | 64 | foreach ($this->_params as $key => $value) { |
| 65 | - $fields_string .= $key . '=' . $value . '&'; |
|
| 65 | + $fields_string.=$key.'='.$value.'&'; |
|
| 66 | 66 | } |
| 67 | 67 | rtrim($fields_string, '&'); |
| 68 | 68 | return $fields_string; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:disable"); |
| 22 | 22 | $this->setDescription("Disable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:disable $cacheType"; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:disable"); |
| 22 | 22 | $this->setDescription("Disable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:disable $cacheType"; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:disable"); |
| 22 | 22 | $this->setDescription("Disable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:disable $cacheType"; |