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
bc2b20a1
Commit
bc2b20a1
authored
Apr 04, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix external code to load optional plugins
parent
c58e4c19
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
23 deletions
+34
-23
page.php
qa-include/app/page.php
+0
-23
qa-ajax.php
qa-include/qa-ajax.php
+1
-0
qa-base.php
qa-include/qa-base.php
+30
-0
qa-blob.php
qa-include/qa-blob.php
+1
-0
qa-image.php
qa-include/qa-image.php
+1
-0
qa-index.php
qa-include/qa-index.php
+1
-0
No files found.
qa-include/app/page.php
View file @
bc2b20a1
...
...
@@ -33,29 +33,6 @@ require_once QA_INCLUDE_DIR . 'db/selects.php';
/**
* Standard database failure handler function which bring up the install/repair/upgrade page
* @param $type
* @param int $errno
* @param string $error
* @param string $query
* @return mixed
*/
function
qa_page_db_fail_handler
(
$type
,
$errno
=
null
,
$error
=
null
,
$query
=
null
)
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$pass_failure_type
=
$type
;
$pass_failure_errno
=
$errno
;
$pass_failure_error
=
$error
;
$pass_failure_query
=
$query
;
require_once
QA_INCLUDE_DIR
.
'qa-install.php'
;
qa_exit
(
'error'
);
}
/**
* Queue any pending requests which are required independent of which page will be shown
*/
function
qa_page_queue_pending
()
...
...
qa-include/qa-ajax.php
View file @
bc2b20a1
...
...
@@ -32,6 +32,7 @@ header('Content-Type: text/plain; charset=utf-8');
// Load the Q2A base file which sets up a bunch of crucial functions
$qa_autoconnect
=
false
;
require
'qa-base.php'
;
qa_report_process_stage
(
'init_ajax'
);
...
...
qa-include/qa-base.php
View file @
bc2b20a1
...
...
@@ -68,6 +68,12 @@ qa_initialize_predb_plugins();
require_once
QA_INCLUDE_DIR
.
'qa-db.php'
;
qa_db_allow_connect
();
// $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_initialize_postdb_plugins
();
}
// Version comparison functions
...
...
@@ -383,6 +389,7 @@ function qa_initialize_predb_plugins()
qa_load_override_files
();
}
/**
* Load plugins after database is available. Plugins loaded here are able to be disabled in admin.
*/
...
...
@@ -399,6 +406,29 @@ function qa_initialize_postdb_plugins()
/**
* Standard database failure handler function which bring up the install/repair/upgrade page
* @param $type
* @param int $errno
* @param string $error
* @param string $query
* @return mixed
*/
function
qa_page_db_fail_handler
(
$type
,
$errno
=
null
,
$error
=
null
,
$query
=
null
)
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$pass_failure_type
=
$type
;
$pass_failure_errno
=
$errno
;
$pass_failure_error
=
$error
;
$pass_failure_query
=
$query
;
require_once
QA_INCLUDE_DIR
.
'qa-install.php'
;
qa_exit
(
'error'
);
}
/**
* Retrieve metadata information from the $contents of a qa-theme.php or qa-plugin.php file, specified by $type ('Plugin' or 'Theme').
* If $versiononly is true, only min version metadata is parsed.
* Name, Description, Min Q2A & Min PHP are not currently used by themes.
...
...
qa-include/qa-blob.php
View file @
bc2b20a1
...
...
@@ -34,6 +34,7 @@ function qa_blob_db_fail_handler()
// Load the Q2A base file which sets up a bunch of crucial stuff
$qa_autoconnect
=
false
;
require
'qa-base.php'
;
qa_report_process_stage
(
'init_blob'
);
...
...
qa-include/qa-image.php
View file @
bc2b20a1
...
...
@@ -34,6 +34,7 @@ function qa_image_db_fail_handler()
// Load the Q2A base file which sets up a bunch of crucial stuff
$qa_autoconnect
=
false
;
require
'qa-base.php'
;
qa_report_process_stage
(
'init_image'
);
...
...
qa-include/qa-index.php
View file @
bc2b20a1
...
...
@@ -43,6 +43,7 @@ elseif (isset($_GET['qa']) && $_GET['qa'] == 'blob') {
else
{
// Otherwise, load the Q2A base file which sets up a bunch of crucial stuff
$qa_autoconnect
=
false
;
require
'qa-base.php'
;
/**
...
...
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