MAKS\AmqpAgent\Helper\Utility::execute
Executes a CLI command in the specified path synchronously or asynchronous (cross platform).
Signature
public function execute(string
$command,
[string
$path = NULL,
[boolean
$asynchronous = false]] )
Parameters
$command
—
string
- The command to execute.
$path
—
string
- [optional] The path where the command should be executed.
$asynchronous
—
boolean
- [optional] Whether the command should be a background process (asynchronous) or not (synchronous).
Returns
- string|null
- The command result (as a string if possible) if synchronous otherwise null.
Errors/Exceptions
-
Exception
Test Coverage
Information
- Coverage: 12/12 Lines (100%)
- Tests: 6
- Passed: 6 (100%)
Tests
- [ PASSED ] — MAKS\AmqpAgent\Tests\Helper\UtilityTest::testExecuteWithDiffrentParametersCombinations
- [ PASSED ] — MAKS\AmqpAgent\Tests\Helper\UtilityTest::testExecuteRaisesExceptionWhenProvidedWithEmptyCommand
- [ PASSED ] — MAKS\AmqpAgent\Tests\RPC\ClientEndpointTest::testRequestMethodViaAliasMethodCall
- [ PASSED ] — MAKS\AmqpAgent\Tests\RPC\ClientEndpointTest::testAnExceptionIsRaisedIfCorrelationIdOfTheResponseIsNotTheSameAsTheRequest
- [ PASSED ] — MAKS\AmqpAgent\Tests\RPC\ServerEndpointTest::testRespondMethodViaAliasMethodServe
- [ PASSED ] — MAKS\AmqpAgent\Tests\RPC\ServerEndpointTest::testAnExceptionIsRaisedIfPassedCallbackDoesNotReturnString