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
f2dbb2e9
Commit
f2dbb2e9
authored
Jan 19, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate db connection code to new system
parent
2a6d8fab
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
12 deletions
+13
-12
qa-ajax.php
qa-include/qa-ajax.php
+2
-2
qa-base.php
qa-include/qa-base.php
+3
-2
qa-blob.php
qa-include/qa-blob.php
+2
-2
qa-feed.php
qa-include/qa-feed.php
+2
-2
qa-image.php
qa-include/qa-image.php
+2
-2
qa-page.php
qa-include/qa-page.php
+2
-2
No files found.
qa-include/qa-ajax.php
View file @
f2dbb2e9
...
...
@@ -78,11 +78,11 @@ $routing = array(
$operation
=
qa_post_text
(
'qa_operation'
);
if
(
isset
(
$routing
[
$operation
]))
{
qa_db_
connect
(
'qa_ajax_db_fail_handler'
);
$qa_db
->
connect
(
'qa_ajax_db_fail_handler'
);
qa_initialize_postdb_plugins
();
qa_initialize_buffering
();
require
QA_INCLUDE_DIR
.
'ajax/'
.
$routing
[
$operation
];
qa_db_
disconnect
();
$qa_db
->
disconnect
();
}
qa-include/qa-base.php
View file @
f2dbb2e9
...
...
@@ -69,12 +69,13 @@ qa_register_core_modules();
qa_initialize_predb_plugins
();
require_once
QA_INCLUDE_DIR
.
'qa-db.php'
;
qa_db_allow_connect
();
$qa_db
=
qa_service
(
'database'
);
$qa_db
->
allowConnect
();
// $qa_autoconnect defaults to true so that optional plugins will load for external code. Q2A core
// code sets $qa_autoconnect to false so that we can use custom fail handlers.
if
(
!
isset
(
$qa_autoconnect
)
||
$qa_autoconnect
!==
false
)
{
qa_db_
connect
(
'qa_page_db_fail_handler'
);
$qa_db
->
connect
(
'qa_page_db_fail_handler'
);
qa_initialize_postdb_plugins
();
}
...
...
qa-include/qa-blob.php
View file @
f2dbb2e9
...
...
@@ -43,7 +43,7 @@ qa_report_process_stage('init_blob');
require_once
QA_INCLUDE_DIR
.
'app/blobs.php'
;
qa_db_
connect
(
'qa_blob_db_fail_handler'
);
$qa_db
->
connect
(
'qa_blob_db_fail_handler'
);
qa_initialize_postdb_plugins
();
$blob
=
qa_read_blob
(
qa_get
(
'qa_blobid'
));
...
...
@@ -92,4 +92,4 @@ if (isset($blob) && isset($blob['content'])) {
header
(
'HTTP/1.0 404 Not Found'
);
}
qa_db_
disconnect
();
$qa_db
->
disconnect
();
qa-include/qa-feed.php
View file @
f2dbb2e9
...
...
@@ -102,7 +102,7 @@ function qa_feed_load_ifcategory($categoryslugs, $allkey, $catkey, &$title,
// Connect to database and get the type of feed and category requested (in some cases these are overridden later)
qa_db_
connect
(
'qa_feed_db_fail_handler'
);
$qa_db
->
connect
(
'qa_feed_db_fail_handler'
);
qa_initialize_postdb_plugins
();
$requestlower
=
strtolower
(
qa_request
());
...
...
@@ -422,7 +422,7 @@ $lines[] = '</rss>';
// Disconnect here, once all output is ready to go
qa_db_
disconnect
();
$qa_db
->
disconnect
();
// Output the XML - and we're done!
...
...
qa-include/qa-image.php
View file @
f2dbb2e9
...
...
@@ -43,7 +43,7 @@ qa_report_process_stage('init_image');
require_once
QA_INCLUDE_DIR
.
'db/cache.php'
;
qa_db_
connect
(
'qa_image_db_fail_handler'
);
$qa_db
->
connect
(
'qa_image_db_fail_handler'
);
qa_initialize_postdb_plugins
();
$blobid
=
qa_get
(
'qa_blobid'
);
...
...
@@ -89,4 +89,4 @@ if (isset($content)) {
}
}
qa_db_
disconnect
();
$qa_db
->
disconnect
();
qa-include/qa-page.php
View file @
f2dbb2e9
...
...
@@ -32,7 +32,7 @@ require_once QA_INCLUDE_DIR . 'app/page.php';
global
$qa_usage
;
qa_report_process_stage
(
'init_page'
);
qa_db_
connect
(
'qa_page_db_fail_handler'
);
$qa_db
->
connect
(
'qa_page_db_fail_handler'
);
qa_initialize_postdb_plugins
();
qa_page_queue_pending
();
...
...
@@ -62,4 +62,4 @@ if (is_array($qa_content)) {
$qa_usage
->
output
();
}
qa_db_
disconnect
();
$qa_db
->
disconnect
();
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