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


PHP IConfig::getAppValue方法代码示例

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


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

示例1: run

 /**
  * Enables the files app if it is disabled
  */
 public function run()
 {
     if ($this->config->getAppValue('files', 'enabled', 'no') !== 'yes') {
         $this->config->setAppValue('files', 'enabled', 'yes');
         $this->emit('\\OC\\Repair', 'info', ['Files app was disabled - re-enabled']);
     }
 }
开发者ID:yheric455042,项目名称:owncloud82,代码行数:10,代码来源:enablefilesapp.php

示例2: index

 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  *
  * @return TemplateResponse
  */
 public function index()
 {
     $userId = $this->userSession->getUser()->getUID();
     $appVersion = $this->config->getAppValue($this->appName, 'installed_version');
     $defaultView = $this->config->getUserValue($userId, $this->appName, 'currentView', 'month');
     return new TemplateResponse('calendar', 'main', ['appVersion' => $appVersion, 'defaultView' => $defaultView]);
 }
开发者ID:dominicrico,项目名称:calendar-rework,代码行数:13,代码来源:viewcontroller.php

示例3: run

 /**
  * @param $argument
  * @throws \Exception
  */
 protected function run($argument)
 {
     $maxAge = $this->expiration->getMaxAgeAsTimestamp();
     if (!$maxAge) {
         return;
     }
     $offset = $this->config->getAppValue('files_trashbin', 'cronjob_user_offset', 0);
     $users = $this->userManager->search('', self::USERS_PER_SESSION, $offset);
     if (!count($users)) {
         // No users found, reset offset and retry
         $offset = 0;
         $users = $this->userManager->search('', self::USERS_PER_SESSION);
     }
     $offset += self::USERS_PER_SESSION;
     $this->config->setAppValue('files_trashbin', 'cronjob_user_offset', $offset);
     foreach ($users as $user) {
         $uid = $user->getUID();
         if (!$this->setupFS($uid)) {
             continue;
         }
         $dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
         Trashbin::deleteExpiredFiles($dirContent, $uid);
     }
     \OC_Util::tearDownFS();
 }
开发者ID:loulancn,项目名称:core,代码行数:29,代码来源:expiretrash.php

示例4: 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

示例5: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($this->config->getAppValue('core', 'encryption_enabled', 'no') === 'yes') {
         $output->writeln('Encryption is already enabled');
     } else {
         $this->config->setAppValue('core', 'encryption_enabled', 'yes');
         $output->writeln('<info>Encryption enabled</info>');
     }
     $output->writeln('');
     $modules = $this->encryptionManager->getEncryptionModules();
     if (empty($modules)) {
         $output->writeln('<error>No encryption module is loaded</error>');
     } else {
         $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null);
         if ($defaultModule === null) {
             $output->writeln('<error>No default module is set</error>');
         } else {
             if (!isset($modules[$defaultModule])) {
                 $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>');
             } else {
                 $output->writeln('Default module: ' . $defaultModule);
             }
         }
     }
 }
开发者ID:kenwi,项目名称:core,代码行数:25,代码来源:enable.php

示例6: upgrade

 public function upgrade()
 {
     $previousVersion = $this->config->getAppValue($this->appName, 'installed_version');
     if (version_compare($previousVersion, '7', '<')) {
         $this->itemService->generateSearchIndices();
     }
 }
开发者ID:cs-team,项目名称:news,代码行数:7,代码来源:upgrade.php

示例7: isSharingEnabled

 /**
  * Checks whether public sharing (via links) is enabled
  *
  * @return bool
  */
 private function isSharingEnabled()
 {
     $shareApiAllowLinks = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
     if ($shareApiAllowLinks !== 'yes') {
         return false;
     }
     return true;
 }
开发者ID:efueger,项目名称:galleryplus,代码行数:13,代码来源:sharingcheckmiddleware.php

示例8: getData

 /**
  * @return array (string => string|int)
  */
 public function getData()
 {
     $data = ['enabled' => $this->config->getAppValue('core', 'encryption_enabled', 'no') ? 'yes' : 'no', 'default_module' => $this->config->getAppValue('core', 'default_encryption_module') === 'OC_DEFAULT_MODULE' ? 'yes' : 'no'];
     if ($data['enabled'] === 'yes') {
         unset($data['default_module']);
     }
     return $data;
 }
开发者ID:schiessle,项目名称:popularitycontestclient,代码行数:11,代码来源:encryption.php

示例9: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($this->config->getAppValue('core', 'encryption_enabled', 'no') !== 'yes') {
         $output->writeln('Encryption is already disabled');
     } else {
         $this->config->setAppValue('core', 'encryption_enabled', 'no');
         $output->writeln('<info>Encryption disabled</info>');
     }
 }
开发者ID:evanjt,项目名称:core,代码行数:9,代码来源:disable.php

示例10: __construct

 /**
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     // Load config values
     if ($this->config->getAppValue('files_external', 'allow_user_mounting', 'yes') !== 'yes') {
         $this->userMountingAllowed = false;
     }
     $this->userMountingBackends = explode(',', $this->config->getAppValue('files_external', 'user_mounting_backends', ''));
 }
开发者ID:0x17de,项目名称:core,代码行数:12,代码来源:backendservice.php

示例11: fixOcsId

 /**
  * @param string $appName
  * @param string $oldId
  * @param string $newId
  * @return bool True if updated, false otherwise
  */
 public function fixOcsId($appName, $oldId, $newId)
 {
     $existingId = $this->config->getAppValue($appName, 'ocsid');
     if ($existingId === $oldId) {
         $this->config->setAppValue($appName, 'ocsid', $newId);
         return true;
     }
     return false;
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:15,代码来源:updateoutdatedocsids.php

示例12: __construct

 /**
  * @param IConfig $config
  * @param View $view
  * @param Connection $connection
  * @param ILogger $logger
  */
 public function __construct(IConfig $config, View $view, Connection $connection, ILogger $logger)
 {
     $this->view = $view;
     $this->view->getUpdater()->disable();
     $this->connection = $connection;
     $this->moduleId = \OCA\Encryption\Crypto\Encryption::ID;
     $this->config = $config;
     $this->logger = $logger;
     $this->installedVersion = $this->config->getAppValue('files_encryption', 'installed_version', '-1');
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:16,代码来源:migration.php

示例13: getDirtyShares

 /**
  * Get all shares we need to update the etag for
  *
  * @param array $shares the shares for the users
  * @return string[]
  */
 protected function getDirtyShares($shares)
 {
     $dirty = [];
     $userTime = $this->config->getUserValue($this->userId, 'files_sharing', 'last_propagate', 0);
     foreach ($shares as $share) {
         $updateTime = $this->config->getAppValue('files_sharing', $share['id'], 0);
         if ($updateTime >= $userTime) {
             $dirty[] = $share;
         }
     }
     return $dirty;
 }
开发者ID:brunomilet,项目名称:owncloud-core,代码行数:18,代码来源:recipientpropagator.php

示例14: __construct

 /**
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     // Load config values
     if ($this->config->getAppValue('files_external', 'allow_user_mounting', 'yes') !== 'yes') {
         $this->userMountingAllowed = false;
     }
     $this->userMountingBackends = explode(',', $this->config->getAppValue('files_external', 'user_mounting_backends', ''));
     // if no backend is in the list an empty string is in the array and user mounting is disabled
     if ($this->userMountingBackends === ['']) {
         $this->userMountingAllowed = false;
     }
 }
开发者ID:kenwi,项目名称:core,代码行数:16,代码来源:backendservice.php

示例15: isSharingEnabled

 /**
  * Check whether sharing is enabled
  * @return bool
  */
 private function isSharingEnabled()
 {
     // FIXME: This check is done here since the route is globally defined and not inside the files_sharing app
     // Check whether the sharing application is enabled
     if (!$this->appManager->isEnabledForUser($this->appName)) {
         return false;
     }
     // Check whether public sharing is enabled
     if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
         return false;
     }
     return true;
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:17,代码来源:sharingcheckmiddleware.php


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