本文整理汇总了PHP中OCP\Config::deleteSystemValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::deleteSystemValue方法的具体用法?PHP Config::deleteSystemValue怎么用?PHP Config::deleteSystemValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\Config
的用法示例。
在下文中一共展示了Config::deleteSystemValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetGetShareFolder
/**
* test set and get share folder
*/
function testSetGetShareFolder()
{
$this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
\OCA\Files_Sharing\Helper::setShareFolder('/Shared');
$this->assertSame('/Shared', \OCA\Files_Sharing\Helper::getShareFolder());
// cleanup
\OCP\Config::deleteSystemValue('share_folder');
}
示例2: testSetGetShareFolder
/**
* test set and get share folder
*/
function testSetGetShareFolder()
{
$this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
\OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder');
$sharedFolder = \OCA\Files_Sharing\Helper::getShareFolder();
$this->assertSame('/Shared/Folder', \OCA\Files_Sharing\Helper::getShareFolder());
$this->assertTrue(\OC\Files\Filesystem::is_dir($sharedFolder));
// cleanup
\OCP\Config::deleteSystemValue('share_folder');
}
示例3: testStreamDecryptLongFileContentWithoutHeader
/**
* @medium
* Test that data that is written by the crypto stream wrapper with AES 128
* @note Encrypted data is manually prepared and decrypted here to avoid dependency on success of stream_read
* @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
* reassembly of its data
*/
public function testStreamDecryptLongFileContentWithoutHeader()
{
// Generate a a random filename
$filename = 'tmp-' . $this->getUniqueID() . '.test';
\OCP\Config::setSystemValue('cipher', 'AES-128-CFB');
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
\OCP\Config::deleteSystemValue('cipher');
// Test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// Get file contents without using any wrapper to get it's actual contents on disk
$retreivedCryptedFile = $this->view->file_get_contents($this->userId . '/files/' . $filename);
// Check that the file was encrypted before being written to disk
$this->assertNotEquals($this->dataLong . $this->dataLong, $retreivedCryptedFile);
// remove the header to check if we can also decrypt old files without a header,
// this files should fall back to AES-128
$cryptedWithoutHeader = substr($retreivedCryptedFile, Encryption\Crypt::BLOCKSIZE);
$this->view->file_put_contents($this->userId . '/files/' . $filename, $cryptedWithoutHeader);
// Re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
$decrypted = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
$this->assertEquals($this->dataLong . $this->dataLong, $decrypted);
// Teardown
$this->view->unlink($this->userId . '/files/' . $filename);
Encryption\Keymanager::deleteFileKey($this->view, $filename);
}
示例4: testRemoveSharedFolder
/**
* test update for the removal of the logical "Shared" folder. It should update
* the file_target for every share and create a physical "Shared" folder for each user
*/
function testRemoveSharedFolder()
{
self::prepareDB();
// run the update routine to remove the shared folder and replace it with a real folder
removeSharedFolder(false, 2);
// verify results
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share`');
$result = $query->execute(array());
$newDBContent = $result->fetchAll();
foreach ($newDBContent as $row) {
if ((int) $row['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
$this->assertSame('/Shared', substr($row['file_target'], 0, strlen('/Shared')));
} else {
$this->assertSame('/ShouldNotChange', $row['file_target']);
}
}
$shareFolder = \OCP\Config::getSystemValue('share_folder', '/');
$this->assertSame('/Shared', $shareFolder);
// cleanup
$this->cleanupSharedTable();
\OCP\Config::deleteSystemValue('share_folder');
}
示例5: deleteSystemValue
/**
* Delete a system wide defined value
*
* @param string $key the key of the value, under which it was saved
*/
public function deleteSystemValue($key)
{
\OCP\Config::deleteSystemValue($key);
}
示例6: testShareWithDifferentShareFolder
function testShareWithDifferentShareFolder()
{
$fileinfo = $this->view->getFileInfo($this->filename);
$folderinfo = $this->view->getFileInfo($this->folder);
$fileShare = \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, 31);
$this->assertTrue($fileShare);
\OCA\Files_Sharing\Helper::setShareFolder('/Shared/subfolder');
$folderShare = \OCP\Share::shareItem('folder', $folderinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, 31);
$this->assertTrue($folderShare);
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
$this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename));
$this->assertTrue(\OC\Files\Filesystem::file_exists('/Shared/subfolder/' . $this->folder));
//cleanup
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2);
\OCP\Share::unshare('folder', $folderinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2);
\OCP\Config::deleteSystemValue('share_folder');
}