Merge branches 'develop' and 'feature/blueprints-update' of https://github.com/getgrav/grav into feature/blueprints-update

# Conflicts:
#	composer.lock
This commit is contained in:
Matias Griese
2016-03-01 21:14:21 +02:00
5 changed files with 37 additions and 27 deletions

Binary file not shown.

13
composer.lock generated
View File

@@ -427,16 +427,16 @@
},
{
"name": "monolog/monolog",
"version": "1.17.2",
"version": "1.18.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24"
"reference": "e19b764b5c855580e8ffa7e615f72c10fd2f99cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24",
"reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/e19b764b5c855580e8ffa7e615f72c10fd2f99cc",
"reference": "e19b764b5c855580e8ffa7e615f72c10fd2f99cc",
"shasum": ""
},
"require": {
@@ -465,6 +465,7 @@
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"raven/raven": "Allow sending log messages to a Sentry server",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
@@ -474,7 +475,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.16.x-dev"
"dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -500,7 +501,7 @@
"logging",
"psr-3"
],
"time": "2015-10-14 12:51:02"
"time": "2016-03-01 18:00:40"
},
{
"name": "mrclay/minify",

View File

@@ -18,23 +18,27 @@ class GravCore extends AbstractPackageCollection
*/
public function __construct($refresh = false, $callback = null)
{
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
$this->cache = new FilesystemCache($cache_dir);
$this->raw = $this->cache->fetch(md5($this->repository));
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
$this->cache = new FilesystemCache($cache_dir);
$this->repository .= '?v=' . GRAV_VERSION;
$this->raw = $this->cache->fetch(md5($this->repository));
$this->fetch($refresh, $callback);
$this->data = json_decode($this->raw, true);
$this->data = json_decode($this->raw, true);
$this->version = isset($this->data['version']) ? $this->data['version'] : '-';
$this->date = isset($this->data['date']) ? $this->data['date'] : '-';
$this->date = isset($this->data['date']) ? $this->data['date'] : '-';
if (isset($this->data['assets'])) foreach ($this->data['assets'] as $slug => $data) {
$this->items[$slug] = new Package($data);
if (isset($this->data['assets'])) {
foreach ($this->data['assets'] as $slug => $data) {
$this->items[$slug] = new Package($data);
}
}
}
/**
* Returns the list of assets associated to the latest version of Grav
*
* @return array list of assets
*/
public function getAssets()
@@ -44,6 +48,7 @@ class GravCore extends AbstractPackageCollection
/**
* Returns the changelog list for each version of Grav
*
* @param string $diff the version number to start the diff from
*
* @return array changelog list for each version
@@ -58,7 +63,9 @@ class GravCore extends AbstractPackageCollection
foreach ($this->data['changelog'] as $version => $changelog) {
preg_match("/[\w-\.]+/", $version, $cleanVersion);
if (!$cleanVersion || version_compare($diff, $cleanVersion[0], ">=")) { continue; }
if (!$cleanVersion || version_compare($diff, $cleanVersion[0], ">=")) {
continue;
}
$diffLog[$version] = $changelog;
}
@@ -66,17 +73,9 @@ class GravCore extends AbstractPackageCollection
return $diffLog;
}
/**
* Returns the latest version of Grav available remotely
* @return string
*/
public function getVersion()
{
return $this->version;
}
/**
* Return the release date of the latest Grav
*
* @return string
*/
public function getDate()
@@ -89,6 +88,16 @@ class GravCore extends AbstractPackageCollection
return version_compare(GRAV_VERSION, $this->getVersion(), '<');
}
/**
* Returns the latest version of Grav available remotely
*
* @return string
*/
public function getVersion()
{
return $this->version;
}
public function isSymlink()
{
return is_link(GRAV_ROOT . DS . 'index.php');

View File

@@ -12,7 +12,7 @@ class Plugins extends AbstractPackageCollection
*/
protected $type = 'plugins';
protected $repository = 'https://getgrav.org/downloads/plugins.json?v=';
protected $repository = 'https://getgrav.org/downloads/plugins.json';
/**
* Local Plugins Constructor
@@ -21,7 +21,7 @@ class Plugins extends AbstractPackageCollection
*/
public function __construct($refresh = false, $callback = null)
{
$this->repository .= GRAV_VERSION;
$this->repository .= '?v=' . GRAV_VERSION;
parent::__construct($this->repository, $refresh, $callback);
}

View File

@@ -12,7 +12,7 @@ class Themes extends AbstractPackageCollection
*/
protected $type = 'themes';
protected $repository = 'https://getgrav.org/downloads/themes.json?v=';
protected $repository = 'https://getgrav.org/downloads/themes.json';
/**
* Local Themes Constructor
@@ -21,7 +21,7 @@ class Themes extends AbstractPackageCollection
*/
public function __construct($refresh = false, $callback = null)
{
$this->repository .= GRAV_VERSION;
$this->repository .= '?v=' . GRAV_VERSION;
parent::__construct($this->repository, $refresh, $callback);
}