當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConnectionFactory::getInstance方法代碼示例

本文整理匯總了PHP中ConnectionFactory::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConnectionFactory::getInstance方法的具體用法?PHP ConnectionFactory::getInstance怎麽用?PHP ConnectionFactory::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ConnectionFactory的用法示例。


在下文中一共展示了ConnectionFactory::getInstance方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getJsonResponse

 public function getJsonResponse($lat, $long, $distance)
 {
     $this->connection = ConnectionFactory::getInstance()->createConnection(false);
     $posicaoAtualBI = new PosicaoAtualBI($this->connection);
     $jsonResponse = $posicaoAtualBI->createJSONResponse($lat, $long, $distance);
     $posicaoAtualBI->releaseConnection($this->connection);
     return $jsonResponse;
 }
開發者ID:laiello,項目名稱:imovelaqui,代碼行數:8,代碼來源:PosicaoAtualController.class.php

示例2: getJsonResponse

 public function getJsonResponse($cidade, $bairro, $rua)
 {
     $this->connection = ConnectionFactory::getInstance()->createConnection(false);
     $locEspecificaBI = new LocEspecificaBI($this->connection);
     $jsonResponse = $locEspecificaBI->getJsonResponse($cidade, $bairro, $rua);
     $locEspecificaBI->releaseConnection($this->connection);
     return $jsonResponse;
 }
開發者ID:laiello,項目名稱:imovelaqui,代碼行數:8,代碼來源:LocEspecificaController.class.php

示例3: testGetConnection

 public function testGetConnection()
 {
     $connFatory = ConnectionFactory::getInstance();
     $config = (include dirname(__FILE__) . '/_files/database.cnf.php');
     $connFatory->setConfiguration($config);
     $test1Conn1 = $connFatory->getConnction('test1');
     $this->assertType('PDO', $test1Conn1);
     $test1Conn2 = $connFatory->getConnction('test1');
     $this->assertType('PDO', $test1Conn2);
     $this->assertSame($test1Conn1, $test1Conn2);
     $test2Conn1 = $connFatory->getConnction('test2');
     $this->assertType('PDO', $test2Conn1);
     $test2Conn2 = $connFatory->getConnction('test2');
     $this->assertType('PDO', $test2Conn2);
     $this->assertSame($test2Conn1, $test2Conn2);
     $this->assertNotSame($test1Conn1, $test2Conn1);
 }
開發者ID:BGCX261,項目名稱:zigu-svn-to-git,代碼行數:17,代碼來源:ConnectionFactoryTest.php

示例4: DBConn_Login

// sf_check_account - check user id with password
// sp_reset_password - reset user's password
// sp_create_account - create user account
require 'DbInterface.php';
/*
$conn = new DBConn_Login();
$conn->connect();

$user_id = 5000000;
$user_pass = 'password_e0';

$conn->login($user_id, $user_pass);
*/
$user_id = 5000000;
$user_pass = 'password_e0';
ConnectionFactory::getInstance($user_id, $user_pass);
function testFunc1()
{
    // Connection Test Code
    $conn = new mysqli('localhost', 'admin', 'admin1', 'auth');
    /* check connection */
    if ($conn->connect_errno) {
        printf("Connect failed: %s\n", $conn->mysqli_connect_error);
        exit;
    }
    // Stored Procedure Usage
    $result = $conn->query('CALL sp_reset_password(0, \'e25558\', \'0000\')');
    $result->mysqli_free_result();
    $conn->close();
}
function testFunc2()
開發者ID:VuECASydney,項目名稱:LibraryManagement,代碼行數:31,代碼來源:dbtest.php

示例5: __construct

 private function __construct()
 {
     $this->factory = ConnectionFactory::getInstance();
     $config = RunlevelConfig::load(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'config', 'database');
     $this->factory->setConfiguration($config);
 }
開發者ID:BGCX261,項目名稱:zigu-svn-to-git,代碼行數:6,代碼來源:PollConnectionFactory.php

示例6: releaseConnection

 public function releaseConnection($connection)
 {
     ConnectionFactory::getInstance()->releaseConnection($connection);
 }
開發者ID:laiello,項目名稱:imovelaqui,代碼行數:4,代碼來源:GenericBI.class.php


注:本文中的ConnectionFactory::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。