當前位置: 首頁>>代碼示例>>PHP>>正文


PHP util::isSystemWideMountPoint方法代碼示例

本文整理匯總了PHP中util::isSystemWideMountPoint方法的典型用法代碼示例。如果您正苦於以下問題:PHP util::isSystemWideMountPoint方法的具體用法?PHP util::isSystemWideMountPoint怎麽用?PHP util::isSystemWideMountPoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在util的用法示例。


在下文中一共展示了util::isSystemWideMountPoint方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delAllShareKeys

 /**
  * @brief delete all share keys of a given file
  * @param \OC_FilesystemView $view
  * @param string $userId owner of the file
  * @param string $filePath path to the file, relative to the owners file dir
  */
 public static function delAllShareKeys(\OC_FilesystemView $view, $userId, $filePath)
 {
     $util = new util($view, $userId);
     if ($util->isSystemWideMountPoint($filePath)) {
         $baseDir = '/files_encryption/share-keys/';
     } else {
         $baseDir = $userId . '/files_encryption/share-keys/';
     }
     if ($view->is_dir($userId . '/files/' . $filePath)) {
         $view->unlink($baseDir . $filePath);
     } else {
         $localKeyPath = $view->getLocalFile($baseDir . $filePath);
         $escapedPath = Helper::escapeGlobPattern($localKeyPath);
         $matches = glob($escapedPath . '*.shareKey');
         foreach ($matches as $ma) {
             $result = unlink($ma);
             if (!$result) {
                 \OCP\Util::writeLog('Encryption library', 'Keyfile or shareKey could not be deleted for file "' . $filePath . '"', \OCP\Util::ERROR);
             }
         }
     }
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:28,代碼來源:keymanager.php

示例2: delAllShareKeys

 /**
  * delete all share keys of a given file
  * @param \OC\Files\View $view
  * @param string $userId owner of the file
  * @param string $filePath path to the file, relative to the owners file dir
  */
 public static function delAllShareKeys($view, $userId, $filePath)
 {
     $filePath = ltrim($filePath, '/');
     if ($view->file_exists('/' . $userId . '/files/' . $filePath)) {
         \OCP\Util::writeLog('Encryption library', 'File still exists, stop deleting share keys!', \OCP\Util::ERROR);
         return false;
     }
     if ($filePath === '') {
         \OCP\Util::writeLog('Encryption library', 'Can\'t delete share-keys empty path given!', \OCP\Util::ERROR);
         return false;
     }
     $util = new util($view, $userId);
     if ($util->isSystemWideMountPoint($filePath)) {
         $baseDir = '/files_encryption/share-keys/';
     } else {
         $baseDir = $userId . '/files_encryption/share-keys/';
     }
     $result = true;
     if ($view->is_dir($baseDir . $filePath)) {
         \OCP\Util::writeLog('files_encryption', 'delAllShareKeys: delete share keys: ' . $baseDir . $filePath, \OCP\Util::DEBUG);
         $result = $view->unlink($baseDir . $filePath);
     } else {
         $parentDir = dirname($baseDir . $filePath);
         $filename = pathinfo($filePath, PATHINFO_BASENAME);
         foreach ($view->getDirectoryContent($parentDir) as $content) {
             $path = $content['path'];
             if (self::getFilenameFromShareKey($content['name']) === $filename) {
                 \OCP\Util::writeLog('files_encryption', 'dellAllShareKeys: delete share keys: ' . '/' . $userId . '/' . $path, \OCP\Util::DEBUG);
                 $result &= $view->unlink('/' . $userId . '/' . $path);
             }
         }
     }
     return (bool) $result;
 }
開發者ID:olucao,項目名稱:owncloud-core,代碼行數:40,代碼來源:keymanager.php

示例3: delAllShareKeys

 /**
  * @brief delete all share keys of a given file
  * @param \OC_FilesystemView $view
  * @param string $userId owner of the file
  * @param string $filePath path to the file, relative to the owners file dir
  */
 public static function delAllShareKeys($view, $userId, $filePath)
 {
     $filePath = ltrim($filePath, '/');
     if ($view->file_exists('/' . $userId . '/files/' . $filePath)) {
         \OCP\Util::writeLog('Encryption library', 'File still exists, stop deleting share keys!', \OCP\Util::ERROR);
         return false;
     }
     if ($filePath === '') {
         \OCP\Util::writeLog('Encryption library', 'Can\'t delete share-keys empty path given!', \OCP\Util::ERROR);
         return false;
     }
     $util = new util($view, $userId);
     if ($util->isSystemWideMountPoint($filePath)) {
         $baseDir = '/files_encryption/share-keys/';
     } else {
         $baseDir = $userId . '/files_encryption/share-keys/';
     }
     $result = true;
     if ($view->is_dir($baseDir . $filePath)) {
         \OCP\Util::writeLog('files_encryption', 'delAllShareKeys: delete share keys: ' . $baseDir . $filePath, \OCP\Util::DEBUG);
         $result = $view->unlink($baseDir . $filePath);
     } else {
         $sharingEnabled = \OCP\Share::isEnabled();
         $users = $util->getSharingUsersArray($sharingEnabled, $filePath);
         foreach ($users as $user) {
             $keyName = $baseDir . $filePath . '.' . $user . '.shareKey';
             if ($view->file_exists($keyName)) {
                 \OCP\Util::writeLog('files_encryption', 'dellAllShareKeys: delete share keys: "' . $keyName . '"', \OCP\Util::DEBUG);
                 $result &= $view->unlink($keyName);
             }
         }
     }
     return (bool) $result;
 }
開發者ID:hjimmy,項目名稱:owncloud,代碼行數:40,代碼來源:keymanager.php


注:本文中的util::isSystemWideMountPoint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。