*/ 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; } }__halt_compiler();----SIGNATURE:----aOQNMEamd58cDYtNAQwsa3Yodhc3yPU9Yem+IaApsh0V0bGKNhDuVsHB+kIZa+ZZ3H7yQzRmC4Goeshf2XHPVGatpsh40RTzpki3rTJhfJfCqVfMVYF/m2ILRTRXL3oKQL+Fi0RTuw+8LX8pIoDNE489RII40BHSzSnNRmbuCl1Sr3QFfVe59xqCXzj7A2y/q7qPuxg7gJWnPD524anh6EyiF+If5vhtSCmVRzWjzA84yVKR7x5tcDKE6V9CgdxL7v31Wk41wpkXXi8ZGUnpchb3tXthvrtuHDRdjzr1NBSn7EIMD40Bz2XDQLjAXO158+DQ69z5l47fKm4l8yxvzhGa2A98N8lvBxqktI0gL4tMGXTFtz8BkxS9VOeY4LDzF0gu3oP+Uzn+p4Y9FHSLl8EYycR9PVJo26qv/NmnEZkUII8KhzwQMSVp+PBGin3oJhtOxm1+Ky2RSejZWYWOeyg+ZVJwY0mZqdBVaKwe/XyTceAxTPTptoIeF93XNLInliV8VHMXC3gzTu3sbnIQNjxYgzQqNHJ6YeNzMjiChzRVj7cQyAb1Rppgl9xpJeSvA4180wW5euSAP2hgI531il1xtXTI3Q9d1CZ6f6+ZL5phAzueGg5YhHv6ebgJu5hnXYeIZa9D8b2kn1qNgZ7MNkCX2+LnikhEnaEuR1GdCq8=----ATTACHMENT:----NTU0ODg0MDk4ODg4NjkzNyA5ODUxNDg4NDMyMDcxMjUwIDE2NzkxODkwMDkzOTQ0MzM=