/** * is $path a file, and can we run it? * * @param string $path * the file to check * @return void * * @throws E4xx_InvalidPath * if $path is not a file, or otherwise does not exist * @throws E4xx_FileIsNotExecutable * if $path is a file, but we do not have permissions to run it */ public static function check($path) { // robustness RequireStringy::check($path); // do we have a file? if (!IsFile::check($path)) { throw new E4xx_InvalidPath($path); } // can we read it? if (!IsReadableFile::check($path)) { throw new E4xx_FileIsNotExecutable($path); } }
/** * does this operating system have the file '/etc/redhat-release'? * * /etc/redhat-release is a file that exists on RedHat Linux systems, * including derivatives such as Fedora and CentOS * * @param string $path * path to the file to check for * override this if you're checking inside a chroot folder * of some kind * * @return boolean * TRUE if $path exists * FALSE otherwise */ public static function check($path = '/etc/redhat-release') { return IsFile::check($path); }
/** * does this operating system have the file '/etc/issue'? * * /etc/issue is a file that exists on Linux systems, and which (by * convention) contains information about the Linux distro * * @param string $path * path to the file to check for * override this if you're checking inside a chroot folder * of some kind * * @return boolean * TRUE if $path exists * FALSE otherwise */ public static function check($path = '/etc/issue') { return IsFile::check($path); }