本文整理汇总了PHP中Listing::mkDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Listing::mkDir方法的具体用法?PHP Listing::mkDir怎么用?PHP Listing::mkDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Listing
的用法示例。
在下文中一共展示了Listing::mkDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
//.........这里部分代码省略.........
if ($this->enableDelete && $fmObject != '') {
if ($Entry =& $this->Listing->getEntry($fmObject)) {
if ($Entry->icon == 'dir') {
if (!$this->Listing->remDir($Entry->path)) {
$this->error = $msg['errDelete'] . ": {$Entry->name}";
}
} else {
if (!$Entry->deleteFile()) {
$this->error = $msg['errDelete'] . ": {$Entry->name}";
}
}
}
}
if (!$this->error) {
$this->Listing->refresh();
}
break;
case 'newDir':
if ($this->enableNewDir) {
if ($fmName != '') {
if (get_magic_quotes_gpc()) {
$fmName = stripslashes($fmName);
}
$fmName = str_replace('\\', '/', $fmName);
$dirs = explode('/', $fmName);
$dir = '';
for ($i = 0; $i < count($dirs); $i++) {
if ($dirs[$i] != '') {
if ($dir != '') {
$dir .= '/';
}
$dir .= $dirs[$i];
$curDir = $this->Listing->curDir;
if (!$this->Listing->mkDir("{$curDir}/{$dir}")) {
$this->error = $msg['errDirNew'] . ": {$dir}";
break;
} else {
if ($this->defaultDirPermissions) {
$Entry =& $this->Listing->getEntryByName($dir);
if (!$Entry || !$Entry->changePerms($this->defaultDirPermissions)) {
$this->error = $msg['errPermChange'] . ": {$dir}";
break;
}
}
}
}
}
}
}
$this->Listing->refresh();
break;
case 'newFile':
if ($this->enableUpload) {
$fmFile = $_FILES['fmFile'];
$fmReplSpaces = $_REQUEST['fmReplSpaces'];
$fmLowerCase = $_REQUEST['fmLowerCase'];
$errors = array();
if (is_array($fmFile)) {
for ($i = 0; $i < count($fmFile['size']); $i++) {
$newFile = $fmFile['name'][$i];
if ($fmFile['size'][$i]) {
if ($this->hideSystemFiles && $newFile[0] == '.') {
$errors[] = $msg['errAccess'] . ": {$newFile}";
} else {
if ($this->replSpacesUpload || $fmReplSpaces) {
$newFile = str_replace(' ', '_', $newFile);