Swoole\Coroutine\System::exec(string $cmd)

Declaration

<?php
Swoole\Coroutine\System::exec(string $cmd)

Parameters

cmd

the location of Linux command.

Return

result

[ 'code' => 0, 'signal' => 0, 'output' => '', ]

Description

Alias: Swoole\Coroutine::exec.

Execute Linux command within the conroutine context.

Example

<?php
go(function() {
    $ret = Co\System::exec("md5sum ".__FILE__);
});