From 1364bdb42800a407fb75f4c849ad2668e393c2ad Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 23 Sep 2017 13:58:09 +0200 Subject: [PATCH] Use default database connection --- Admin/Installer.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index 5ea82e8..e5f3d5b 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -38,10 +38,10 @@ class Installer extends InstallerAbstract { parent::install(__DIR__ . '/..', $dbPool, $info); - switch ($dbPool->get('core')->getType()) { + switch ($dbPool->get()->getType()) { case DatabaseType::MYSQL: - $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'wiki_category` ( + $dbPool->get()->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'wiki_category` ( `wiki_category_id` int(11) NOT NULL AUTO_INCREMENT, `wiki_category_name` varchar(255) NOT NULL, `wiki_category_parent` int(11) DEFAULT NULL, @@ -50,21 +50,21 @@ class Installer extends InstallerAbstract )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); - $dbPool->get('core')->con->prepare( - 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'wiki_category` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'wiki_category_ibfk_1` FOREIGN KEY (`wiki_category_parent`) REFERENCES `' . $dbPool->get('core')->prefix . 'wiki_category` (`wiki_category_id`)' + $dbPool->get()->con->prepare( + 'ALTER TABLE `' . $dbPool->get()->prefix . 'wiki_category` + ADD CONSTRAINT `' . $dbPool->get()->prefix . 'wiki_category_ibfk_1` FOREIGN KEY (`wiki_category_parent`) REFERENCES `' . $dbPool->get()->prefix . 'wiki_category` (`wiki_category_id`)' )->execute(); - $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'wiki_badge` ( + $dbPool->get()->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'wiki_badge` ( `wiki_badge_id` int(11) NOT NULL AUTO_INCREMENT, `wiki_badge_name` varchar(255) NOT NULL, PRIMARY KEY (`wiki_badge_id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); - $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'wiki_article` ( + $dbPool->get()->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'wiki_article` ( `wiki_article_id` int(11) NOT NULL AUTO_INCREMENT, `wiki_article_status` int(11) NOT NULL, `wiki_article_title` varchar(255) NOT NULL, @@ -79,14 +79,14 @@ class Installer extends InstallerAbstract )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); - $dbPool->get('core')->con->prepare( - 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'wiki_article` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'wiki_article_ibfk_1` FOREIGN KEY (`wiki_article_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`), - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'wiki_article_ibfk_2` FOREIGN KEY (`wiki_article_category`) REFERENCES `' . $dbPool->get('core')->prefix . 'wiki_category` (`wiki_category_id`);' + $dbPool->get()->con->prepare( + 'ALTER TABLE `' . $dbPool->get()->prefix . 'wiki_article` + ADD CONSTRAINT `' . $dbPool->get()->prefix . 'wiki_article_ibfk_1` FOREIGN KEY (`wiki_article_created_by`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`), + ADD CONSTRAINT `' . $dbPool->get()->prefix . 'wiki_article_ibfk_2` FOREIGN KEY (`wiki_article_category`) REFERENCES `' . $dbPool->get()->prefix . 'wiki_category` (`wiki_category_id`);' )->execute(); - $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'wiki_article_badge` ( + $dbPool->get()->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'wiki_article_badge` ( `wiki_article_badge_id` int(11) NOT NULL AUTO_INCREMENT, `wiki_article_badge_article` int(11) NOT NULL, `wiki_article_badge_badge` int(11) DEFAULT NULL, @@ -96,10 +96,10 @@ class Installer extends InstallerAbstract )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); - $dbPool->get('core')->con->prepare( - 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'wiki_article_badge` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'wiki_article_badge_ibfk_1` FOREIGN KEY (`wiki_article_badge_article`) REFERENCES `' . $dbPool->get('core')->prefix . 'wiki_article` (`wiki_article_id`), - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'wiki_article_badge_ibfk_2` FOREIGN KEY (`wiki_article_badge_badge`) REFERENCES `' . $dbPool->get('core')->prefix . 'wiki_badge` (`wiki_badge_id`)' + $dbPool->get()->con->prepare( + 'ALTER TABLE `' . $dbPool->get()->prefix . 'wiki_article_badge` + ADD CONSTRAINT `' . $dbPool->get()->prefix . 'wiki_article_badge_ibfk_1` FOREIGN KEY (`wiki_article_badge_article`) REFERENCES `' . $dbPool->get()->prefix . 'wiki_article` (`wiki_article_id`), + ADD CONSTRAINT `' . $dbPool->get()->prefix . 'wiki_article_badge_ibfk_2` FOREIGN KEY (`wiki_article_badge_badge`) REFERENCES `' . $dbPool->get()->prefix . 'wiki_badge` (`wiki_badge_id`)' )->execute(); break; }