diff --git a/Worker.php b/Worker.php index 46695c24c..f6e2b6cc0 100644 --- a/Worker.php +++ b/Worker.php @@ -266,13 +266,11 @@ class Worker public static $pidFile = ''; /** - * Phar support. - * The filename prefix used to store the master process status file. - * Allow user-defined file paths to store the master process status file. + * The file used to store the master process status file. * * @var string */ - public static $statisticsFileNamePrefix = ''; + public static $statusFile = ''; /** * Log file. @@ -654,7 +652,7 @@ protected static function initWorkers() return; } - static::$_statisticsFile = !empty(static::$statisticsFileNamePrefix) ? static::$statisticsFileNamePrefix . posix_getpid().'.status' : __DIR__ . '/../workerman-' .posix_getpid().'.status'; + static::$_statisticsFile = static::$statusFile ? static::$statusFile : __DIR__ . '/../workerman-' .posix_getpid().'.status'; foreach (static::$_workers as $worker) { // Worker name. @@ -932,7 +930,7 @@ protected static function parseCommand() exit; } - $statistics_file = !empty(static::$statisticsFileNamePrefix) ? static::$statisticsFileNamePrefix . "$master_pid.status" : __DIR__ . "/../workerman-$master_pid.status"; + $statistics_file = static::$statusFile ? static::$statusFile : __DIR__ . "/../workerman-$master_pid.status"; // execute command. switch ($command) {