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


PHP OC_DB::enableCaching方法代码示例

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


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

示例1: upgrade

 /**
  * runs the update actions in maintenance mode, does not upgrade the source files
  */
 public function upgrade()
 {
     \OC_DB::enableCaching(false);
     \OC_Config::setValue('maintenance', true);
     $installedVersion = \OC_Config::getValue('version', '0.0.0');
     $currentVersion = implode('.', \OC_Util::getVersion());
     if ($this->log) {
         $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
     }
     $this->emit('\\OC\\Updater', 'maintenanceStart');
     try {
         \OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml');
         $this->emit('\\OC\\Updater', 'dbUpgrade');
         // do a file cache upgrade for users with files
         // this can take loooooooooooooooooooooooong
         $this->upgradeFileCache();
     } catch (\Exception $exception) {
         $this->emit('\\OC\\Updater', 'failure', array($exception->getMessage()));
     }
     \OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
     \OC_App::checkAppsRequirements();
     // load all apps to also upgrade enabled apps
     \OC_App::loadApps();
     $repair = new Repair();
     $repair->run();
     \OC_Config::setValue('maintenance', false);
     $this->emit('\\OC\\Updater', 'maintenanceEnd');
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:updater.php

示例2: upgrade

 /**
  * runs the update actions in maintenance mode, does not upgrade the source files
  */
 public function upgrade()
 {
     \OC_DB::enableCaching(false);
     \OC_Config::setValue('maintenance', true);
     $installedVersion = \OC_Config::getValue('version', '0.0.0');
     $currentVersion = implode('.', \OC_Util::getVersion());
     if ($this->log) {
         $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
     }
     $this->emit('\\OC\\Updater', 'maintenanceStart');
     // create empty file in data dir, so we can later find
     // out that this is indeed an ownCloud data directory
     // (in case it didn't exist before)
     file_put_contents(\OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
     /*
      * START CONFIG CHANGES FOR OLDER VERSIONS
      */
     if (!\OC::$CLI && version_compare($installedVersion, '6.00.4', '<')) {
         // Add the trusted_domains config if it is not existant
         // This is added to prevent host header poisoning
         \OC_Config::setValue('trusted_domains', \OC_Config::getValue('trusted_domains', array(\OC_Request::serverHost())));
     }
     /*
      * STOP CONFIG CHANGES FOR OLDER VERSIONS
      */
     try {
         \OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml');
         $this->emit('\\OC\\Updater', 'dbUpgrade');
         // do a file cache upgrade for users with files
         // this can take loooooooooooooooooooooooong
         $this->upgradeFileCache();
     } catch (\Exception $exception) {
         $this->emit('\\OC\\Updater', 'failure', array($exception->getMessage()));
     }
     \OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
     \OC_App::checkAppsRequirements();
     // load all apps to also upgrade enabled apps
     \OC_App::loadApps();
     $repair = new Repair();
     $repair->run();
     //Invalidate update feed
     \OC_Appconfig::setValue('core', 'lastupdatedat', 0);
     \OC_Config::setValue('maintenance', false);
     $this->emit('\\OC\\Updater', 'maintenanceEnd');
 }
开发者ID:hjimmy,项目名称:owncloud,代码行数:48,代码来源:updater.php

示例3: upgrade

 /**
  * runs the update actions in maintenance mode, does not upgrade the source files
  * except the main .htaccess file
  *
  * @return bool true if the operation succeeded, false otherwise
  */
 public function upgrade()
 {
     \OC_DB::enableCaching(false);
     \OC_Config::setValue('maintenance', true);
     $installedVersion = \OC_Config::getValue('version', '0.0.0');
     $currentVersion = implode('.', \OC_Util::getVersion());
     if ($this->log) {
         $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
     }
     $this->emit('\\OC\\Updater', 'maintenanceStart');
     try {
         $this->doUpgrade($currentVersion, $installedVersion);
     } catch (\Exception $exception) {
         $this->emit('\\OC\\Updater', 'failure', array($exception->getMessage()));
     }
     \OC_Config::setValue('maintenance', false);
     $this->emit('\\OC\\Updater', 'maintenanceEnd');
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:24,代码来源:updater.php

示例4: set_time_limit

<?php

set_time_limit(0);
$RUNTIME_NOAPPS = true;
require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) {
    \OC_DB::enableCaching(false);
    // initialize the event source before we enter maintenance mode because CSRF protection can terminate the script
    $updateEventSource = new OC_EventSource();
    OC_Config::setValue('maintenance', true);
    $installedVersion = OC_Config::getValue('version', '0.0.0');
    $currentVersion = implode('.', OC_Util::getVersion());
    OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, OC_Log::WARN);
    $watcher = new UpdateWatcher($updateEventSource);
    OC_Hook::connect('update', 'success', $watcher, 'success');
    OC_Hook::connect('update', 'failure', $watcher, 'failure');
    $watcher->success('Turned on maintenance mode');
    try {
        $result = OC_DB::updateDbFromStructure(OC::$SERVERROOT . '/db_structure.xml');
        $watcher->success('Updated database');
        // do a file cache upgrade for users with files
        // this can take loooooooooooooooooooooooong
        __doFileCacheUpgrade($watcher);
    } catch (Exception $exception) {
        $watcher->failure($exception->getMessage());
    }
    OC_Config::setValue('version', implode('.', OC_Util::getVersion()));
    OC_App::checkAppsRequirements();
    // load all apps to also upgrade enabled apps
    OC_App::loadApps();
    OC_Config::setValue('maintenance', false);
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:31,代码来源:update.php

示例5: upgrade

 /**
  * runs the update actions in maintenance mode, does not upgrade the source files
  * except the main .htaccess file
  *
  * @return bool true if the operation succeeded, false otherwise
  */
 public function upgrade()
 {
     $logLevel = \OC_Config::getValue('loglevel', \OCP\Util::WARN);
     $this->emit('\\OC\\Updater', 'setDebugLogLevel', array($logLevel, $this->logLevelNames[$logLevel]));
     \OC_Config::setValue('loglevel', \OCP\Util::DEBUG);
     \OC_DB::enableCaching(false);
     \OC_Config::setValue('maintenance', true);
     $installedVersion = \OC_Config::getValue('version', '0.0.0');
     $currentVersion = implode('.', \OC_Util::getVersion());
     if ($this->log) {
         $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
     }
     $this->emit('\\OC\\Updater', 'maintenanceStart');
     $success = true;
     try {
         $this->doUpgrade($currentVersion, $installedVersion);
     } catch (\Exception $exception) {
         \OCP\Util::logException('update', $exception);
         $this->emit('\\OC\\Updater', 'failure', array(get_class($exception) . ': ' . $exception->getMessage()));
         $success = false;
     }
     \OC_Config::setValue('maintenance', false);
     $this->emit('\\OC\\Updater', 'maintenanceEnd');
     $this->emit('\\OC\\Updater', 'updateEnd', array($success));
     $this->emit('\\OC\\Updater', 'resetLogLevel', array($logLevel, $this->logLevelNames[$logLevel]));
     \OC_Config::setValue('loglevel', $logLevel);
     return $success;
 }
开发者ID:droiter,项目名称:openwrt-on-android,代码行数:34,代码来源:updater.php


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