fileExists() 공개 정적인 메소드

Per default it allows http/https images to be looked up via urlExists() for a better result.
public static fileExists ( string $file, string $pattern = '~^https?://~i' ) : boolean
$file string File
$pattern string
리턴 boolean Success
예제 #1
0
 /**
  * UtilityTest::testFileExists()
  *
  * @covers ::fileExists
  * @return void
  */
 public function testFileExists()
 {
     $res = Utility::fileExists('http://www.spiegel.de/static/sys/v10/icons/home_v2.png');
     $this->assertTrue($res);
     $res = Utility::fileExists(Plugin::path('Tools') . 'tests' . DS . 'test_files' . DS . 'img' . DS . 'hotel.jpg');
     $this->assertTrue($res);
     $res = Utility::fileExists('http://www.spiegel.de/static/sys/v10/icons/home_v2_inexistent.png');
     $this->assertFalse($res);
     $res = Utility::fileExists(Plugin::path('Tools') . 'tests' . DS . 'test_files' . DS . 'img' . DS . 'fooooo.jpg');
     $this->assertFalse($res);
 }