本文整理汇总了PHP中OC_FileProxy::clearProxies方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_FileProxy::clearProxies方法的具体用法?PHP OC_FileProxy::clearProxies怎么用?PHP OC_FileProxy::clearProxies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_FileProxy
的用法示例。
在下文中一共展示了OC_FileProxy::clearProxies方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
// note: not using a data provider because these
// files all need to coexist to make sure the
// share keys are found properly (pattern matching)
self::$testFiles = array('t est.txt', 't est_.txt', 't est.doc.txt', 't est(.*).txt', 'multiple.dots.can.happen.too.txt', 't est.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.txt', 't est_.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey.txt', 'who would upload their.shareKey', 'user ones file.txt', 'user ones file.txt.backup', '.t est.txt');
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
\OC_Hook::clear('OC_Filesystem');
\OC_Hook::clear('OC_User');
// clear share hooks
\OC_Hook::clear('OCP\\Share');
\OC::registerShareHooks();
\OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// Sharing related hooks
\OCA\Encryption\Helper::registerShareHooks();
// clear and register proxies
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// create test user
\Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2, true);
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// enable resharing
\OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes');
// clear share hooks
\OC_Hook::clear('OCP\\Share');
\OC::registerShareHooks();
\OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
// Sharing related hooks
\OCA\Encryption\Helper::registerShareHooks();
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// create users
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, true);
// create group and assign users
\OC_Group::createGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
\OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
\OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
}
示例3: setUp
public function setUp()
{
//clear all proxies and hooks so we can do clean testing
\OC_FileProxy::clearProxies();
\OC_Hook::clear('OC_Filesystem');
//disabled atm
//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\Files\Filesystem::clearMounts();
$storage = new \OC\Files\Storage\Temporary(array());
\OC\Files\Filesystem::mount($storage, array(), '/');
$datadir = str_replace('local::', '', $storage->getId());
$this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT . '/data/cache');
\OC_Config::setValue('cachedirectory', $datadir);
\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\Files\View('');
$rootView->mkdir('/test');
$this->instance = new \OC\Cache\File();
}
示例4: tearDownAfterClass
public static function tearDownAfterClass()
{
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1);
\OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER2);
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
}
示例5: setupHooks
public static function setupHooks()
{
// Filesystem related hooks
Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new Files_Encryption\Proxy());
}
示例6: tearDownAfterClass
public static function tearDownAfterClass()
{
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
// Delete keys in /data/
$view = new \OC\Files\View('/');
$view->deleteAll('files_encryption');
parent::tearDownAfterClass();
}
示例7: tearDownAfterClass
public static function tearDownAfterClass()
{
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
// Delete keys in /data/
$view = new \OC\Files\View('/');
$view->rmdir('public-keys');
$view->rmdir('owncloud_private_key');
}
示例8: tearDownAfterClass
public static function tearDownAfterClass()
{
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1);
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
// Delete keys in /data/
$view = new \OC\Files\View('/');
$view->rmdir('public-keys');
$view->rmdir('owncloud_private_key');
}
示例9: setUpBeforeClass
public static function setUpBeforeClass()
{
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// create test user
\Test_Encryption_Util::loginHelper(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1, true);
}
示例10: setUpBeforeClass
public static function setUpBeforeClass()
{
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// disable file proxy by default
\OC_FileProxy::$enabled = false;
// create test user
\OC_User::deleteUser(\Test_Encryption_Keymanager::TEST_USER);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Keymanager::TEST_USER, true);
}
示例11: tearDownAfterClass
public static function tearDownAfterClass()
{
\OC_FileProxy::$enabled = true;
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Keymanager::TEST_USER);
// reset app files_trashbin
if (self::$stateFilesTrashbin) {
OC_App::enable('files_trashbin');
}
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
// Delete keys in /data/
$view = new \OC\Files\View('/');
$view->rmdir('public-keys');
$view->rmdir('owncloud_private_key');
}
示例12: 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');
}
示例13: setUpBeforeClass
public static function setUpBeforeClass()
{
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// create test user
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER2, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER, true);
// create groups
\OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
\OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP2);
// add user 1 to group1
\OC_Group::addToGroup(self::TEST_ENCRYPTION_UTIL_USER1, self::TEST_ENCRYPTION_UTIL_GROUP1);
}
示例14: 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');
}
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
// clear and register hooks
\OC_FileProxy::clearProxies();
\OC_FileProxy::register(new OCA\Encryption\Proxy());
// disable file proxy by default
\OC_FileProxy::$enabled = false;
// remember files_trashbin state
self::$stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
// create test user
\OC_User::deleteUser(\Test_Encryption_Keymanager::TEST_USER);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Keymanager::TEST_USER, true);
}