本文整理匯總了PHP中OC_Filesystem::clearMounts方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Filesystem::clearMounts方法的具體用法?PHP OC_Filesystem::clearMounts怎麽用?PHP OC_Filesystem::clearMounts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Filesystem
的用法示例。
在下文中一共展示了OC_Filesystem::clearMounts方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
//set testing key
$_SESSION['enckey'] = md5(time());
//clear all proxies and hooks so we can do clean testing
OC_FileProxy::clearProxies();
OC_Hook::clear('OC_Filesystem');
//enable only the encryption hook
OC_FileProxy::register(new OC_FileProxy_Encryption());
//set up temporary storage
OC_Filesystem::clearMounts();
OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
//set up the users home folder in the temp storage
$rootView = new OC_FilesystemView('');
$rootView->mkdir('/' . OC_User::getUser());
$rootView->mkdir('/' . OC_User::getUser() . '/files');
}
示例2: setUp
public function setUp()
{
$this->oldConfig = OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true');
OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
$this->oldKey = isset($_SESSION['enckey']) ? $_SESSION['enckey'] : null;
//set testing key
$_SESSION['enckey'] = md5(time());
//clear all proxies and hooks so we can do clean testing
OC_FileProxy::clearProxies();
OC_Hook::clear('OC_Filesystem');
//enable only the encryption hook
OC_FileProxy::register(new OC_FileProxy_Encryption());
//set up temporary storage
OC_Filesystem::clearMounts();
OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
//set up the users home folder in the temp storage
$rootView = new OC_FilesystemView('');
$rootView->mkdir('/' . OC_User::getUser());
$rootView->mkdir('/' . OC_User::getUser() . '/files');
}
示例3: setUp
public function setUp()
{
//clear all proxies and hooks so we can do clean testing
OC_FileProxy::clearProxies();
OC_Hook::clear('OC_Filesystem');
//enable only the encryption hook if needed
if (OC_App::isEnabled('files_encryption')) {
OC_FileProxy::register(new OC_FileProxy_Encryption());
}
//set up temporary storage
OC_Filesystem::clearMounts();
OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
OC_User::clearBackends();
OC_User::useBackend(new OC_User_Dummy());
//login
OC_User::createUser('test', 'test');
$this->user = OC_User::getUser();
OC_User::setUserId('test');
//set up the users dir
$rootView = new OC_FilesystemView('');
$rootView->mkdir('/test');
$this->instance = new OC_Cache_File();
}
示例4: setUp
public function setUp()
{
OC_Filesystem::clearMounts();
}