Skip to content

Commit

Permalink
Merge pull request #24 from mobilecms-pro/master
Browse files Browse the repository at this point in the history
исправлена установка модулей, добавлен счетчик запросов
  • Loading branch information
KpuTuK authored Apr 8, 2019
2 parents b3b9553 + 93677a4 commit 77fea7a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@
$dump = str_replace('{CMS_VERSION}', '2.7.1 beta', $dump);

$queryes = explode('//=====================================//', $dump);
$i = 0;
foreach ($queryes as $query) {
@mysqli_query($link, trim($query));
if (@mysqli_query($link, trim($query))) {
$i++;
}
}

# Создаем файл конфигурации системы
Expand All @@ -199,6 +202,10 @@
?>
<div class="box">
<p>
<?php echo 'Запросов отправлено: '. count($queryes); ?>
<br />
<?php echo 'Успешно : '. count($queryes); ?>
<br />
Файл конфигурации системы успешно создан, дамп базы данных залит.
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion modules/guestbook/helpers/guestbook_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class guestbook_installer {
* Установка модуля
*/
public static function install($db) {
$db->query("CREATE TABLE #__guestbook (
$db->query("CREATE TABLE IF NOT EXISTS #__guestbook (
`message_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`user_id` INT NOT NULL ,
`username` VARCHAR( 30 ) NOT NULL ,
Expand Down
2 changes: 1 addition & 1 deletion modules/news/helpers/news_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class news_installer {
* Установка модуля
*/
public static function install($db) {
$db->query("CREATE TABLE #__news (
$db->query("CREATE TABLE IF NOT EXISTS #__news (
`news_id` int(11) NOT NULL auto_increment,
`subject` varchar(100) NOT NULL,
`text` text NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion modules/smiles/helpers/smiles_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class smiles_installer {
* Установка модуля
*/
public static function install($db) {
$db->query("CREATE TABLE #__smiles (
$db->query("CREATE TABLE IF NOT EXISTS #__smiles (
smile_id int(11) NOT NULL auto_increment,
code varchar(50) NOT NULL,
image varchar(50) NOT NULL,
Expand Down

0 comments on commit 77fea7a

Please sign in to comment.