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
bf4e4d96
Commit
bf4e4d96
authored
Nov 29, 2014
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added remote metadata.json file support to plugins and themes
parent
fc1014f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Metadata.php
qa-include/Q2A/Util/Metadata.php
+12
-0
version.php
qa-include/ajax/version.php
+2
-2
No files found.
qa-include/Q2A/Util/Metadata.php
View file @
bf4e4d96
...
...
@@ -52,4 +52,15 @@ class Q2A_Util_Metadata
return
array
();
}
/**
* Fetch metadata information from an URL
* @param string $url URL linking to a metadata.json file
* @return array The metadata fetched from the file
*/
public
function
fetchFromUrl
(
$url
)
{
$content
=
qa_retrieve_url
(
$url
);
return
$this
->
getArrayFromJson
(
$content
);
}
}
\ No newline at end of file
qa-include/ajax/version.php
View file @
bf4e4d96
...
...
@@ -22,12 +22,12 @@
require_once
QA_INCLUDE_DIR
.
'app/admin.php'
;
$uri
=
qa_post_text
(
'uri'
);
$type
=
(
qa_post_text
(
'type'
)
===
'Theme'
?
'Theme'
:
'Plugin'
);
$version
=
qa_post_text
(
'version'
);
$metadata
=
qa_addon_metadata
(
qa_retrieve_url
(
$uri
),
$type
);
$metadataUtil
=
new
Q2A_Util_Metadata
();
$metadata
=
$metadataUtil
->
fetchFromUrl
(
$uri
);
if
(
strlen
(
@
$metadata
[
'version'
]))
{
if
(
strcmp
(
$metadata
[
'version'
],
$version
))
{
...
...
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