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


PHP OC_Filesystem::getMountPoint方法代码示例

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


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

示例1: testMount

 public function testMount()
 {
     OC_Filesystem::mount('OC_Filestorage_Local', self::getStorageData(), '/');
     $this->assertEqual('/', OC_Filesystem::getMountPoint('/'));
     $this->assertEqual('/', OC_Filesystem::getMountPoint('/some/folder'));
     $this->assertEqual('', OC_Filesystem::getInternalPath('/'));
     $this->assertEqual('some/folder', OC_Filesystem::getInternalPath('/some/folder'));
     OC_Filesystem::mount('OC_Filestorage_Local', self::getStorageData(), '/some');
     $this->assertEqual('/', OC_Filesystem::getMountPoint('/'));
     $this->assertEqual('/some/', OC_Filesystem::getMountPoint('/some/folder'));
     $this->assertEqual('/some/', OC_Filesystem::getMountPoint('/some/'));
     $this->assertEqual('/', OC_Filesystem::getMountPoint('/some'));
     $this->assertEqual('folder', OC_Filesystem::getInternalPath('/some/folder'));
 }
开发者ID:ryanshoover,项目名称:core,代码行数:14,代码来源:filesystem.php

示例2: getID

function getID($path)
{
    // use the share table from the db to find the item source if the file was reshared because shared files
    //are not stored in the file cache.
    if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") {
        $path_parts = explode('/', $path, 5);
        $user = $path_parts[1];
        $intPath = '/' . $path_parts[4];
        $query = \OC_DB::prepare('SELECT `item_source` FROM `*PREFIX*share` WHERE `uid_owner` = ? AND `file_target` = ? ');
        $result = $query->execute(array($user, $intPath));
        $row = $result->fetchRow();
        $fileSource = $row['item_source'];
    } else {
        $fileSource = OC_Filecache::getId($path, '');
    }
    return $fileSource;
}
开发者ID:ryanshoover,项目名称:core,代码行数:17,代码来源:public.php

示例3: getMountPoint

 /**
 * get the mountpoint of the storage object for a path
 ( note: because a storage is not always mounted inside the fakeroot, the returned mountpoint is relative to the absolute root of the filesystem and doesn't take the chroot into account
 *
 * @param string path
 * @return string
 */
 public function getMountPoint($path)
 {
     return OC_Filesystem::getMountPoint($this->getAbsolutePath($path));
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:11,代码来源:filesystemview.php

示例4: getInternalPath

 /**
  * @brief Get the internal path to pass to the storage filesystem call
  * @param string Source file path
  * @return Source file path with mount point stripped out
  */
 private function getInternalPath($path)
 {
     $mountPoint = OC_Filesystem::getMountPoint($path);
     $internalPath = substr($path, strlen($mountPoint));
     return $internalPath;
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:11,代码来源:sharedstorage.php


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