-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding supee-7405, version check by controller for 2.*
- Loading branch information
1 parent
c57d1c7
commit 658c981
Showing
4 changed files
with
58 additions
and
1 deletion.
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
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 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* Mage Scan | ||
* | ||
* PHP version 5 | ||
* | ||
* @category MageScan | ||
* @package MageScan | ||
* @author Steve Robbins <[email protected]> | ||
* @copyright 2015 Steve Robbins | ||
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0 | ||
* @link https://github.com/steverobbins/magescan | ||
*/ | ||
|
||
namespace MageScan\Check\Version; | ||
|
||
use MageScan\Check\AbstractCheck; | ||
use MageScan\Check\Version; | ||
use Mvi\Check; | ||
|
||
/** | ||
* Magento 2 has a controller that tells you the version | ||
* | ||
* @category MageScan | ||
* @package MageScan | ||
* @author Steve Robbins <[email protected]> | ||
* @copyright 2015 Steve Robbins | ||
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0 | ||
* @link https://github.com/steverobbins/magescan | ||
*/ | ||
class VersionController extends AbstractCheck | ||
{ | ||
/** | ||
* Check for version controller | ||
* | ||
* @return array|boolean | ||
*/ | ||
public function getInfo() | ||
{ | ||
$response = $this->getRequest()->get('magento_version'); | ||
if ($response->getStatusCode() == 200) { | ||
preg_match("/Magento\/([0-9]\.[0-9\.]+) \(([a-zA-Z]+)\)/", $response->getBody(), $matches); | ||
if (isset($matches[1]) && isset($matches[2])) { | ||
$edition = $matches[2]; | ||
$version = $matches[1]; | ||
// An early versions of EE 2.0 would say it's 1.0 | ||
if ($edition == 'Enterprise' && $version == '1.0') { | ||
$version = '2.0'; | ||
} | ||
return [$edition, $version]; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
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