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


PHP R::close方法代码示例

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


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

示例1: _log_focus

function _log_focus($openid, $operation, $user_info = NULL)
{
    R::addDatabase('wechat_csc', $GLOBALS['db_wechat_csc_url'], $GLOBALS['db_wechat_csc_user'], $GLOBALS['db_wechat_csc_pass']);
    R::selectDatabase('wechat_csc');
    if (!R::testConnection()) {
        exit('DB failed' . PHP_EOL);
    }
    R::freeze(true);
    try {
        $user = R::getRedBean()->dispense('wxcsc_focus');
        $user->openid = $openid;
        $user->operation = $operation;
        if ($operation == 'focus' && $user_info != NULL) {
            $user->nickname = $user_info['nickname'];
            $user->sex = $user_info['sex'];
            $user->language = $user_info['language'];
            $user->city = $user_info['city'];
            $user->province = $user_info['province'];
            $user->country = $user_info['country'];
        }
        $user_id = R::store($user);
    } catch (Exception $e) {
        header('Content-type:text/json;charset=utf-8');
        echo json_encode(['result' => 'failed', 'error' => 'db error wechat', 'details' => $e->getMessage()]);
        die;
    }
    R::close();
}
开发者ID:adexbn,项目名称:gds_wechat,代码行数:28,代码来源:api_csc.php

示例2: tearDown

 function tearDown()
 {
     // Must use nuke() to clear caches etc.
     R::nuke();
     R::close();
     $this->bbs = NULL;
     system("rm -rf " . self::DATA);
 }
开发者ID:chrispoupart,项目名称:BicBucStriim,代码行数:8,代码来源:test_bicbucstriim.php

示例3: testClose

 /**
  * Test closing database connection.
  * 
  * @return void
  */
 public function testClose()
 {
     asrt(R::$adapter->getDatabase()->isConnected(), TRUE);
     R::close();
     asrt(R::$adapter->getDatabase()->isConnected(), FALSE);
     // Can we create a database using empty setup?
     R::setup();
     $id = R::store(R::dispense('bean'));
     asrt($id > 0, TRUE);
     // Test freeze via kickstart in setup
     $toolbox = RedBean_Setup::kickstart('sqlite:/tmp/bla.txt', NULL, NULL, TRUE);
     asrt($toolbox->getRedBean()->isFrozen(), TRUE);
     // Test Oracle setup
     $toolbox = RedBean_Setup::kickstart('oracle:test-value', 'test', 'test', FALSE);
     asrt($toolbox instanceof RedBean_ToolBox, TRUE);
 }
开发者ID:daviddeutsch,项目名称:redbean-adaptive,代码行数:21,代码来源:Close.php

示例4: exit

    $_SESSION['openid'] = $openid;
}
// Query
R::addDatabase('wechat_csc', $GLOBALS['db_wechat_csc_url'], $GLOBALS['db_wechat_csc_user'], $GLOBALS['db_wechat_csc_pass']);
R::selectDatabase('wechat_csc');
if (!R::testConnection()) {
    exit('DB failed' . PHP_EOL);
}
R::freeze(true);
try {
    $user_email = R::getCell('SELECT wu.email' . '  FROM wxcsc_users wu' . ' WHERE wu.openid = :openid' . ' LIMIT 1', [':openid' => $openid]);
} catch (Exception $e) {
    header('Location: ' . $csc_url_base . '/static/html/error_message.html?msg=' . urlencode($e->getMesage()) . '&rand=' . rand() . '#mp.weixin.qq.com');
    die;
}
R::close();
_log(json_encode(['openid' => $openid, 'user_email' => $user_email]));
// Error return
if ($user_email == '') {
    if ($callback == 'user_bind_check_csc') {
        header('Location: ' . $csc_url_base . '/static/html/user_bind_1_csc.html?rand=' . rand() . '#mp.weixin.qq.com');
        die;
    } else {
        if (in_array($callback, ['extra_news', 'extra_expert', 'dc_guide', 'extra_contact'])) {
            header('Location: ' . $csc_url_base . '/static/html/' . $callback . '.html?rand=' . rand() . '#mp.weixin.qq.com');
            die;
        } else {
            if (in_array($callback, ['extra_neighbour', 'extra_docs', 'user_dcs', 'user_tasks'])) {
                header('Location: ' . $csc_url_base . '/static/html/' . $callback . '.html?rand=' . rand() . '#mp.weixin.qq.com');
                die;
            } else {
开发者ID:adexbn,项目名称:gds_wechat,代码行数:31,代码来源:user_isbind_csc.php

示例5: __destruct

 function __destruct()
 {
     R::close();
 }
开发者ID:securityigi,项目名称:kippo-graph,代码行数:4,代码来源:KippoIP.class.php

示例6: shutdown

 /**
  * Shutdown function - this is used to catch certain errors that are not otherwise trapped and
  * generate a clean screen as well as an error report to the developers.
  *
  * It also closes the RedBean connection
  */
 public function shutdown()
 {
     if ($error = error_get_last()) {
         # are we terminating with an error?
         if (isset($error['type']) && ($error['type'] == E_ERROR || $error['type'] == E_PARSE || $error['type'] == E_COMPILE_ERROR)) {
             # tell the developers about this
             $this->telladmin($error['message'], $error['type'], $error['file'], $error['line']);
             $this->make500();
         } else {
             echo '<div>There has been a system error</div>';
         }
     }
     R::close();
     # close RedBean connection
 }
开发者ID:Milwyr,项目名称:University-Publication-Website,代码行数:21,代码来源:local.php

示例7: shortIt

 private function shortIt($url, $md5)
 {
     if (!self::API_SHORT) {
         return $url;
     }
     parent::RedBeanConnect('short');
     if ($fetch = @R::findOne('short_url', '`title` = ?', [$md5])) {
         return self::API_SHORT . $fetch->keyword;
     }
     $timestamp = date('Y-m-d H:i:s');
     do {
         $uniq = '';
         $base = strtolower(hash('sha256', uniqid()));
         while (strlen($uniq) < 8) {
             $uniq .= substr($base, (int) -(strlen($base) / (1 + strlen($uniq))), 1);
         }
     } while (@R::findOne('short_url', '`keyword` = ?', [$uniq]));
     $sql = 'INSERT INTO `short`.`short_url` ';
     $sql .= "(`keyword`, `url`, `title`, `timestamp`, `ip`, `clicks`) ";
     $sql .= "VALUES ('{$uniq}', '{$url}', '{$md5}', '{$timestamp}', '";
     $sql .= getHostByName(getHostName()) . "', '0')";
     R::exec($sql);
     R::close();
     return 'http://exsubs.anidb.pl/short/' . $uniq;
 }
开发者ID:xandros15,项目名称:Saya-Bot,代码行数:25,代码来源:Fun.php

示例8: __destruct

 public function __destruct()
 {
     $this->connection = null;
     R::close();
 }
开发者ID:limweb,项目名称:webappservice,代码行数:5,代码来源:WptermsService.php

示例9: _closeDBConnection

 protected function _closeDBConnection()
 {
     R::close();
 }
开发者ID:andreyyec,项目名称:webSM,代码行数:4,代码来源:BaseModel.php

示例10: get_pe_wechat

function get_pe_wechat($staff_email)
{
    // Wechat PE
    //R::addDatabase('wechat_pe', $GLOBALS['db_wechat_pe_url'], $GLOBALS['db_wechat_pe_user'], $GLOBALS['db_wechat_pe_pass']);
    R::selectDatabase('wechat_pe');
    if (!R::testConnection()) {
        exit('DB failed' . PHP_EOL);
    }
    R::freeze(true);
    if (TEST_SEND) {
        $staff_email = DEBUG_EMAIL;
    }
    $email_prefix = explode("@", $staff_email);
    try {
        $openids = R::getAll(' SELECT openid ' . '   FROM wechat_pe.wxpe_users ' . '  WHERE email = :email_1 ' . '     OR email = :email_2 ', [':email_1' => $email_prefix[0], ':email_2' => ucfirst($email_prefix[0])]);
    } catch (Exception $e) {
        die(json_encode(['result' => 'failed', 'error' => 'db error wechat_pe', 'details' => $e->getMessage()]));
    }
    R::close();
    return $openids;
}
开发者ID:adexbn,项目名称:gds_wechat,代码行数:21,代码来源:notification_send.php

示例11: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     \R::nuke();
     \R::close();
 }
开发者ID:dazmiller,项目名称:red4,代码行数:5,代码来源:RedBeanListener.php

示例12: __destruct

 public function __destruct()
 {
     self::$dbh = null;
     R::close();
 }
开发者ID:limweb,项目名称:webappservice,代码行数:5,代码来源:Pdoconfig.php

示例13: disconnect

 public static function disconnect()
 {
     R::close();
 }
开发者ID:Hannes1,项目名称:WorstFrameworkEver,代码行数:4,代码来源:WFEDb.php

示例14: createTable

 private function createTable()
 {
     parent::RedBeanConnect(self::DB_NAME);
     $sql = 'CREATE TABLE IF NOT EXISTS `' . self::TB_NAME . '`(';
     $sql .= '`id` int(10) NOT NULL AUTO_INCREMENT,';
     $sql .= '`name` varchar(25),';
     $sql .= '`orginal` varchar(45) NOT NULL,';
     $sql .= '`icon` varchar(100) NOT NULL,';
     $sql .= '`link` varchar(100) NOT NULL,';
     $sql .= '`linkgc` varchar(100) NOT NULL,';
     $sql .= 'PRIMARY KEY (`id`)';
     $sql .= ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;';
     $sql = trim($sql);
     R::exec($sql);
     R::close();
 }
开发者ID:xandros15,项目名称:Saya-Bot,代码行数:16,代码来源:Aigis.php


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