Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Commit

Permalink
Added function for setting configuration file path.
Browse files Browse the repository at this point in the history
A few functions to make it look better with using laravel-payex.
Laravel love <3
  • Loading branch information
simenandre committed Apr 15, 2013
1 parent 92d65bb commit 3b6bfd9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion payex.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ class PayEx

static private $config;
static private $isConstructed;
static private $configFile = "config.php";

function __construct(){ PayEx::construct(); }

static function construct(){
if(!self::$isConstructed){
self::$config = new stdClass();

$config = include("config.php");
$config = include(self::$configFile);
foreach($config as $name => $value){
self::setConfig($name, $value);
}
self::$isConstructed = true;
}
}

static function setConfigFile($filepath){
self::$configFile = $filepath;
}

static function setConfig($name, $value){
self::$config->{$name} = $value;
}
Expand Down

0 comments on commit 3b6bfd9

Please sign in to comment.