removed temporary migrations

This commit is contained in:
Steffen Schröder 2014-05-24 20:11:34 +02:00
parent dda20f9737
commit e8c649664a
3 changed files with 3 additions and 21 deletions

View File

@ -4,6 +4,7 @@ namespace ManiaControl\Database;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Settings\SettingManager; use ManiaControl\Settings\SettingManager;
use ManiaControl\Utils\ClassUtil;
/** /**
* Database Migration Assistant * Database Migration Assistant
@ -35,8 +36,8 @@ class MigrationHelper {
* @return bool * @return bool
*/ */
public function transferSettings($sourceClass, $targetClass) { public function transferSettings($sourceClass, $targetClass) {
$sourceClass = $this->getClass($sourceClass); $sourceClass = ClassUtil::getClass($sourceClass);
$targetClass = $this->getClass($targetClass); $targetClass = ClassUtil::getClass($targetClass);
$mysqli = $this->maniaControl->database->mysqli; $mysqli = $this->maniaControl->database->mysqli;
@ -60,17 +61,4 @@ class MigrationHelper {
$statement->close(); $statement->close();
return $success; return $success;
} }
/**
* Get the Class of the given Object
*
* @param mixed $class
* @return string
*/
private function getClass($class) {
if (is_object($class)) {
return get_class($class);
}
return (string)$class;
}
} }

View File

@ -74,9 +74,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
* @see \ManiaControl\Plugins\Plugin::prepare() * @see \ManiaControl\Plugins\Plugin::prepare()
*/ */
public static function prepare(ManiaControl $maniaControl) { public static function prepare(ManiaControl $maniaControl) {
$maniaControl->database->migrationHelper->transferSettings('Dedimania\Dedimania', get_class());
$maniaControl->database->migrationHelper->transferSettings('Dedimania\DedimaniaPlugin', get_class());
$servers = $maniaControl->server->getAllServers(); $servers = $maniaControl->server->getAllServers();
foreach ($servers as $server) { foreach ($servers as $server) {
$maniaControl->settingManager->initSetting(get_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', ''); $maniaControl->settingManager->initSetting(get_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', '');

View File

@ -207,9 +207,6 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
trigger_error($mysqli->error, E_USER_ERROR); trigger_error($mysqli->error, E_USER_ERROR);
} }
// Migrate settings
$this->maniaControl->database->migrationHelper->transferSettings('KarmaPlugin', $this);
if (!$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) { if (!$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) {
return; return;
} }