本文整理匯總了PHP中Connection::disconnect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Connection::disconnect方法的具體用法?PHP Connection::disconnect怎麽用?PHP Connection::disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Connection
的用法示例。
在下文中一共展示了Connection::disconnect方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testDisconnect
public function testDisconnect()
{
$this->assertNull($this->connection->getHandle());
$this->connection->query("SELECT DATE('now')");
$this->assertTrue(($handle = $this->connection->getHandle()) instanceof \PDO, "After connect handle should be instance of PDO, but it is: " . get_class($handle));
$this->connection->disconnect();
$this->assertNull($this->connection->getHandle());
}
示例2: testConnection
public function testConnection()
{
$this->subject->disconnect();
$result = $this->subject->connect();
$this->assertTrue($result);
// Try a reconnect
$result = $this->subject->connect();
$this->assertTrue($result);
$result = $this->subject->isConnected();
$this->assertTrue($result);
$result = $this->subject->disconnect();
$this->assertTrue($result);
$result = $this->subject->isConnected();
$this->assertFalse($result);
}
示例3: run
public static function run()
{
Connection::connect();
Session::start();
Router::run();
Connection::disconnect();
}
示例4: testDisconnect
public function testDisconnect()
{
$adapterConnection = $this->prophesize(AbstractConnection::class);
$adapterConnection->close()->shouldBeCalled();
$connection = new Connection($adapterConnection->reveal());
$result = $connection->disconnect();
static::assertInstanceOf(Connection::class, $result);
}
示例5: descargaApk
function descargaApk($array)
{
try {
if ($array != NULL) {
$con = new Connection();
$mysql = $con->connection();
$this->sql = "SELECT\n\t\t\t\taplicativo.ubicacion\n\t\t\t\tFROM usuarios\n\t\t\t\tINNER JOIN permisos on permisos.idUsuario = usuarios.id\n\t\t\t\tINNER JOIN aplicativo on aplicativo.id = permisos.idAplicativo\n\t\t\t\twhere\n\t\t\t\tusuarios.id = " . $array['usu'] . "\n\t\t\t\tand\n\t\t\t\taplicativo.id = " . $array['app'] . "\n\t\t\t\tand permisos.estado = 0";
$resultado = mysql_query($this->sql);
$fila = mysql_fetch_array($resultado);
$con->disconnect($mysql);
} else {
$fila = $array;
}
} catch (Exception $e) {
echo 'Excepción capturada: ', $e->getMessage(), "\n";
}
return $fila;
}
示例6: disconnect
function disconnect()
{
$this->mysql_connection->remove($this);
parent::disconnect();
}