π File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-30 00:24:18
π
/
/
opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
vendor
/
fidry
/
cpu-core-counter
/
src
/
Executor
βοΈ
Editing: ProcOpenExecutor.php
<?php /* * This file is part of the Fidry CPUCounter Config package. * * (c) ThΓ©o FIDRY <theo.fidry@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare (strict_types=1); namespace RectorPrefix202411\Fidry\CpuCoreCounter\Executor; use function fclose; use function function_exists; use function is_resource; use function proc_close; use function proc_open; use function stream_get_contents; final class ProcOpenExecutor implements ProcessExecutor { public function execute(string $command) : ?array { if (!function_exists('proc_open')) { return null; } $pipes = []; $process = @proc_open($command, [ ['pipe', 'rb'], ['pipe', 'wb'], // stdout ['pipe', 'wb'], ], $pipes); if (!is_resource($process)) { return null; } fclose($pipes[0]); $stdout = (string) stream_get_contents($pipes[1]); $stderr = (string) stream_get_contents($pipes[2]); proc_close($process); return [$stdout, $stderr]; } }
πΎ Save Changes
β Cancel