Database::isActiveConnection

final public static function Database::isActiveConnection

final public static Database::isActiveConnection()

Determines if there is an active connection.

Note that this method will return FALSE if no connection has been established yet, even if one could be.

Return value

TRUE if there is at least one database connection established, FALSE otherwise.

File

includes/database/database.inc, line 1527
Core systems for the database layer.

Class

Database
Primary front-controller for the database system.

Code

final public static function isActiveConnection() {
  return !empty(self::$activeKey) && !empty(self::$connections) && !empty(self::$connections[self::$activeKey]);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!database.inc/function/Database::isActiveConnection/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部