Skip to content

Commit

Permalink
Merge branch 'release/1.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Dec 18, 2015
2 parents 747daa4 + dcaa9a3 commit 08cbd95
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -40,8 +40,10 @@ env:
- TRAVIS_TAG=$(curl --fail --user ${GH_API_USER} -s https://api.github.com/repos/getgrav/grav/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4)

before_install:
- export TZ=Pacific/Honolulu
- composer self-update
- go get github.com/aktau/github-release
- echo "Travis Date: `date`"
- git clone --quiet --depth=50 --branch=master https://${BB_TOKEN}bitbucket.org/rockettheme/grav-devtools.git $RT_DEVTOOLS &>/dev/null;
- if [ ! -z "$TRAVIS_TAG" ]; then
cd "${RT_DEVTOOLS}";
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,21 @@
# v1.0.5
## 12/18/2015

1. [](#new)
* Add ability to extend markdown with plugins
* Added support for plugins to have individual language files
* Added `7z` to media formats
* Use Grav's fork of Parsedown until PR is merged
* New function to persist plugin configuration to disk
* GPM `selfupgrade` will now check PHP version requirements
1. [](#improved)
* If the field allows multiple files, return array
* Handle non-array values in file validation
1. [](#bugfix)
* Fix when looping `fields` param in a `list` field
* Properly convert commas to spaces for media attributes
* Forcing Travis VM to HI timezone to address future files in zip file

# v1.0.4
## 12/12/2015

Expand Down
7 changes: 7 additions & 0 deletions composer.json
Expand Up @@ -8,6 +8,7 @@
"require": {
"php": ">=5.4.0",
"twig/twig": "~1.23",
"erusev/parsedown": "dev-master as 1.6.0",
"erusev/parsedown-extra": "~0.7",
"symfony/yaml": "~2.8",
"symfony/console": "~2.8",
Expand All @@ -25,6 +26,12 @@
"rockettheme/toolbox": "~1.2",
"maximebf/debugbar": "~1.10"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/getgrav/parsedown"
}
],
"autoload": {
"psr-4": {
"Grav\\": "system/src/Grav"
Expand Down
33 changes: 22 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions system/config/media.yaml
Expand Up @@ -168,6 +168,10 @@ zip:
type: file
thumb: media/thumb-zip.png
mime: application/zip
7z:
type: file
thumb: media/thumb-7zip.png
mime: application/x-7z-compressed
gz:
type: file
thumb: media/thumb-gz.png
Expand Down
3 changes: 2 additions & 1 deletion system/defines.php
Expand Up @@ -2,8 +2,9 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.0.4');
define('GRAV_VERSION', '1.0.5');
define('DS', '/');
define('GRAV_PHP_MIN', '5.5.9');

// Directories and Paths
if (!defined('GRAV_ROOT')) {
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Assets.php
Expand Up @@ -186,7 +186,7 @@ public function init()
$this->base_url = $base_url . '/';

// Register any preconfigured collections
foreach ($config->get('system.assets.collections') as $name => $collection) {
foreach ($config->get('system.assets.collections', []) as $name => $collection) {
$this->registerCollection($name, (array)$collection);
}
}
Expand Down
6 changes: 4 additions & 2 deletions system/src/Grav/Common/Data/Blueprint.php
Expand Up @@ -338,8 +338,10 @@ protected function parseFormFields(array &$fields, $params, $prefix, array &$cur

if ($field['type'] === 'list') {
// we loop through list to get the actual field
foreach($field['fields'] as $subName => &$subField) {
$this->parseFormField($subField);
if (isset($field['fields']) && $field['fields']) {
foreach($field['fields'] as $subName => &$subField) {
$this->parseFormField($subField);
}
}
} else {
$this->parseFormField($field);
Expand Down
10 changes: 9 additions & 1 deletion system/src/Grav/Common/Data/Validation.php
Expand Up @@ -283,7 +283,15 @@ public static function typeFile($value, array $params, array $field)

protected static function filterFile($value, array $params, array $field)
{
return (array) $value;
if ($field['multiple'] == true) {
return (array) $value;
}

if (is_array($value)) {
return reset($value);
}

return $value;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion system/src/Grav/Common/GPM/Installer.php
Expand Up @@ -281,6 +281,10 @@ public static function lastErrorMsg()
{
$msg = 'Unknown Error';

if (is_string(self::$error)) {
return self::$error;
}

switch (self::$error) {
case 0:
$msg = 'No Error';
Expand Down Expand Up @@ -333,7 +337,7 @@ public static function lastErrorCode()

/**
* Allows to manually set an error
* @param $error the Error code
* @param int|string $error the Error code
*/

public static function setError($error)
Expand Down
29 changes: 29 additions & 0 deletions system/src/Grav/Common/GPM/Upgrader.php
@@ -1,22 +1,32 @@
<?php
namespace Grav\Common\GPM;

use Grav\Common\Grav;

/**
* Class Upgrader
*
* @package Grav\Common\GPM
*/
class Upgrader
{
/**
* Remote details about latest Grav version
*
* @var Packages
*/
private $remote;

/**
* Internal cache
*
* @var Iterator
*/
protected $cache;

/**
* Creates a new GPM instance with Local and Remote packages available
*
* @param boolean $refresh Applies to Remote Packages only and forces a refetch of data
* @param callable $callback Either a function or callback in array notation
*/
Expand All @@ -27,6 +37,7 @@ public function __construct($refresh = false, $callback = null)

/**
* Returns the release date of the latest version of Grav
*
* @return string
*/
public function getReleaseDate()
Expand All @@ -36,6 +47,7 @@ public function getReleaseDate()

/**
* Returns the version of the installed Grav
*
* @return string
*/
public function getLocalVersion()
Expand All @@ -45,6 +57,7 @@ public function getLocalVersion()

/**
* Returns the version of the remotely available Grav
*
* @return string
*/
public function getRemoteVersion()
Expand All @@ -54,6 +67,7 @@ public function getRemoteVersion()

/**
* Returns an array of assets available to download remotely
*
* @return array
*/
public function getAssets()
Expand All @@ -63,6 +77,7 @@ public function getAssets()

/**
* Returns the changelog list for each version of Grav
*
* @param string $diff the version number to start the diff from
*
* @return array return the changelog list for each version
Expand All @@ -72,8 +87,21 @@ public function getChangelog($diff = null)
return $this->remote->getChangelog($diff);
}

/**
* @return bool
*/
public function meetsRequirements()
{
if (version_compare(PHP_VERSION, GRAV_PHP_MIN, '<')) {
return false;
}

return true;
}

/**
* Checks if the currently installed Grav is upgradable to a newer version
*
* @return boolean True if it's upgradable, False otherwise.
*/
public function isUpgradable()
Expand All @@ -83,6 +111,7 @@ public function isUpgradable()

/**
* Checks if Grav is currently symbolically linked
*
* @return boolean True if Grav is symlinked, False otherwise.
*/

Expand Down

0 comments on commit 08cbd95

Please sign in to comment.