Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
84943773
Commit
84943773
authored
Oct 05, 2017
by
Scott
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.8' into dev
parents
f547f428
e731787d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
install.php
qa-include/db/install.php
+2
-2
qa-db.php
qa-include/qa-db.php
+11
-2
No files found.
qa-include/db/install.php
View file @
84943773
...
@@ -555,7 +555,7 @@ function qa_array_to_keys($array)
...
@@ -555,7 +555,7 @@ function qa_array_to_keys($array)
*/
*/
function
qa_db_missing_tables
(
$definitions
)
function
qa_db_missing_tables
(
$definitions
)
{
{
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
());
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
(
true
));
$missing
=
array
();
$missing
=
array
();
...
@@ -776,7 +776,7 @@ function qa_db_upgrade_tables()
...
@@ -776,7 +776,7 @@ function qa_db_upgrade_tables()
// Write-lock all Q2A tables before we start so no one can read or write anything
// Write-lock all Q2A tables before we start so no one can read or write anything
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
());
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
(
true
));
foreach
(
$definitions
as
$rawname
=>
$definition
)
foreach
(
$definitions
as
$rawname
=>
$definition
)
if
(
isset
(
$keydbtables
[
qa_db_add_table_prefix
(
$rawname
)]))
if
(
isset
(
$keydbtables
[
qa_db_add_table_prefix
(
$rawname
)]))
...
...
qa-include/qa-db.php
View file @
84943773
...
@@ -448,10 +448,19 @@ function qa_db_list_tables_lc()
...
@@ -448,10 +448,19 @@ function qa_db_list_tables_lc()
/**
/**
* Return an array of the names of all tables in the Q2A database.
* Return an array of the names of all tables in the Q2A database.
*
* @param bool $onlyTablesWithPrefix Determine if the result should only include tables with the
* QA_MYSQL_TABLE_PREFIX or if it should include all tables in the database.
*/
*/
function
qa_db_list_tables
()
function
qa_db_list_tables
(
$onlyTablesWithPrefix
=
false
)
{
{
return
qa_db_read_all_values
(
qa_db_query_raw
(
'SHOW TABLES'
));
$query
=
'SHOW TABLES'
;
if
(
$onlyTablesWithPrefix
)
{
$query
.=
' LIKE "'
.
QA_MYSQL_TABLE_PREFIX
.
'%"'
;
}
return
qa_db_read_all_values
(
qa_db_query_raw
(
$query
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment