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