From 1b616158da59692cda2dd6d20d787068a07c1923 Mon Sep 17 00:00:00 2001 From: Ali Alwash Date: Thu, 13 Feb 2020 11:00:44 +0100 Subject: [PATCH] Add readConfigFromFile Sometimes you have already a config.php file in your framework for other purposes (see #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 --- src/ET_Client.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ET_Client.php b/src/ET_Client.php index b06bbb0..f362a25 100755 --- a/src/ET_Client.php +++ b/src/ET_Client.php @@ -95,15 +95,16 @@ class ET_Client extends SoapClient * proxyusername - proxy server user name
* proxypassword - proxy server password
* sslverifypeer - Require verification of peer name
+ * @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)