static function check_file( $path, $w = false, $isdir = false ){
	 	$strtype = $isdir ? 'Directory' : 'File'; 
		if( !file_exists($path) ){
			trigger_error("$strtype not found; `$path'", E_USER_NOTICE );
			return false;
		}
		if( $isdir && !is_dir($path) ){
			trigger_error("Not a directory; `$path'", E_USER_NOTICE );
			return false;
		}
		if( !$isdir && !is_file($path) ){
			trigger_error("Not a file; `$path'", E_USER_NOTICE );
			return false;
		}
		if( !is_readable($path) ){
			trigger_error("$strtype not readable by `".trim(`whoami`)."'; `$path'", E_USER_NOTICE );
			return false;
		}
		if( $w && !is_writeable($path) ){
			trigger_error("$strtype not writeable by `".trim(`whoami`)."'; `$path'", E_USER_NOTICE );
			return false;
		}
		return true;
	 }
static function check_file( $path, $w = false, $isdir = false ){
	 	$strtype = $isdir ? 'Directory' : 'File'; 
		if( !file_exists($path) ){
			trigger_error("$strtype not found; `$path'", E_USER_NOTICE );
			return false;
		}
		if( $isdir && !is_dir($path) ){
			trigger_error("Not a directory; `$path'", E_USER_NOTICE );
			return false;
		}
		if( !$isdir && !is_file($path) ){
			trigger_error("Not a file; `$path'", E_USER_NOTICE );
			return false;
		}
		if( !is_readable($path) ){
			trigger_error("$strtype not readable by `".trim(`whoami`)."'; `$path'", E_USER_NOTICE );
			return false;
		}
		if( $w && !is_writeable($path) ){
			trigger_error("$strtype not writeable by `".trim(`whoami`)."'; `$path'", E_USER_NOTICE );
			return false;
		}
		return true;
	 }
static function check_file ( $ path , $ w = false , $ isdir = false ) { $ strtype = $ isdir ? 'Directory' : 'File' ; if ( ! file_exists ( $ path ) ) { trigger_error ( "$strtype not found; `$path'" , E_USER_NOTICE ) ; return false ; } if ( $ isdir && ! is_dir ( $ path ) ) { trigger_error ( "Not a directory; `$path'" , E_USER_NOTICE ) ; return false ; } if ( ! $ isdir && ! is_file ( $ path ) ) { trigger_error ( "Not a file; `$path'" , E_USER_NOTICE ) ; return false ; } if ( ! is_readable ( $ path ) ) { trigger_error ( "$strtype not readable by `" . trim ( `whoami` ) . "'; `$path'" , E_USER_NOTICE ) ; return false ; } if ( $ w && ! is_writeable ( $ path ) ) { trigger_error ( "$strtype not writeable by `" . trim ( `whoami` ) . "'; `$path'" , E_USER_NOTICE ) ; return false ; } return true ; }
Utility function to check resource can be read.
- Include paths will not be evaluated.
- E_USER_NOTICE raised on failure.
@param string Full path to file
@param bool whether directory write permission to be checked
@param bool Whether file is expected to be a directory
@return bool False if file cannot be read or does not exist
Utility function to check resource can be read . - Include paths will not be evaluated . - E_USER_NOTICE raised on failure .