当前位置: 首页>>代码示例>>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;未经允许,请勿转载。