Skip to content

Commit

Permalink
Fix missing config in some instances
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkessler committed Jan 12, 2016
1 parent 302ed26 commit 7692e09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SalesforceConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class SalesforceConfig{

public static function get($key=null)
{
if(!self::$config){
self::$config = self::getInitialConfig();
}

if(is_null($key)){
return self::$config;
}elseif(isset(self::$config[$key])){
Expand All @@ -19,6 +23,9 @@ public static function get($key=null)

public static function set($key, $value)
{
if(!self::$config){
self::$config = self::getInitialConfig();
}
self::$config[$key] = $value;
}

Expand All @@ -29,7 +36,7 @@ public static function setAll($config)

public static function setInitialConfig($config=[])
{
if(is_null(self::$config)) {
if(!self::$config) {
self::$config = self::getInitialConfig();
if ($config && !empty($config && is_array($config))) {
self::$config = array_replace(self::$config, $config);
Expand Down

0 comments on commit 7692e09

Please sign in to comment.