diff --git a/lib/Local.php b/lib/Local.php index 69e6819..ccd2c53 100644 --- a/lib/Local.php +++ b/lib/Local.php @@ -58,6 +58,8 @@ public function add_args($arg_key, $value = NULL) { $this->proxy_user = "-proxyUser $value"; elseif ($arg_key == "proxyPass") $this->proxy_pass = "-proxyPass $value"; + elseif ($arg_key == "forceproxy") + $this->force_proxy_flag = "-forceproxy"; elseif ($arg_key == "hosts") $this->hosts = $value; elseif ($arg_key == "f") { @@ -136,7 +138,7 @@ public function command() { if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $exec = "call"; - $command = "$exec $this->binary_path -logFile $this->logfile $this->folder_flag $this->key $this->folder_path $this->force_local_flag $this->local_identifier_flag $this->only_flag $this->only_automate_flag $this->proxy_host $this->proxy_port $this->proxy_user $this->proxy_pass $this->force_flag $this->verbose_flag $this->hosts"; + $command = "$exec $this->binary_path -logFile $this->logfile $this->folder_flag $this->key $this->folder_path $this->force_local_flag $this->local_identifier_flag $this->only_flag $this->only_automate_flag $this->proxy_host $this->proxy_port $this->proxy_user $this->proxy_pass $this->force_proxy_flag $this->force_flag $this->verbose_flag $this->hosts"; $command = preg_replace('/\s+/S', " ", $command); return $command; } diff --git a/tests/LocalTest.php b/tests/LocalTest.php index c5484f3..fedc8a9 100644 --- a/tests/LocalTest.php +++ b/tests/LocalTest.php @@ -63,6 +63,12 @@ public function test_set_proxy() { $this->assertContains('-proxyHost localhost -proxyPort 8080 -proxyUser user -proxyPass pass',$this->bs_local->command()); } + public function test_enable_force_proxy() { + $this->bs_local->add_args("forceproxy"); + $this->assertContains('-forceproxy',$this->bs_local->command()); + } + + public function test_hosts() { $this->bs_local->add_args("hosts", "localhost,8080,0"); $this->assertContains('localhost,8080,0',$this->bs_local->command());