本文整理汇总了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']);
}
}
示例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]);
}
示例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();
}
示例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');
}
}
示例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);
}
}
}
}
示例6: upgrade
public function upgrade()
{
$previousVersion = $this->config->getAppValue($this->appName, 'installed_version');
if (version_compare($previousVersion, '7', '<')) {
$this->itemService->generateSearchIndices();
}
}
示例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;
}
示例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;
}
示例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>');
}
}
示例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', ''));
}
示例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;
}
示例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');
}
示例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;
}
示例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;
}
}
示例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;
}