Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
phpmetrics/
bin/*
12 changes: 12 additions & 0 deletions magefix/src/Magefix/Magento/Adapter/Adaptable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Magefix\Magento\Adapter;

/**
* Interface Adaptable
* @package Magefix\Magento\Adapter
*/
interface Adaptable
{

}
35 changes: 35 additions & 0 deletions magefix/src/Magefix/Magento/Adapter/MageApp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Magefix\Magento\Adapter;

use Mage;
/**
* Class MageApp
* @package Magefix\Magento\Adapter
* @author Carlo Tasca <ctasca.d3@gmail.com>
*/
class MageApp
{
/**
* Loads Magento app in adapters
*
* Solves PHP Fatal error such as:
*
* Call to a member function getModelInstance() on a non-object in /vagrant/public/app/Mage.php on line 463
* when used in testing frameworks, e.g. PHPSpec
*
* @return \Mage_Core_Model_App
*/
public static function get()
{
return Mage::app();
}

/**
* Initiate Mage::app() in Adapters
*/
public static function init()
{
Mage::app();
}
}
Loading