Ejemplo n.º 1
0
 /**
  * Method to handle database transactions for the installer
  *
  * @return  boolean  True on success
  *
  * @since   3.4
  * @throws  RuntimeException
  */
 protected function doDatabaseTransactions()
 {
     $route = $this->route == 'discover_install' ? 'install' : $this->route;
     // Let's run the install queries for the component
     if (isset($this->getManifest()->{$route}->sql)) {
         $result = $this->parent->parseSQLFiles($this->getManifest()->{$route}->sql);
         if ($result === false) {
             // Only rollback if installing
             if ($route == 'install') {
                 throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->parent->getDbo()->stderr(true)));
             }
             return false;
         }
     }
     return true;
 }