本文整理匯總了PHP中LocalFile::mkdir方法的典型用法代碼示例。如果您正苦於以下問題:PHP LocalFile::mkdir方法的具體用法?PHP LocalFile::mkdir怎麽用?PHP LocalFile::mkdir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LocalFile
的用法示例。
在下文中一共展示了LocalFile::mkdir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testMkdir
public function testMkdir()
{
//already existing dir
$this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
try {
$this->fixture_dir->mkdir();
$this->fail();
} catch (EyeIOException $e) {
//normal situation
}
//non-existing dir
rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir');
$this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
$this->fixture_dir->mkdir();
$this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
//non-existing parent dir
rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir');
$dir2 = new LocalFile(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2');
$this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2'));
try {
$dir2->mkdir();
$this->fail();
} catch (EyeIOException $e) {
//normal situation
}
}
示例2: mkdir
/**
* @return bool TRUE if the directory has been successfully created, FALSE otherwise
*/
public function mkdir($mode = 0777)
{
$this->getParentFile()->checkWritePermission();
return parent::mkdir($mode);
}