本文整理汇总了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);
}