getDB(); $tablesdef = ModHelper::loadXML(__DIR__, $VERSION); echo '
The following database objects will be created:
'; require(__DIR__.__DS__."install-{$VERSION}.inc.php"); echo 'Install'; break; case 2: $db = System::getInstance()->getDB(); $error = false; $db->isTransactionSupported() && $db->startTransaction(); $tablesdef = ModHelper::loadXML(__DIR__, $VERSION); echo 'The following tables are created:
'; try { require(__DIR__.__DS__."install-{$VERSION}.inc.php"); $db->table('installinfos')->insert(array('type' => 'module', 'key' => $MOD, 'version' => $VERSION, 'attrib' => 0)); } catch (SQLException $sqlEx) { echo ''; echo 'SQL ERROR: '.$sqlEx->getMessage().'
'; if (defined('DEBUG')) echo '
'.$sqlEx->getQuery().''; $error=true; } $db->isTransactionSupported() && (($error && $db->rollback()) || $db->commit()); echo 'Go back'; break; default: throw new BadFunctionCallException('Invalid step'); } break; case 'upgrade': switch ($STEP) { default: throw new BadFunctionCallException('Invalid step'); } break; case 'validate': switch ($STEP) { case 1: echo ''; break; case 2: $this->doDefaultValidateFixes(__FILE__, $MOD, $VERSION); break; default: throw new BadFunctionCallException('Invalid step'); } break; case 'uninstall': switch ($STEP) { case 1: $db = System::getInstance()->getDB(); $tablesdef = ModHelper::loadXML(__DIR__, $VERSION); echo '
The following tables will be removed:
'; require(__DIR__.__DS__."remove-{$VERSION}.inc.php"); echo 'Uninstall'; break; case 2: $db = System::getInstance()->getDB(); $error = false; $db->isTransactionSupported() && $db->startTransaction(); $tablesdef = ModHelper::loadXML(__DIR__, $VERSION); echo 'The following objects are removed:
'; try { require(__DIR__.__DS__."remove-{$VERSION}.inc.php"); $db->table('installinfos')->delete(array('type' => 'module', 'key' => $MOD)); } catch (SQLException $sqlEx) { echo ''; echo 'SQL ERROR: '.$sqlEx->getMessage().'
'; if (defined('DEBUG')) echo '
'.$sqlEx->getQuery().''; $error=true; } $db->isTransactionSupported() && (($error && $db->rollback()) || $db->commit()); echo 'Go back'; break; default: throw new BadFunctionCallException('Invalid step'); } break; }