diff --git a/base/PHP5Daemon.php b/base/PHP5Daemon.php index 4aa7f46..f0a6a8c 100644 --- a/base/PHP5Daemon.php +++ b/base/PHP5Daemon.php @@ -105,7 +105,7 @@ protected function getArguments(): Vector { } else { $args = Vector { '-b', - '127.0.0.1:'.PerfSettings::BackendPort(), + 'localhost:'.PerfSettings::BackendPort(), '-c', OSS_PERFORMANCE_ROOT.'/conf/', }; diff --git a/base/PerfTarget.php b/base/PerfTarget.php index bb1e3a8..5b6f896 100644 --- a/base/PerfTarget.php +++ b/base/PerfTarget.php @@ -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); diff --git a/base/Siege.php b/base/Siege.php index cbfb6cf..61e4b2b 100644 --- a/base/Siege.php +++ b/base/Siege.php @@ -99,7 +99,7 @@ protected function getArguments(): Vector { $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) { diff --git a/targets/magento1/Magento1Target.php b/targets/magento1/Magento1Target.php index b5f9a93..da3ea39 100644 --- a/targets/magento1/Magento1Target.php +++ b/targets/magento1/Magento1Target.php @@ -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(), diff --git a/targets/mediawiki/MediaWikiMLPTarget.php b/targets/mediawiki/MediaWikiMLPTarget.php index 311cf46..7fed1f7 100644 --- a/targets/mediawiki/MediaWikiMLPTarget.php +++ b/targets/mediawiki/MediaWikiMLPTarget.php @@ -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', diff --git a/targets/mediawiki/MediaWikiTarget.php b/targets/mediawiki/MediaWikiTarget.php index 39c5e47..017daa8 100644 --- a/targets/mediawiki/MediaWikiTarget.php +++ b/targets/mediawiki/MediaWikiTarget.php @@ -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', diff --git a/targets/sugarcrm/SugarCRMHomePageTarget.php b/targets/sugarcrm/SugarCRMHomePageTarget.php index e8f3671..b7107be 100644 --- a/targets/sugarcrm/SugarCRMHomePageTarget.php +++ b/targets/sugarcrm/SugarCRMHomePageTarget.php @@ -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, ); diff --git a/targets/wordpress/WordpressTarget.php b/targets/wordpress/WordpressTarget.php index 9693137..a69cd58 100644 --- a/targets/wordpress/WordpressTarget.php +++ b/targets/wordpress/WordpressTarget.php @@ -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); @@ -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]], );