readable() 공개 정적인 메소드

Set the readable bit on a file to the minimum value that allows the user running PHP to read to it.
public static readable ( string $filename, boolean $readable = true ) : boolean
$filename string The filename to set the readable bit on
$readable boolean Whether to make the file readable or not
리턴 boolean
예제 #1
0
 public function testReadable()
 {
     if (Sys::isWin()) {
         //skip('This functionality is not working on Windows.');
         return false;
     }
     if (Sys::isRoot()) {
         skip('These tests don\'t work when run as root');
     }
     isFalse(FS::readable('/no/such/file'));
     $dirname = dirname(__FILE__);
     $file = $dirname . '/test8';
     touch($file);
     isTrue(is_readable($file));
     FS::readable($file, false);
     clearstatcache();
     isFalse(is_readable($file));
     FS::readable($file, true);
     clearstatcache();
     isTrue(is_readable($file));
     unlink($file);
 }