Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down