-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for recent php7.2 aware magento versions
- Loading branch information
Showing
6 changed files
with
23 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
Magento Composer Autoload | ||
========================= | ||
|
||
Hack to make the magento autoloader composer vendor dir aware. | ||
|
||
It's very likely you want to manage 3rd party libraries, or perhaps even Magento Extensions using composer. This can be difficult because composer uses its own class loading mechanism, typically creating a <application_root>/vendor/autoload.php file to initialise its environment. | ||
|
@@ -12,3 +11,7 @@ If you have already overridden this file, or have installed another extension th | |
For example, this extension is not compatible with [Aoe_ClassPathCache](https://github.com/fbrnc/Aoe_ClassPathCache). | ||
|
||
Any comments or questions can be directed to me on twitter [@ajbonner](http://twitter.com/ajbonner), or via email [[email protected]](mailto:[email protected]). | ||
|
||
#### Requirements | ||
- PHP 7.2+ | ||
- Magento CE 1.9.3.9+ (with PHP 7.2 Patch applied) |
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0" | ||
"php": ">=7.2.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<?php | ||
|
||
class BootstrapTest extends PHPUnit_Framework_TestCase | ||
declare(strict_types=1); | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class BootstrapTest extends TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
require_once $this->varienAutoloaderClassPath(); | ||
} | ||
|
||
public function testRequiresComposerAutoloaderWhenBasePathConstantsDefined() | ||
public function testRequiresComposerAutoloaderWhenBasePathConstantsDefined(): void | ||
{ | ||
define('BP', realpath(dirname(__FILE__) . '/../')); | ||
define('BP', realpath(__DIR__ . '/../')); | ||
$autoloader = new Varien_Autoload(); | ||
$this->assertTrue(COMPOSER_AUTOLOADER_LOADED); | ||
} | ||
|
||
public function testRequiresComposerAutoloaderWhenBasePathConstantsUndefined() | ||
public function testRequiresComposerAutoloaderWhenBasePathConstantsUndefined(): void | ||
{ | ||
$autoloader = new Varien_Autoload(); | ||
$this->assertTrue(COMPOSER_AUTOLOADER_LOADED); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function varienAutoloaderClassPath() | ||
protected function varienAutoloaderClassPath(): string | ||
{ | ||
$ds = DIRECTORY_SEPARATOR; | ||
return 'app' . $ds . 'code' . $ds . 'community' . $ds . 'Varien' . $ds . 'Autoload.php'; | ||
return implode(DIRECTORY_SEPARATOR, ['app', 'code', 'community', 'Varien', 'Autoload.php']); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<?php | ||
|
||
define('COMPOSER_AUTOLOADER_LOADED', true); | ||
// autoload.php @generated by Composer | ||
|
||
require_once __DIR__ . '/composer/autoload_real.php'; | ||
|
||
return ComposerAutoloaderInit912c46f9179f8bfb7e8293a18152dedf::getLoader(); |