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
5321f11a
Commit
5321f11a
authored
Mar 24, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split plugin init code into separate functions
parent
2cf5701e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
options.php
qa-include/app/options.php
+2
-2
qa-base.php
qa-include/qa-base.php
+20
-8
qa-page.php
qa-include/qa-page.php
+1
-0
No files found.
qa-include/app/options.php
View file @
5321f11a
...
...
@@ -118,8 +118,8 @@ function qa_options_set_pending($names)
/**
* Load all of the Q2A options from the database
, unless QA_OPTIMIZE_DISTANT_DB is set in qa-config.php,
*
in which case queue the options for later retrieval
* Load all of the Q2A options from the database
.
*
From Q2A 1.8 we always load the options in a separate query regardless of QA_OPTIMIZE_DISTANT_DB.
*/
function
qa_preload_options
()
{
...
...
qa-include/qa-base.php
View file @
5321f11a
...
...
@@ -64,9 +64,10 @@ qa_initialize_constants_2();
qa_initialize_modularity
();
qa_register_core_modules
();
qa_initialize_predb_plugins
();
require_once
QA_INCLUDE_DIR
.
'qa-db.php'
;
qa_db_allow_connect
();
qa_initialize_plugins
();
// Version comparison functions
...
...
@@ -369,19 +370,30 @@ function qa_register_core_modules()
/**
* Load all plugins. They are split into two groups: plugins loaded before database is available, and those loaded afterward.
* Load plugins before database is available. Generally this includes database overrides and
* process plugins that run early in the request lifecycle.
*/
function
qa_initialize_plugins
()
function
qa_initialize_p
redb_p
lugins
()
{
$pluginManager
=
new
Q2A_Plugin_PluginManager
();
$pluginManager
->
readAllPluginMetadatas
();
global
$qa_pluginManager
;
$qa_pluginManager
=
new
Q2A_Plugin_PluginManager
();
$qa_pluginManager
->
readAllPluginMetadatas
();
$pluginManager
->
loadPluginsBeforeDbInit
();
$
qa_
pluginManager
->
loadPluginsBeforeDbInit
();
qa_load_override_files
();
}
/**
* Load plugins after database is available. Plugins loaded here are able to be disabled in admin.
*/
function
qa_initialize_postdb_plugins
()
{
global
$qa_pluginManager
;
qa_db_allow_connect
();
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
qa_preload_options
();
$pluginManager
->
loadPluginsAfterDbInit
();
$
qa_
pluginManager
->
loadPluginsAfterDbInit
();
qa_load_override_files
();
}
...
...
qa-include/qa-page.php
View file @
5321f11a
...
...
@@ -34,6 +34,7 @@ global $qa_usage;
qa_report_process_stage
(
'init_page'
);
qa_db_connect
(
'qa_page_db_fail_handler'
);
qa_initialize_postdb_plugins
();
qa_page_queue_pending
();
qa_load_state
();
...
...
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