I'm trying to use the PHPMoney library, wrapped in my own class called Money. The main application does not use namespaces and I have no desire to. I've placed the src files for PHPMoney in a folder, and am trying to include them in a way that their money
class doesn't interfere with my money
class, and without modifying any of their code. I'm not using composer.
I'm trying this:
require __APP_PATH_VAR.'MoneyPHP/Money.php';
require __APP_PATH_VAR.'MoneyPHP/Currency.php';
use Money\Currency;
use Money\Money;
// Create my own wrapper class called Money
class Money {
protected $oPHPMoney;
public function __construct($Amount,$Currency='USD'){
$this->oPHPMoney =new Money\Money($Amount, new Currency($Currency));
}
}
Which tells me I Cannot declare class Money because the name is already in use
.
How do I include their library without it interfering with my global namespace classes?