Clue\React\Buzz\Io\Sender::createFromLoopUnix PHP Méthode

createFromLoopUnix() public static méthode

create a sender that sends *everything* through given UNIX socket path
public static createFromLoopUnix ( React\EventLoop\LoopInterface $loop, string $path ) : self
$loop React\EventLoop\LoopInterface
$path string
Résultat self
    public static function createFromLoopUnix(LoopInterface $loop, $path)
    {
        $connector = new UnixConnector($loop, $path);
        return self::createFromLoopConnectors($loop, $connector);
    }

Usage Example

Exemple #1
0
 /**
  * Creates a new Client instance and helps with constructing the right Browser object for the given remote URL
  *
  * @param null|string $url (optional) URL to your (local) Docker daemon, defaults to using local unix domain socket path
  * @return Client
  */
 public function createClient($url = null)
 {
     if ($url === null) {
         $url = 'unix:///var/run/docker.sock';
     }
     $browser = $this->browser;
     if (substr($url, 0, 7) === 'unix://') {
         // send everything through a local unix domain socket
         $browser = $this->browser->withSender(Sender::createFromLoopUnix($this->loop, $url));
         // pretend all HTTP URLs to be on localhost
         $url = 'http://localhost/';
     }
     return new Client($browser->withBase($url));
 }
All Usage Examples Of Clue\React\Buzz\Io\Sender::createFromLoopUnix