当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::stripPartialFileExtension方法代码示例

本文整理汇总了PHP中OCA\Encryption\Helper::stripPartialFileExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::stripPartialFileExtension方法的具体用法?PHP Helper::stripPartialFileExtension怎么用?PHP Helper::stripPartialFileExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCA\Encryption\Helper的用法示例。


在下文中一共展示了Helper::stripPartialFileExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 /**
  * @medium
  */
 function testStripPartialFileExtensionWithTransferIdPath()
 {
     $partFilename = 'testfile.txt.ocTransferId643653835.part';
     $filename = 'testfile.txt';
     $this->assertTrue(Encryption\Helper::isPartialFilePath($partFilename));
     $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($partFilename));
     $this->assertFalse(Encryption\Helper::isPartialFilePath($filename));
     $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($filename));
 }
开发者ID:droiter,项目名称:openwrt-on-android,代码行数:12,代码来源:helper.php

示例2: getSharingUsersArray

 /**
  * Find, sanitise and format users sharing a file
  * @note This wraps other methods into a portable bundle
  * @param boolean $sharingEnabled
  * @param string $filePath path relativ to current users files folder
  */
 public function getSharingUsersArray($sharingEnabled, $filePath)
 {
     $appConfig = \OC::$server->getAppConfig();
     // Check if key recovery is enabled
     if ($appConfig->getValue('files_encryption', 'recoveryAdminEnabled') && $this->recoveryEnabledForUser()) {
         $recoveryEnabled = true;
     } else {
         $recoveryEnabled = false;
     }
     // Make sure that a share key is generated for the owner too
     list($owner, $ownerPath) = $this->getUidAndFilename($filePath);
     $ownerPath = \OCA\Encryption\Helper::stripPartialFileExtension($ownerPath);
     // always add owner to the list of users with access to the file
     $userIds = array($owner);
     if ($sharingEnabled) {
         // Find out who, if anyone, is sharing the file
         $result = \OCP\Share::getUsersSharingFile($ownerPath, $owner);
         $userIds = \array_merge($userIds, $result['users']);
         if ($result['public']) {
             $userIds[] = $this->publicShareKeyId;
         }
     }
     // If recovery is enabled, add the
     // Admin UID to list of users to share to
     if ($recoveryEnabled) {
         // Find recoveryAdmin user ID
         $recoveryKeyId = $appConfig->getValue('files_encryption', 'recoveryKeyId');
         // Add recoveryAdmin to list of users sharing
         $userIds[] = $recoveryKeyId;
     }
     // check if it is a group mount
     if (\OCP\App::isEnabled("files_external")) {
         $mounts = \OC_Mount_Config::getSystemMountPoints();
         foreach ($mounts as $mount) {
             if ($mount['mountpoint'] == substr($ownerPath, 1, strlen($mount['mountpoint']))) {
                 $userIds = array_merge($userIds, $this->getUserWithAccessToMountPoint($mount['applicable']['users'], $mount['applicable']['groups']));
             }
         }
     }
     // Remove duplicate UIDs
     $uniqueUserIds = array_unique($userIds);
     return $uniqueUserIds;
 }
开发者ID:Combustible,项目名称:core,代码行数:49,代码来源:util.php


注:本文中的OCA\Encryption\Helper::stripPartialFileExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。