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


PHP IConfig::deleteSystemValue方法代码示例

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


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

示例1: run

 /**
  * @param $argument
  */
 protected function run($argument)
 {
     // Delete old tokens after 2 days
     if ($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) {
         $this->config->deleteSystemValue('updater.secret');
     }
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:10,代码来源:ResetTokenBackgroundJob.php

示例2: 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';
     $this->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);
     $this->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, \OCA\Files_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);
 }
开发者ID:samj1912,项目名称:repo,代码行数:35,代码来源:crypt.php

示例3: setMailSettings

 /**
  * Sets the email settings
  * @param string $mail_domain
  * @param string $mail_from_address
  * @param string $mail_smtpmode
  * @param string $mail_smtpsecure
  * @param string $mail_smtphost
  * @param string $mail_smtpauthtype
  * @param int $mail_smtpauth
  * @param string $mail_smtpport
  * @return array
  */
 public function setMailSettings($mail_domain, $mail_from_address, $mail_smtpmode, $mail_smtpsecure, $mail_smtphost, $mail_smtpauthtype, $mail_smtpauth, $mail_smtpport)
 {
     $params = get_defined_vars();
     foreach ($params as $key => $value) {
         if (empty($value)) {
             $this->config->deleteSystemValue($key);
         } else {
             $this->config->setSystemValue($key, $value);
         }
     }
     // Delete passwords from config in case no auth is specified
     if ($params['mail_smtpauth'] !== 1) {
         $this->config->deleteSystemValue('mail_smtpname');
         $this->config->deleteSystemValue('mail_smtppassword');
     }
     return array('data' => array('message' => (string) $this->l10n->t('Saved')), 'status' => 'success');
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:29,代码来源:mailsettingscontroller.php


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