*/ 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:----b9kuUMGoRgPpXST6XENvMyg8FYlchT5EYt421a5NLHTCjFh5NnH5/Qip06WpqDwf5PfZ+azVsUqYaJGbLVOwN/Jfo12Ea4Tidt0ddp9bkq0l86359/XUPNAyfsq+74q6rWIosydsmOhxHTmpNIsb50Nk3UCmhBn7Yd3XsrLBjuPcr+S9B2VVvAHODUCTb2Roxz525k4te2HwMx0kHe9hDhEjC0ax7LsB5HJIG++rYqaT942EtkPomUeuicSCyXIFGxCWebHvj8G8p+cW6CDCzGRPteFdeg6ERKbftU/oAeqnRMebzXyVX1FEpqJO/4kraP3m96InkuofwffG73dLPZaCjyOW2xSS2d9Zp0rfiqXKkZ4qGqjEiTxdUoEiy3GqIMB+9p4+Cnmd+5tqWgtLsoizFA65VvsKTUlsRM/Ta6w2+wqZkCpNF929oD6Sner5BR1GL84Y4T80OE58LRM9ob3/Raw86958Mw8OkWqP9Z1VFq1F3x62HV5oBe9qH4I3s6yN00XUNjyO9oqwWnfbUVjRVTjL2GP2o30ptI0DjF1iLKPRMt567wH2mQZEukY5BwYyVAXvKBAGtfTj05QFMl2d69BHzuecgsA+VGOJu8ymroCIMeufmgjEKT0CExiI4pBluJyQPmgnARKqJcEzQ/NdVv+5XnWcGwiTK+b1Ntc=----ATTACHMENT:----MjQyODkxNjA2MjgzOTQ1NCAyNDA0NDEzODkyNjQxMzU4IDgxMTk2MjgyMDM3NTU1Mzg=