File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace EProcess \Adapter ;
44
5+ use Ratchet \Wamp \Exception ;
56use React \EventLoop \LoopInterface ;
67
78abstract class BaseAdapter
@@ -17,7 +18,15 @@ public function __construct(LoopInterface $loop)
1718
1819 protected function createUnixSocket ()
1920 {
20- $ unixFile = sprintf ('tmp/%s.sock ' , $ this ->node );
21+ if (!defined ('SOCKET_PATH ' ))
22+ throw new \Exception ("SOCKET_PATH is not defined. " );
23+
24+ if (!is_writable (SOCKET_PATH )){
25+ if (!mkdir (SOCKET_PATH ))
26+ throw new \Exception ("Cannot create folder at SOCKET_PATH. " );
27+ }
28+
29+ $ unixFile = sprintf ('%s/%s.sock ' , SOCKET_PATH , $ this ->node );
2130 $ unix = sprintf ('unix://%s ' , $ unixFile );
2231
2332 $ cleanup = function () use ($ unixFile ) {
Original file line number Diff line number Diff line change 11<?php
22
3+ define ('SOCKET_PATH ' , '/tmp/eprocess ' );
4+
35require_once __DIR__ . '/autoload.php ' ;
46
57use Doctrine \Common \Annotations \AnnotationRegistry ;
You can’t perform that action at this time.
0 commit comments