本文整理汇总了PHP中OC\Files\Filesystem::filetype方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::filetype方法的具体用法?PHP Filesystem::filetype怎么用?PHP Filesystem::filetype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Files\Filesystem
的用法示例。
在下文中一共展示了Filesystem::filetype方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filetype
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/
public static function filetype($path)
{
return \OC\Files\Filesystem::filetype($path);
}
示例2: unshare
/**
* @NoAdminRequired
* @NoCSRFRequired
* @SSOCORS
*/
public function unshare($id, $type)
{
$shareWith = null;
$path = \OC\Files\Filesystem::getPath($id);
$response = array('id' => $id);
if ($path === null) {
if ($type == 'file') {
$error_msg = self::msg_idNotExist;
} else {
$replacement = '${1}folder${3}';
$error_msg = preg_replace($this->fileTypePattern, $replacement, self::msg_idNotExist);
}
return new DataResponse(array('data' => $response, 'status' => 'error', 'message' => $error_msg));
}
if (\OC\Files\Filesystem::filetype($path) !== $type) {
$replacement = '${1}\'' . $type . '\'${3}' . 'id: ' . $id;
$error_msg = preg_replace($this->errorTypePattern, $replacement, self::msg_errorType);
return new DataResponse(array('data' => $response, 'status' => 'error', 'message' => $error_msg));
}
if ($type == 'dir') {
$type = 'folder';
}
$unshare = \OCP\Share::unshare((string) $type, (string) $id, (int) $this->shareType, $shareWith);
if ($unshare) {
return new DataResponse(array('data' => $response, 'status' => 'success'));
} else {
$replacement = '${1}folder${3}';
$error_msg = preg_replace($this->fileTypePattern, $replacement, self::msg_noRequireUnshareBeforeShare);
return new DataResponse(array('data' => $response, 'status' => 'error', 'message' => $error_msg));
}
}