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


PHP DBUtil::whereUpdate方法代码示例

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


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

示例1: updateServerConfigSettings

 function updateServerConfigSettings()
 {
     global $default;
     $port = $_SERVER['SERVER_PORT'] + 0;
     if ($port > 0) {
         DBUtil::whereUpdate('config_settings', array('value' => $port), array('item' => 'internal_server_port', 'group_name' => 'server'));
     }
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:UpgradeFunctions.inc.php

示例2: do_update

 function do_update()
 {
     $sTable = KTUtil::getTableName('plugins');
     $aIds = (array) KTUtil::arrayGet($_REQUEST, 'pluginids');
     // Update disabled plugins
     $sIds = implode(',', $aIds);
     $sQuery = "UPDATE {$sTable} SET disabled = 1 WHERE id NOT IN ({$sIds})";
     DBUtil::runQuery(array($sQuery));
     // Select disabled plugins that have been enabled
     $sQuery = "SELECT * FROM {$sTable} WHERE disabled = 1 AND id IN ({$sIds})";
     $res = DBUtil::getResultArray($sQuery);
     if (!PEAR::isError($res)) {
         // Enable the disabled plugins
         $sQuery = "UPDATE {$sTable} SET disabled = 0 WHERE id IN ({$sIds})";
         DBUtil::runQuery(array($sQuery));
         // run setup for each plugin
         $aEnabled = array();
         if (!empty($res)) {
             foreach ($res as $item) {
                 $aEnabled[] = $item['id'];
             }
             $sEnabled = implode(',', $aEnabled);
             $sQuery = "SELECT h.classname, h.pathname FROM {$sTable} p\n                    INNER JOIN plugin_helper h ON (p.namespace = h.plugin)\n                    WHERE classtype = 'plugin' AND p.id IN ({$sEnabled})";
             $res = DBUtil::getResultArray($sQuery);
             if (!PEAR::isError($res)) {
                 foreach ($res as $item) {
                     $classname = $item['classname'];
                     $path = $item['pathname'];
                     if (!empty($path)) {
                         require_once $path;
                     }
                     $oPlugin = new $classname($path);
                     $oPlugin->setup();
                 }
             }
         }
     }
     KTPluginEntity::clearAllCaches();
     // FIXME!!! Plugin manager needs to be updated to deal with this situation. This code should be in the plugin.
     //enabling or disabling Tag fieldset depending on whether tag cloud plugin is enabled or disabled.
     //Get tag cloud object
     $oTagClouPlugin = KTPluginEntity::getByNamespace('ktcore.tagcloud.plugin');
     if (!PEAR::isError($oTagClouPlugin) && !is_a($oTagClouPlugin, 'KTEntityNoObjects') && !is_null($oTagClouPlugin)) {
         if ($oTagClouPlugin->getDisabled() == '1') {
             //disable tag fieldset
             $aFV = array('disabled' => true);
             $aWFV = array('namespace' => 'tagcloud');
             $res = DBUtil::whereUpdate('fieldsets', $aFV, $aWFV);
         } else {
             //enable tag fieldset
             $aFV = array('disabled' => false);
             $aWFV = array('namespace' => 'tagcloud');
             $res = DBUtil::whereUpdate('fieldsets', $aFV, $aWFV);
         }
     }
     // we reregister the plugins to ensure they are in the correct order
     KTPluginUtil::registerPlugins();
     $this->successRedirectToMain(_kt('Plugins updated'));
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:59,代码来源:plugins.php

示例3: setItemStatus

 /**
  * Set the status of an item and any errors that may have occurred while trying to archive it.
  *
  * @param string $code The identification string
  * @param integer $status The new status of the item
  * @param string $error Optional. The error's generated during the archive
  * @return boolean
  */
 public function setItemStatus($code, $status = 1, $error = null)
 {
     $fields = array();
     $fields['status'] = $status;
     $fields['errors'] = !empty($error) ? json_encode($error) : null;
     $where = array('code' => $code);
     $res = DBUtil::whereUpdate('download_queue', $fields, $where);
     return $res;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:17,代码来源:compressionArchiveUtil.inc.php

示例4: setAvailability

 function setAvailability($sNamespace, $bAvailable = true)
 {
     $aValues = array('unavailable' => $bAvailable);
     $aWhere = array('namespace' => $sNamespace);
     $res = DBUtil::whereUpdate('plugins', $aValues, $aWhere);
     return $res;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:7,代码来源:plugin.inc.php


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