本文整理汇总了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'));
}
示例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;
}
示例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));
}
示例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;
}