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
b60a9e04
Commit
b60a9e04
authored
Jul 18, 2020
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move old PSR-0 classes
parent
763f2726
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
32 deletions
+30
-32
version.php
qa-include/ajax/version.php
+1
-1
admin.php
qa-include/app/admin.php
+3
-3
install.php
qa-include/db/install.php
+1
-1
admin-default.php
qa-include/pages/admin/admin-default.php
+1
-1
admin-plugins.php
qa-include/pages/admin/admin-plugins.php
+2
-2
qa-base.php
qa-include/qa-base.php
+3
-7
PluginManager.php
qa-src/Plugin/PluginManager.php
+7
-7
Metadata.php
qa-src/Util/Metadata.php
+6
-5
Usage.php
qa-src/Util/Usage.php
+6
-5
No files found.
qa-include/ajax/version.php
View file @
b60a9e04
...
...
@@ -54,7 +54,7 @@ if ($isCore) {
$versionResponse
=
qa_lang_html
(
'admin/version_latest_unknown'
);
}
}
else
{
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
$metadata
=
$metadataUtil
->
fetchFromUrl
(
$uri
);
if
(
strlen
(
@
$metadata
[
'version'
])
>
0
)
{
...
...
qa-include/app/admin.php
View file @
b60a9e04
...
...
@@ -122,7 +122,7 @@ function qa_admin_language_options()
$options
=
array
(
''
=>
'English (US)'
);
// find all language folders
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
foreach
(
glob
(
QA_LANG_DIR
.
'*'
,
GLOB_ONLYDIR
)
as
$directory
)
{
$code
=
basename
(
$directory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$directory
);
...
...
@@ -147,7 +147,7 @@ function qa_admin_theme_options()
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
foreach
(
glob
(
QA_THEME_DIR
.
'*'
,
GLOB_ONLYDIR
)
as
$directory
)
{
$theme
=
basename
(
$directory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$directory
);
...
...
@@ -898,7 +898,7 @@ function qa_admin_addon_metadata($contents, $fields)
*/
function
qa_admin_plugin_directory_hash
(
$directory
)
{
$pluginManager
=
new
Q2A_Plugin_
PluginManager
();
$pluginManager
=
new
\Q2A\Plugin\
PluginManager
();
$hashes
=
$pluginManager
->
getHashesForPlugins
(
array
(
$directory
));
return
reset
(
$hashes
);
...
...
qa-include/db/install.php
View file @
b60a9e04
...
...
@@ -1563,7 +1563,7 @@ function qa_db_upgrade_tables()
break
;
case
64
:
$pluginManager
=
new
Q2A_Plugin_
PluginManager
();
$pluginManager
=
new
\Q2A\Plugin\
PluginManager
();
$allPlugins
=
$pluginManager
->
getFilesystemPlugins
();
$pluginManager
->
setEnabledPlugins
(
$allPlugins
);
break
;
...
...
qa-include/pages/admin/admin-default.php
View file @
b60a9e04
...
...
@@ -1037,7 +1037,7 @@ foreach ($showoptions as $optionname) {
qa_optionfield_make_select
(
$optionfield
,
$themeoptions
,
$value
,
'Classic'
);
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
$themedirectory
=
QA_THEME_DIR
.
$value
;
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$themedirectory
);
if
(
empty
(
$metadata
))
{
...
...
qa-include/pages/admin/admin-plugins.php
View file @
b60a9e04
...
...
@@ -43,7 +43,7 @@ $qa_content['error'] = qa_admin_page_error();
$qa_content
[
'script_rel'
][]
=
'qa-content/qa-admin.js?'
.
QA_VERSION
;
$pluginManager
=
new
Q2A_Plugin_
PluginManager
();
$pluginManager
=
new
\Q2A\Plugin\
PluginManager
();
$pluginManager
->
cleanRemovedPlugins
();
$enabledPlugins
=
$pluginManager
->
getEnabledPlugins
();
...
...
@@ -116,7 +116,7 @@ foreach ($moduletypes as $type) {
if
(
!
empty
(
$fileSystemPlugins
))
{
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
$sortedPluginFiles
=
array
();
foreach
(
$fileSystemPlugins
as
$pluginDirectory
)
{
...
...
qa-include/qa-base.php
View file @
b60a9e04
...
...
@@ -28,15 +28,11 @@ define('QA_BUILD_DATE', '2019-01-12');
* Autoloads some Q2A classes so it's possible to use them without adding a require_once first. From
* version 1.9 onwards we follow PSR-4. Classes are stored in qa-src/ which maps to the 'Q2A' namespace.
* So for example \Q2A\Storage\CacheFactory maps to qa-src/Storage/CacheFactory.php.
* In version 1.7-1.8 we used PSR-0 so Q2A_Storage_CacheFactory would map to qa-include/Q2A/Storage/CacheFactory.php.
*
* @param string $class
*/
function
qa_autoload
(
$class
)
{
if
(
strpos
(
$class
,
'Q2A_'
)
===
0
)
require
QA_INCLUDE_DIR
.
strtr
(
$class
,
'_'
,
'/'
)
.
'.php'
;
if
(
strpos
(
$class
,
'Q2A\\'
)
===
0
)
{
require
QA_BASE_DIR
.
'qa-src/'
.
strtr
(
substr
(
$class
,
4
),
'\\'
,
'/'
)
.
'.php'
;
}
...
...
@@ -260,7 +256,7 @@ function qa_initialize_constants_2()
if
(
QA_DEBUG_PERFORMANCE
)
{
global
$qa_usage
;
$qa_usage
=
new
Q2A_Util_
Usage
;
$qa_usage
=
new
\Q2A\Util\
Usage
;
// ensure errors are displayed
@
ini_set
(
'display_errors'
,
'On'
);
}
...
...
@@ -386,7 +382,7 @@ function qa_register_core_modules()
function
qa_initialize_predb_plugins
()
{
global
$qa_pluginManager
;
$qa_pluginManager
=
new
Q2A_Plugin_
PluginManager
();
$qa_pluginManager
=
new
\Q2A\Plugin\
PluginManager
();
$qa_pluginManager
->
readAllPluginMetadatas
();
$qa_pluginManager
->
loadPluginsBeforeDbInit
();
...
...
@@ -439,7 +435,7 @@ function qa_page_db_fail_handler($type, $errno = null, $error = null, $query = n
* If $versiononly is true, only min version metadata is parsed.
* Name, Description, Min Q2A & Min PHP are not currently used by themes.
*
* @deprecated Deprecated from 1.7;
Q2A_Util_
Metadata class and metadata.json files should be used instead
* @deprecated Deprecated from 1.7;
\Q2A\Util\
Metadata class and metadata.json files should be used instead
* @param string $contents
* @param string $type
* @param bool|null $versiononly
...
...
qa-
include/Q2A
/Plugin/PluginManager.php
→
qa-
src
/Plugin/PluginManager.php
View file @
b60a9e04
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Plugin/PluginManager.php
Description: Keeps track of the installed plugins
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
...
...
@@ -21,7 +16,12 @@
More about this license: http://www.question2answer.org/license.php
*/
class
Q2A_Plugin_PluginManager
namespace
Q2A\Plugin
;
/**
* Keeps track of the installed plugins.
*/
class
PluginManager
{
const
PLUGIN_DELIMITER
=
';'
;
const
OPT_ENABLED_PLUGINS
=
'enabled_plugins'
;
...
...
@@ -40,7 +40,7 @@ class Q2A_Plugin_PluginManager
continue
;
}
$metadataUtil
=
new
Q2A_Util_
Metadata
();
$metadataUtil
=
new
\Q2A\Util\
Metadata
();
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$pluginDirectory
);
if
(
empty
(
$metadata
))
{
// limit plugin parsing to first 8kB
...
...
qa-
include/Q2A
/Util/Metadata.php
→
qa-
src
/Util/Metadata.php
View file @
b60a9e04
...
...
@@ -3,10 +3,6 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Metadata.php
Description: Some useful metadata handling stuff
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
...
...
@@ -20,7 +16,12 @@
More about this license: http://www.question2answer.org/license.php
*/
class
Q2A_Util_Metadata
namespace
Q2A\Util
;
/**
* Some useful metadata handling stuff.
*/
class
Metadata
{
const
METADATA_FILE_JSON
=
'metadata.json'
;
...
...
qa-
include/Q2A
/Util/Usage.php
→
qa-
src
/Util/Usage.php
View file @
b60a9e04
...
...
@@ -3,10 +3,6 @@
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/Q2A/Util/Usage.php
Description: Debugging stuff, currently used for tracking resource usage
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
...
...
@@ -20,7 +16,12 @@
More about this license: http://www.question2answer.org/license.php
*/
class
Q2A_Util_Usage
namespace
Q2A\Util
;
/**
* Debugging stuff, currently used for tracking resource usage.
*/
class
Usage
{
private
$stages
;
private
$startUsage
;
...
...
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