Skip to content

Commit

Permalink
Merge branch 'feature/async' into release/v1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
steverobbins committed Nov 24, 2015
2 parents a26abde + 204095b commit 2cae4ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ Get the version of a Magento installation

Show all modules that we tried to detect, not just those that were found

### `selfupdate`
### `self-update`

$ magescan.phar selfupdate
$ magescan.phar self-update

Updates the phar file to the latest version.

Expand Down
16 changes: 8 additions & 8 deletions src/MageScan/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SelfUpdateCommand extends Command
protected function configure()
{
$this
->setName('selfupdate')
->setName('self-update')
->setDescription('Updates magescan.phar to the latest version')
->setHelp(<<<EOT
The <info>selfupdate</info> command checks the homepage for newer
Expand Down Expand Up @@ -158,12 +158,12 @@ protected function testPharValidity($file)
*/
protected function checkLatestVersion()
{
$request = new Request;
$response = $request->fetch(self::URL_VERSION);
if ($response->code !== 200) {
$request = new Request(self::URL_VERSION);
$response = $request->get();
if ($response->getStatusCode() !== 200) {
throw new \Exception('Error fetching latest version');
}
return trim($response->body);
return trim($response->getBody()->getContents());
}

/**
Expand All @@ -175,8 +175,8 @@ protected function checkLatestVersion()
*/
protected function downloadLatestVersion($filename)
{
$request = new Request;
$response = $request->fetch(self::URL_DOWNLOAD);
return file_put_contents($filename, $response->body) !== false;
$request = new Request(self::URL_DOWNLOAD);
$response = $request->get();
return file_put_contents($filename, $response->getBody()->getContents()) !== false;
}
}
2 changes: 1 addition & 1 deletion src/MageScan/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function checkCatalog()
'<a href="' . $this->url. 'catalog/seo_sitemap/category" target="_blank">Categories</a>',
$categoryCount !== false ? $categoryCount : 'Unknown'
];
$productCount = $catalog->productCount($this->url);
$productCount = $catalog->productCount();
$rows[] = [
'<a href="' . $this->url . 'catalog/seo_sitemap/product" target="_blank">Products</a>',
$productCount !== false ? $productCount : 'Unknown'
Expand Down
4 changes: 2 additions & 2 deletions src/MageScan/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class Request
/**
* The base URL of the Magento application
*
* @var string
* @var string|boolean
*/
protected $url;

/**
* Client cache
*
* @var GuzzleHttp\Client
* @var Client
*/
protected $client;

Expand Down

0 comments on commit 2cae4ad

Please sign in to comment.