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
4aef3f2c
Commit
4aef3f2c
authored
Mar 20, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor qa_load_plugin_files to use qa_addon_metadata
parent
3973ffd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
qa-base.php
qa-include/qa-base.php
+17
-16
No files found.
qa-include/qa-base.php
View file @
4aef3f2c
...
@@ -311,28 +311,29 @@
...
@@ -311,28 +311,29 @@
{
{
global
$qa_plugin_directory
,
$qa_plugin_urltoroot
;
global
$qa_plugin_directory
,
$qa_plugin_urltoroot
;
$pluginfiles
=
glob
(
QA_PLUGIN_DIR
.
'*/qa-plugin.php'
);
$pluginfiles
=
glob
(
QA_PLUGIN_DIR
.
'*/qa-plugin.php'
);
foreach
(
$pluginfiles
as
$pluginfile
)
foreach
(
$pluginfiles
as
$pluginfile
)
{
if
(
file_exists
(
$pluginfile
))
{
// limit plugin parsing to first 8kB
$contents
=
file_get_contents
(
$pluginfile
);
$contents
=
file_get_contents
(
$pluginfile
,
false
,
NULL
,
-
1
,
8192
);
$metadata
=
qa_addon_metadata
(
$contents
,
'Plugin'
);
if
(
preg_match
(
'/Plugin[ \t]*Minimum[ \t]*Question2Answer[ \t]*Version\:[ \t]*([0-9\.]+)\s/i'
,
$contents
,
$matches
))
// skip plugin which requires a later version of Q2A
if
(
qa_qa_version_below
(
$matches
[
1
]))
if
(
isset
(
$metadata
[
'min_q2a'
])
&&
qa_qa_version_below
(
$metadata
[
'min_q2a'
]))
continue
;
// skip plugin which requires a later version of Q2A
continue
;
// skip plugin which requires a later version of PHP
if
(
isset
(
$metadata
[
'min_php'
])
&&
qa_php_version_below
(
$metadata
[
'min_php'
]))
continue
;
if
(
preg_match
(
'/Plugin[ \t]*Minimum[ \t]*PHP[ \t]*Version\:[ \t]*([0-9\.]+)\s/i'
,
$contents
,
$matches
))
// these variables are utilized in the qa_register_plugin_* functions
if
(
qa_php_version_below
(
$matches
[
1
]))
$qa_plugin_directory
=
dirname
(
$pluginfile
)
.
'/'
;
continue
;
// skip plugin which requires a later version of PHP
$qa_plugin_urltoroot
=
substr
(
$qa_plugin_directory
,
strlen
(
QA_BASE_DIR
));
$qa_plugin_directory
=
dirname
(
$pluginfile
)
.
'/'
;
$qa_plugin_urltoroot
=
substr
(
$qa_plugin_directory
,
strlen
(
QA_BASE_DIR
));
require_once
$pluginfile
;
require_once
$pluginfile
;
$qa_plugin_directory
=
null
;
$qa_plugin_urltoroot
=
null
;
}
}
$qa_plugin_directory
=
null
;
$qa_plugin_urltoroot
=
null
;
}
}
...
...
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