Skip to content

Commit

Permalink
Set environment
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jul 1, 2015
1 parent 771eed3 commit fc6aa56
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Fortifi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

class Fortifi
{
const ENV_PROD = 'production';
const ENV_STAGE = 'stage';

public static $apiHost = 'api.fortifi.co';

protected $_apiScheme = 'http';
Expand Down Expand Up @@ -48,6 +51,22 @@ protected function __construct()
$this->_clientIp = $this->getRequestClientIp();
}

/**
* Set the environment to connect to
*
* @param string $env
*/
public static function setEnvironment($env = self::ENV_STAGE)
{
$prefix = '';
if($env === self::ENV_STAGE)
{
$prefix = 's';
}

static::$apiHost = $prefix . 'api.fortifi.co';
}

public static function getInstance(
$orgFid, $apiUser, $apiKey, $tokenStorage = null, $scheme = 'http'
)
Expand Down

0 comments on commit fc6aa56

Please sign in to comment.