Redaxscript\Db::getStatus PHP Method

getStatus() public static method

get the database status
Since: 2.4.0
public static getStatus ( ) : integer
return integer
    public static function getStatus()
    {
        $output = 0;
        /* has connection */
        try {
            if (self::$_config->get('dbType') === self::getDb()->getAttribute(PDO::ATTR_DRIVER_NAME)) {
                $output = self::countTablePrefix() > 7 ? 2 : 1;
            }
        } catch (PDOException $exception) {
            $output = 0;
        }
        return $output;
    }

Usage Example

Example #1
0
 /**
  * install the database
  *
  * @since 3.0.0
  *
  * @return boolean
  */
 protected function _database()
 {
     $installer = new Installer($this->_config);
     $installer->init();
     $installer->rawDrop();
     return Db::getStatus() === 1;
 }
All Usage Examples Of Redaxscript\Db::getStatus