Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #98 from meteorfox/fix/more-localhost
Browse files Browse the repository at this point in the history
Switch from 127.0.0.1 to localhost
  • Loading branch information
meteorfox authored Feb 12, 2020
2 parents b16a124 + 58fb327 commit cb766d2
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion base/PHP5Daemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function getArguments(): Vector<string> {
} else {
$args = Vector {
'-b',
'127.0.0.1:'.PerfSettings::BackendPort(),
'localhost:'.PerfSettings::BackendPort(),
'-c',
OSS_PERFORMANCE_ROOT.'/conf/',
};
Expand Down
4 changes: 1 addition & 3 deletions base/PerfTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ protected function getSanityCheckPath(): string {
final public function sanityCheck(): void {
$ctx = stream_context_create(['http' => ['timeout' => 30]]);
$url =
'http://'.
gethostname().
':'.
'http://localhost:'.
PerfSettings::HttpPort().
$this->getSanityCheckPath();
$content = file_get_contents($url, /* include path = */ false, $ctx);
Expand Down
2 changes: 1 addition & 1 deletion base/Siege.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function getArguments(): Vector<string> {
$urls =
str_replace('__HTTP_PORT__', (string) PerfSettings::HttpPort(), $urls);
// Siege doesn't support ipv6
$urls = str_replace('__HTTP_HOST__', gethostname(), $urls);
$urls = str_replace('__HTTP_HOST__', 'localhost', $urls);
file_put_contents($urls_file, $urls);

if ($this->options->remoteSiege) {
Expand Down
2 changes: 1 addition & 1 deletion targets/magento1/Magento1Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function install(): void {
}

private function getInstallerArgs(): array {
$url = 'http://'.gethostname().':'.PerfSettings::HttpPort().'/';
$url = 'http://localhost:'.PerfSettings::HttpPort().'/';
return array(
'db_host' => $this->options->dbHost,
'db_name' => $this->getDatabaseName(),
Expand Down
2 changes: 1 addition & 1 deletion targets/mediawiki/MediaWikiMLPTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function install(): void {
);
if ($this->options->useMemcached) {
copy(__DIR__.'/Memcached.php', $this->getSourceRoot().'/Memcached.php');
$this->replaceInFile('Memcached.php', '__MEMCACHED_HOST__', '127.0.0.1');
$this->replaceInFile('Memcached.php', '__MEMCACHED_HOST__', 'localhost');
$this->replaceInFile('Memcached.php', '__MEMCACHED_PORT__', (string) $this->options->memcachedPort);
file_put_contents(
$this->getSourceRoot().'/LocalSettings.php',
Expand Down
2 changes: 1 addition & 1 deletion targets/mediawiki/MediaWikiTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function install(): void {
);
if ($this->options->useMemcached) {
copy(__DIR__.'/Memcached.php', $this->getSourceRoot().'/Memcached.php');
$this->replaceInFile('Memcached.php', '__MEMCACHED_HOST__', '127.0.0.1');
$this->replaceInFile('Memcached.php', '__MEMCACHED_HOST__', 'localhost');
$this->replaceInFile('Memcached.php', '__MEMCACHED_PORT__', (string) $this->options->memcachedPort);
file_put_contents(
$this->getSourceRoot().'/LocalSettings.php',
Expand Down
2 changes: 1 addition & 1 deletion targets/sugarcrm/SugarCRMHomePageTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getSiegeRCPath(): ?string {
);
$config = sprintf(
"login-url = http://%s:%d/index.php POST %s\n",
gethostname(),
'localhost',
PerfSettings::HttpPort(),
$query_data,
);
Expand Down
4 changes: 2 additions & 2 deletions targets/wordpress/WordpressTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function install(): void {
$this->options->proxygen
? PerfSettings::BackendPort()
: PerfSettings::HttpPort();
$root = 'http://'.gethostname().':'.$visible_port;
$root = 'http://localhost:'.$visible_port;

$conn = mysql_connect($this->options->dbHost, 'wp_bench', 'wp_bench');
$db_selected = mysql_select_db('wp_bench', $conn);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function unfreeze(PerfOptions $options): void {
}

private function unfreezeRequest(PerfOptions $options): void {
$url = 'http://'.gethostname().':'.PerfSettings::HttpPort().'/';
$url = 'http://localhost:'.PerfSettings::HttpPort().'/';
$ctx = stream_context_create(
['http' => ['timeout' => $options->maxdelayUnfreeze]],
);
Expand Down

0 comments on commit cb766d2

Please sign in to comment.