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


PHP DBManagerFactory::disconnectAll方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     if (!$this->_has_mysqli_disabled) {
         unset($GLOBALS['sugar_config']['mysqli_disabled']);
     }
     $GLOBALS['sugar_config']['dbconfig']['db_manager'] = $this->_db_manager;
     unset($GLOBALS['dbinstances']);
     DBManagerFactory::disconnectAll();
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:9,代码来源:Bug34547Test.php

示例2: forkJob

 protected function forkJob($job)
 {
     DBManagerFactory::disconnectAll();
     $pid = pcntl_fork();
     if ($pid) {
         // parent - reconnect and exit
         $GLOBALS['db'] = DBManagerFactory::getInstance();
         $GLOBALS['log']->debug('After fork - parent');
         return;
     } else {
         // the child process
         $GLOBALS['log']->debug('After fork - child');
         $sid = posix_setsid();
         if ($sid < 0) {
             $this->fail($job, "Could not change session ID");
         }
         // Reestablish DB connections after fork
         $GLOBALS['db'] = DBManagerFactory::getInstance();
         parent::executeJob($job);
         $this->job = null;
         exit(0);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:SugarCronParallelJobs.php

示例3: disconnectAll

 /**
  * @deprecated
  * Disconnects all instances
  */
 public function disconnectAll()
 {
     DBManagerFactory::disconnectAll();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:8,代码来源:DBManager.php

示例4: testDisconnectAll

 public function testDisconnectAll()
 {
     DBManagerFactory::disconnectAll();
     $this->assertTrue($this->_db->checkError());
     $this->_db = DBManagerFactory::getInstance();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:6,代码来源:DBManagerTest.php

示例5: sugar_cleanup

/**
 * Clean up Sugar environment
 * @param bool $exit Should we exit() after we're done?
 */
function sugar_cleanup($exit = false)
{
    static $called = false;
    if ($called) {
        return;
    }
    $called = true;
    $root_path = sugar_root_dir();
    $paths = explode(PATH_SEPARATOR, get_include_path());
    if (in_array($root_path, $paths) == false) {
        set_include_path($root_path . PATH_SEPARATOR . get_include_path());
    }
    chdir($root_path);
    // if cleanup runs before autoloader was loaded then init autoloader.
    if (!class_exists('SugarAutoLoader')) {
        require_once 'include/utils/autoloader.php';
        SugarAutoLoader::init();
    }
    global $sugar_config;
    require_once 'include/utils/LogicHook.php';
    LogicHook::initialize();
    $GLOBALS['logic_hook']->call_custom_logic('', 'server_round_trip');
    //added this check to avoid errors during install.
    if (empty($sugar_config['dbconfig'])) {
        if ($exit) {
            exit;
        } else {
            return;
        }
    }
    if (!class_exists('Tracker', true)) {
        require_once 'modules/Trackers/Tracker.php';
    }
    Tracker::logPage();
    // Now write the cached tracker_queries
    if (class_exists("TrackerManager")) {
        $trackerManager = TrackerManager::getInstance();
        if ($monitor = $trackerManager->getMonitor('tracker_queries')) {
            $trackerManager->saveMonitor($monitor, true);
        }
    }
    if (!empty($GLOBALS['savePreferencesToDB']) && $GLOBALS['savePreferencesToDB']) {
        if (isset($GLOBALS['current_user']) && $GLOBALS['current_user'] instanceof User) {
            $GLOBALS['current_user']->savePreferencesToDB();
        }
    }
    //check to see if this is not an `ajax call AND the user preference error flag is set
    if (isset($_SESSION['USER_PREFRENCE_ERRORS']) && $_SESSION['USER_PREFRENCE_ERRORS'] && ($_REQUEST['action'] != 'modulelistmenu' && $_REQUEST['action'] != 'DynamicAction') && ($_REQUEST['action'] != 'favorites' && $_REQUEST['action'] != 'DynamicAction') && (empty($_REQUEST['to_pdf']) || !$_REQUEST['to_pdf']) && (empty($_REQUEST['sugar_body_only']) || !$_REQUEST['sugar_body_only'])) {
        global $app_strings;
        //this is not an ajax call and the user preference error flag is set, so reset the flag and print js to flash message
        $err_mess = $app_strings['ERROR_USER_PREFS'];
        $_SESSION['USER_PREFRENCE_ERRORS'] = false;
        echo "\n        <script>\n            ajaxStatus.flashStatus('{$err_mess}',7000);\n        </script>";
    }
    SugarAutoLoader::saveClassMap();
    if (class_exists('DBManagerFactory', false)) {
        DBManagerFactory::disconnectAll();
    }
    if ($exit) {
        exit;
    }
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:66,代码来源:utils.php


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