소스 검색

fix process title start_file missing

walkor 9 년 전
부모
커밋
9a9899e7b2
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      Worker.php

+ 4 - 2
Worker.php

@@ -387,11 +387,13 @@ class Worker
      */
     protected static function init()
     {
+        // 记录启动入口
+        $backtrace = debug_backtrace();
+        self::$_startFile = $backtrace[count($backtrace)-1]['file'];
+        
         // 如果没设置$pidFile,则生成默认值
         if(empty(self::$pidFile))
         {
-            $backtrace = debug_backtrace();
-            self::$_startFile = $backtrace[count($backtrace)-1]['file'];
             self::$pidFile = __DIR__ . "/../".str_replace('/', '_', self::$_startFile).".pid";
         }
         // 没有设置日志文件,则生成一个默认值