Skip to content

Commit

Permalink
Add readConfigFromFile
Browse files Browse the repository at this point in the history
Sometimes you have already a config.php file in your framework for other purposes (see salesforce-marketingcloud#153)

So I've added a readConfigFromFile (default true, to keep it backward compatible)
Now you can control if the config file should be used, or overwrite all params with the $params argument
  • Loading branch information
aalwash authored Feb 13, 2020
1 parent 27895de commit 1b61615
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ET_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ class ET_Client extends SoapClient
* <i><b>proxyusername</b></i> - proxy server user name</br>
* <i><b>proxypassword</b></i> - proxy server password</br>
* <i><b>sslverifypeer</b></i> - Require verification of peer name</br>
* @param boolean $readConfigFromFile Default true, read the config.php file if it exists
*/
function __construct($getWSDL = false, $debug = false, $params = null)
function __construct($getWSDL = false, $debug = false, $params = null, $readConfigFromFile = true)
{
$tenantTokens = array();
$config = false;

$this->xmlLoc = 'ExactTargetWSDL.xml';

if (file_exists(realpath("config.php")))
if ($readConfigFromFile && file_exists(realpath("config.php")))
$config = include 'config.php';

if ($config)
Expand Down

0 comments on commit 1b61615

Please sign in to comment.