Commit 208b11c45753333dd3ef25e3c749922ec8a56e83
1 parent
0caf8fa3
[Swoole 集成 ThinkPHP 3.2] Swoole/tmp 目录做成逻辑添加。
Showing
1 changed file
with
4 additions
and
0 deletions
trunk/swoole.php
@@ -72,6 +72,10 @@ function portBind($port) | @@ -72,6 +72,10 @@ function portBind($port) | ||
72 | function servStart($host, $port, $daemon, $name) | 72 | function servStart($host, $port, $daemon, $name) |
73 | { | 73 | { |
74 | echo "正在启动 swoole-task 服务" . PHP_EOL; | 74 | echo "正在启动 swoole-task 服务" . PHP_EOL; |
75 | + if (!file_exists(dirname(SWOOLE_TASK_PID_PATH))) { | ||
76 | + $cmd = 'mkdir -p '.dirname(SWOOLE_TASK_PID_PATH); | ||
77 | + exec($cmd); | ||
78 | + } | ||
75 | if (!is_writable(dirname(SWOOLE_TASK_PID_PATH))) { | 79 | if (!is_writable(dirname(SWOOLE_TASK_PID_PATH))) { |
76 | exit("swoole-task-pid文件需要目录的写入权限:" . dirname(SWOOLE_TASK_PID_PATH) . PHP_EOL); | 80 | exit("swoole-task-pid文件需要目录的写入权限:" . dirname(SWOOLE_TASK_PID_PATH) . PHP_EOL); |
77 | } | 81 | } |