本文整理汇总了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();
}