From b3bc36ac4a2dbbbf052e549a6d4c09f0fc513b92 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Wed, 30 Aug 2017 12:04:03 +0000 Subject: [PATCH] remove show queries; edit setup data files --- setup/data/base/base_actions1.sql | 3 - setup/data/base/base_area1.sql | 5 - setup/data/base/base_files2.sql | 4 - setup/data/base/base_framefiles2.sql | 4 - setup/data/base/base_nav_sub1.sql | 9 +- setup/data/client/client1.sql | 2 +- .../plugins/plugins_content_allocation.sql | 3 + setup/lib/functions.mysql.php | 391 ++++++++---------- 8 files changed, 180 insertions(+), 241 deletions(-) diff --git a/setup/data/base/base_actions1.sql b/setup/data/base/base_actions1.sql index d68597a..aac202f 100644 --- a/setup/data/base/base_actions1.sql +++ b/setup/data/base/base_actions1.sql @@ -168,9 +168,6 @@ INSERT INTO !PREFIX!_actions VALUES('615', '1', '', 'workflow_do_action', '', '' INSERT INTO !PREFIX!_actions VALUES('616', '6', '', 'workflow_inherit_down', '', '', '1'); INSERT INTO !PREFIX!_actions VALUES('617', '604', '', 'workflow_task_user_select', '', '', '1'); INSERT INTO !PREFIX!_actions VALUES('618', '604', '', 'workflow_do_action', '', '', '1'); -INSERT INTO !PREFIX!_actions VALUES('700', '700', '', 'mod_rewrite', '', '', '1'); -INSERT INTO !PREFIX!_actions VALUES('701', '700', '', 'mod_rewrite_expert', '', '', '1'); -INSERT INTO !PREFIX!_actions VALUES('702', '700', '', 'mod_rewrite_test', '', '', '1'); INSERT INTO !PREFIX!_actions VALUES('800', '802', '', 'storeallocation', '', '', '1'); INSERT INTO !PREFIX!_actions VALUES('801', '400', 'history_truncate', 'history_truncate', '', '', '1'); INSERT INTO !PREFIX!_actions VALUES('802', '401', 'history_truncate', 'history_truncate', '', '', '1'); diff --git a/setup/data/base/base_area1.sql b/setup/data/base/base_area1.sql index 35bbcd4..2667176 100644 --- a/setup/data/base/base_area1.sql +++ b/setup/data/base/base_area1.sql @@ -99,11 +99,6 @@ INSERT INTO !PREFIX!_area VALUES('601', 'workflow', 'workflow_common', '1', '1', INSERT INTO !PREFIX!_area VALUES('602', 'workflow', 'workflow_steps', '1', '1', '0'); INSERT INTO !PREFIX!_area VALUES('603', 'workflow', 'workflow_step_edit', '1', '1', '0'); INSERT INTO !PREFIX!_area VALUES('604', 'con', 'con_workflow', '0', '1', '0'); -INSERT INTO !PREFIX!_area VALUES('700', '0', 'mod_rewrite', '1', '1', '1'); -INSERT INTO !PREFIX!_area VALUES('701', 'mod_rewrite', 'mod_rewrite_expert', '1', '1', '1'); -INSERT INTO !PREFIX!_area VALUES('702', 'mod_rewrite', 'mod_rewrite_test', '1', '1', '1'); -INSERT INTO !PREFIX!_area VALUES('801', '0', 'content_allocation', '1', '1', '0'); -INSERT INTO !PREFIX!_area VALUES('802', 'con', 'con_contentallocation', '1', '1', '0'); INSERT INTO !PREFIX!_area VALUES('811', 'system', 'system_purge', '1', '1', '0'); INSERT INTO !PREFIX!_area VALUES('812', 'system', 'db_backup', '1', '1', '0'); INSERT INTO !PREFIX!_area VALUES('990', '0', 'pluginmanager', '1', '1', '1'); \ No newline at end of file diff --git a/setup/data/base/base_files2.sql b/setup/data/base/base_files2.sql index a06c9df..942f4e7 100644 --- a/setup/data/base/base_files2.sql +++ b/setup/data/base/base_files2.sql @@ -2,10 +2,6 @@ INSERT INTO !PREFIX!_files VALUES('602', '601', 'workflow/includes/include.workf INSERT INTO !PREFIX!_files VALUES('603', '600', 'workflow/includes/include.workflow_subnav.php', 'main'); INSERT INTO !PREFIX!_files VALUES('604', '602', 'workflow/includes/include.workflow_steps.php', 'main'); INSERT INTO !PREFIX!_files VALUES('605', '604', 'workflow/includes/include.workflow_tasks.php', 'main'); -INSERT INTO !PREFIX!_files VALUES('700', '52', 'include.subnav_blank.php', 'main'); -INSERT INTO !PREFIX!_files VALUES('701', '700', 'mod_rewrite/includes/include.mod_rewrite_content.php', 'main'); -INSERT INTO !PREFIX!_files VALUES('702', '701', 'mod_rewrite/includes/include.mod_rewrite_contentexpert.php', 'main'); -INSERT INTO !PREFIX!_files VALUES('703', '702', 'mod_rewrite/includes/include.mod_rewrite_contenttest.php', 'main'); INSERT INTO !PREFIX!_files VALUES('800', '801', 'content_allocation/includes/include.left_top.php', 'main'); INSERT INTO !PREFIX!_files VALUES('801', '801', 'content_allocation/includes/include.left_bottom.php', 'main'); INSERT INTO !PREFIX!_files VALUES('802', '801', 'content_allocation/includes/include.right_top.php', 'main'); diff --git a/setup/data/base/base_framefiles2.sql b/setup/data/base/base_framefiles2.sql index 9c44225..3f9580a 100644 --- a/setup/data/base/base_framefiles2.sql +++ b/setup/data/base/base_framefiles2.sql @@ -1,9 +1,5 @@ INSERT INTO !PREFIX!_frame_files VALUES('605', '604', '3', '11151'); INSERT INTO !PREFIX!_frame_files VALUES('606', '604', '4', '605'); -INSERT INTO !PREFIX!_frame_files VALUES('700', '52', '3', '700'); -INSERT INTO !PREFIX!_frame_files VALUES('701', '700', '4', '701'); -INSERT INTO !PREFIX!_frame_files VALUES('702', '701', '4', '702'); -INSERT INTO !PREFIX!_frame_files VALUES('703', '702', '4', '703'); INSERT INTO !PREFIX!_frame_files VALUES('800', '801', '1', '800'); INSERT INTO !PREFIX!_frame_files VALUES('801', '801', '2', '801'); INSERT INTO !PREFIX!_frame_files VALUES('803', '801', '4', '803'); diff --git a/setup/data/base/base_nav_sub1.sql b/setup/data/base/base_nav_sub1.sql index 2bdb9d0..3a2c3c2 100644 --- a/setup/data/base/base_nav_sub1.sql +++ b/setup/data/base/base_nav_sub1.sql @@ -81,11 +81,4 @@ INSERT INTO !PREFIX!_nav_sub VALUES('402', '0', '402', '1', 'navigation/style/js INSERT INTO !PREFIX!_nav_sub VALUES('397', '0', '71', '1', 'navigation/style/tpleditor/file', '1'); INSERT INTO !PREFIX!_nav_sub VALUES('403', '0', '403', '1', 'navigation/style/tpleditor/history', '1'); INSERT INTO !PREFIX!_nav_sub VALUES('805', '0', '811', '1', 'navigation/administration/system/purge', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('806', '0', '812', '1', 'navigation/administration/system/db_backup', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('610', '3', '16', '0', 'navigation/extra/newsletter', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('800', '3', '801', '0', 'content_allocation/xml/;navigation/extra/content_allocation/main', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('801', '0', '802', '1', 'content_allocation/xml/;navigation/extra/content_allocation/main', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('700', '3', '700', '0', 'mod_rewrite/xml/;navigation/extras/mod_rewrite/main', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('701', '0', '700', '1', 'mod_rewrite/xml/;navigation/extras/mod_rewrite/settings', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('702', '0', '701', '1', 'mod_rewrite/xml/;navigation/extras/mod_rewrite/expert', '1'); -INSERT INTO !PREFIX!_nav_sub VALUES('703', '0', '702', '1', 'mod_rewrite/xml/;navigation/extras/mod_rewrite/test', '1'); \ No newline at end of file +INSERT INTO !PREFIX!_nav_sub VALUES('806', '0', '812', '1', 'navigation/administration/system/db_backup', '1'); \ No newline at end of file diff --git a/setup/data/client/client1.sql b/setup/data/client/client1.sql index f74f4ee..b4a2325 100644 --- a/setup/data/client/client1.sql +++ b/setup/data/client/client1.sql @@ -1,3 +1,3 @@ -INSERT INTO !PREFIX!_clients VALUES('1', 'ConLite Demo', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '/var/www/cl_demo/cms/', 'http://local.dceserver.de/cl_demo/cms/', '4', '2'); +INSERT INTO !PREFIX!_clients VALUES('1', 'ConLite Demo', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '/cms/', '/cms/', '4', '2'); INSERT INTO !PREFIX!_clients_lang VALUES('1', '1', '1'); INSERT INTO !PREFIX!_lang VALUES('1', 'Deutsch', '1', '48a365b4ce1e322a55ae9017f3daf0c0', '2015-06-22 14:33:45', '2015-06-22 14:34:17', 'utf-8', 'ltr'); \ No newline at end of file diff --git a/setup/data/plugins/plugins_content_allocation.sql b/setup/data/plugins/plugins_content_allocation.sql index f15f492..6ff2c4c 100644 --- a/setup/data/plugins/plugins_content_allocation.sql +++ b/setup/data/plugins/plugins_content_allocation.sql @@ -1,2 +1,5 @@ +INSERT INTO !PREFIX!_area VALUES('801', '0', 'content_allocation', '1', '1', '0'); +INSERT INTO !PREFIX!_area VALUES('802', 'con', 'con_contentallocation', '1', '1', '0'); + INSERT INTO !PREFIX!_nav_sub VALUES('800', '3', '801', '0', 'content_allocation/xml/;navigation/extra/content_allocation/main', '1'); INSERT INTO !PREFIX!_nav_sub VALUES('801', '0', '802', '1', 'content_allocation/xml/;navigation/extra/content_allocation/main', '1'); \ No newline at end of file diff --git a/setup/lib/functions.mysql.php b/setup/lib/functions.mysql.php index f57862e..ef2afac 100644 --- a/setup/lib/functions.mysql.php +++ b/setup/lib/functions.mysql.php @@ -1,4 +1,5 @@ array( - 'host' => $host, - 'user' => $username, + 'host' => $host, + 'user' => $username, 'password' => $password, ), ); - $db = new DB_Contenido($aOptions); - $sFile = '../data/logs/setup_queries.txt'; - file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND); - chmod($sFile, 0666); - if ($db->connect() == 0) - { - return array($db, false); - } else { - return array($db, true); - } + $db = new DB_Contenido($aOptions); + $sFile = '../data/logs/setup_queries.txt'; + //file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND); + chmod($sFile, 0666); + if ($db->connect() == 0) { + return array($db, false); + } else { + return array($db, true); + } } - -function getSetupMySQLDBConnection($full = true) -{ +function getSetupMySQLDBConnection($full = true) { if ($full === false) { // host, user and password $aOptions = array( 'connection' => array( - 'host' => $_SESSION["dbhost"], - 'user' => $_SESSION["dbuser"], + 'host' => $_SESSION["dbhost"], + 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"] ), - 'sequenceTable' => $_SESSION['dbprefix'].'_sequence' + 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence' ); } else { // host, database, user and password $aOptions = array( 'connection' => array( - 'host' => $_SESSION["dbhost"], + 'host' => $_SESSION["dbhost"], 'database' => $_SESSION["dbname"], - 'user' => $_SESSION["dbuser"], + 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"] ), - 'sequenceTable' => $_SESSION['dbprefix'].'_sequence' + 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence' ); } - + //$aOptions['enableProfiling'] = TRUE; $db = new DB_Contenido($aOptions); return $db; } -function fetchMySQLVersion ($db) -{ - $db->query("SELECT VERSION()"); - - if ($db->next_record()) - { - return $db->f(0); - } else { - return false; - } +function fetchMySQLVersion($db) { + $db->query("SELECT VERSION()"); + + if ($db->next_record()) { + return $db->f(0); + } else { + return false; + } } -function fetchMySQLUser ($db) -{ - $db->query("SELECT USER()"); - - if ($db->next_record()) - { - return ($db->f(0)); - } else { - return false; - } +function fetchMySQLUser($db) { + $db->query("SELECT USER()"); + + if ($db->next_record()) { + return ($db->f(0)); + } else { + return false; + } } -function checkMySQLDatabaseCreation ($db, $database) -{ - - - if (checkMySQLDatabaseExists($db, $database)) - { - return true; - } else { - - $db->query("CREATE DATABASE $database"); - - if ($db->Errno != 0) - { - return false; - } else { - return true; - } - } +function checkMySQLDatabaseCreation($db, $database) { + + + if (checkMySQLDatabaseExists($db, $database)) { + return true; + } else { + + $db->query("CREATE DATABASE $database"); + + if ($db->Errno != 0) { + return false; + } else { + return true; + } + } } -function checkMySQLDatabaseExists ($db, $database) -{ - $db->connect(); - - if (hasMySQLiExtension() && !hasMySQLExtension()) - { - if (@mysqli_select_db($database, $db->Link_ID)) - { - return true; - } else { - $db->query("SHOW DATABASES LIKE '$database'"); - - if ($db->next_record()) - { - return true; - } else { - return false; - } - } - } else { - if (@mysql_select_db($database, $db->Link_ID)) - { - return true; - } else { - $db->query("SHOW DATABASES LIKE '$database'"); - - if ($db->next_record()) - { - return true; - } else { - return false; - } - } - } +function checkMySQLDatabaseExists($db, $database) { + $db->connect(); + + if (hasMySQLiExtension() && !hasMySQLExtension()) { + if (@mysqli_select_db($database, $db->Link_ID)) { + return true; + } else { + $db->query("SHOW DATABASES LIKE '$database'"); + + if ($db->next_record()) { + return true; + } else { + return false; + } + } + } else { + if (@mysql_select_db($database, $db->Link_ID)) { + return true; + } else { + $db->query("SHOW DATABASES LIKE '$database'"); + + if ($db->next_record()) { + return true; + } else { + return false; + } + } + } } -function checkMySQLDatabaseUse ($db, $database) -{ - $db->connect(); - - if (hasMySQLiExtension() && !hasMySQLExtension()) - { - if (@mysqli_select_db($db->Link_ID, $database)) - { - return true; - } else { - return false; - } - } else { - if (@mysql_select_db($database, $db->Link_ID)) - { - return true; - } else { - return false; - } - } +function checkMySQLDatabaseUse($db, $database) { + $db->connect(); + + if (hasMySQLiExtension() && !hasMySQLExtension()) { + if (@mysqli_select_db($db->Link_ID, $database)) { + return true; + } else { + return false; + } + } else { + if (@mysql_select_db($database, $db->Link_ID)) { + return true; + } else { + return false; + } + } } -function checkMySQLTableCreation ($db, $database, $table) -{ - if (checkMySQLDatabaseUse($db, $database) == false) - { - return false; - } - - $db->query("CREATE TABLE $table (test INT( 1 ) NOT NULL) ENGINE = MYISAM ;"); - - if ($db->Errno == 0) - { - return true; - } else { - return false; - } +function checkMySQLTableCreation($db, $database, $table) { + if (checkMySQLDatabaseUse($db, $database) == false) { + return false; + } + + $db->query("CREATE TABLE $table (test INT( 1 ) NOT NULL) ENGINE = MYISAM ;"); + + if ($db->Errno == 0) { + return true; + } else { + return false; + } } -function checkMySQLLockTable ($db, $database, $table) -{ - if (checkMySQLDatabaseUse($db, $database) == false) - { - return false; - } - - $db->query("LOCK TABLES $table WRITE"); - - if ($db->Errno == 0) - { - - return true; - } else { - return false; - } +function checkMySQLLockTable($db, $database, $table) { + if (checkMySQLDatabaseUse($db, $database) == false) { + return false; + } + + $db->query("LOCK TABLES $table WRITE"); + + if ($db->Errno == 0) { + + return true; + } else { + return false; + } } -function checkMySQLUnlockTables ($db, $database) -{ - if (checkMySQLDatabaseUse($db, $database) == false) - { - return false; - } - - $db->query("UNLOCK TABLES"); - - if ($db->Errno == 0) - { - return true; - } else { - return false; - } +function checkMySQLUnlockTables($db, $database) { + if (checkMySQLDatabaseUse($db, $database) == false) { + return false; + } + + $db->query("UNLOCK TABLES"); + + if ($db->Errno == 0) { + return true; + } else { + return false; + } } -function checkMySQLDropTable ($db, $database, $table) -{ - if (checkMySQLDatabaseUse($db, $database) == false) - { - return false; - } - - $db->query("DROP TABLE $table"); +function checkMySQLDropTable($db, $database, $table) { + if (checkMySQLDatabaseUse($db, $database) == false) { + return false; + } - if ($db->Errno == 0) - { - return true; - } else { - return false; - } + $db->query("DROP TABLE $table"); + + if ($db->Errno == 0) { + return true; + } else { + return false; + } } -function checkMySQLDropDatabase ($db, $database) -{ - $db->query("DROP DATABASE $database"); +function checkMySQLDropDatabase($db, $database) { + $db->query("DROP DATABASE $database"); - if ($db->Errno == 0) - { - return true; - } else { - return false; - } + if ($db->Errno == 0) { + return true; + } else { + return false; + } } -function fetchMySQLStorageEngines ($db) -{ - $db->query("SHOW ENGINES"); - - $engines = array(); - - while ($db->next_record()) - { - $engines[] = $db->f(0); - } - - return ($engines); +function fetchMySQLStorageEngines($db) { + $db->query("SHOW ENGINES"); + + $engines = array(); + + while ($db->next_record()) { + $engines[] = $db->f(0); + } + + return ($engines); } ?> \ No newline at end of file