Exemplo n.º 1
0
 /**
  * @return bool
  */
 public function getDatabaseExists()
 {
     if (strpos($this->_currentElement->getHtmlId(), 'dbName2') !== false) {
         $value1 = Mage::registry('system_fastindexer_dbName1');
         if (strtolower($this->_currentElement->getValue()) === strtolower($value1)) {
             return false;
         }
     }
     $dbName = $this->_currentElement->getData('value');
     if (empty($dbName)) {
         return false;
     }
     $result = $this->_connection->fetchOne('SELECT SCHEMA_NAME FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE SCHEMA_NAME=:db', ['db' => $dbName]);
     return $result !== false;
 }