PHP code example of hugsbrugs / php-scripts
1. Go to this page and download the library: Download hugsbrugs/php-scripts library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hugsbrugs / php-scripts example snippets
use Hug\Scripts\Scripts as Scripts;
$cmd = 'ls -lsa';
$log_file = __DIR__ . '/test.log';
$res = Scripts::run($cmd, $log_file);
$running = Scripts::is_running($res['data']['pid']);
$cpu_mem = Scripts::get_pid_cpu_mem($res['data']['pid']);
composer