Merge branch '1.4' into develop

# Conflicts:
#	system/src/Grav/Common/Twig/TwigExtension.php
#	system/src/Grav/Common/Uri.php
#	tests/unit/Grav/Common/AssetsTest.php
This commit is contained in:
Andy Miller
2018-03-09 12:43:08 -07:00
213 changed files with 8077 additions and 1337 deletions

View File

@@ -11,9 +11,9 @@ git:
url: https://github.com/getgrav/grav-plugin-markdown-notices
path: user/plugins/markdown-notices
branch: master
antimatter:
url: https://github.com/getgrav/grav-theme-antimatter
path: user/themes/antimatter
quark:
url: https://github.com/getgrav/grav-theme-quark
path: user/themes/quark
branch: master
links:
problems:
@@ -28,7 +28,7 @@ links:
src: grav-plugin-markdown-notices
path: user/plugins/markdown-notices
scm: github
antimatter:
src: grav-theme-antimatter
path: user/themes/antimatter
quark:
src: grav-theme-quark
path: user/themes/quark
scm: github

View File

@@ -1,3 +1,95 @@
# v1.4.0-rc.3
## mm/dd/2018
1. [](#new)
* Added `Grav\Framework\Uri` classes extending PSR-7 `HTTP message UriInterface` implementation
* Added `Grav\Framework\Route` classes to allow route/link manipulation
* Added `$grav['uri]->getCurrentUri()` method to get `Grav\Framework\Uri\Uri` instance for the current URL
* Added `$grav['uri]->getCurrentRoute()` method to get `Grav\Framework\Route\Route` instance for the current URL
* Added ability to have `php` version dependencies in GPM assets
* Added new `{% switch %}` twig tag for more elegant if statements
* Added new `{% markdown %}` twig tag
* Added **Route Overrides** to the default page blueprint
1. [](#improved)
* Vendor library updated to latest
* Improved `Session` initialization
* Added ability to set a `theme_var()` option in page frontmatter
* Force clearing PHP `clearstatcache` and `opcache-reset` on `Cache::clear()`
1. [](#bugfix)
* Fixed issue with image alt tag always getting empted out unless set in markdown
* Fixed issue with remote PHP version determination for Grav updates [#1883](https://github.com/getgrav/grav/issues/1883)
# v1.4.0-rc.2
## 02/15/2018
1. [](#new)
* Added new `Collection::toExtendedArray()` method that's particularly useful for Json output of data
* Added new `|yaml_encode` and `|yaml_decode` Twig filter to convert to and from YAML
* Added new `read_file()` Twig function to allow you to load and display a file in Twig (Supports streams and regular paths)
* Added a new `Medium::exists()` method to check for file existence
1. [](#improved)
* Better `Page.collection()` filtering support including ability to have non-published pages in collections
* Stopped Chrome from auto-completing admin user profile form [#1847](https://github.com/getgrav/grav/issues/1847)
* Support for empty `switch` field like a `checkbox`
1. [](#bugfix)
* Properly validate YAML blueprint fields so admin can save as proper YAML now [addresses many issues]
* Fixed OpenGraph metatags so only Twitter uses `name=`, and all others use `property=` [#1849](https://github.com/getgrav/grav/issues/1849)
* Fixed an issue with `evaluate()` and `evaluate_twig()` Twig functions that throws invalid template error
* Fixed issue with `|sort_by_key` twig filter if the input was null or not an array
# v1.4.0-rc.1
## 01/22/2018
1. [](#new)
* Moved Twig `urlFunc()` to `Utils::url()` as its so darn handy
1. [](#improved)
* Made `modular` blueprint more flexible
* Code optimizations to `Utils` class [#1830](https://github.com/getgrav/grav/pull/1830)
* Objects: Add protected function `getElement()` to get serialized value for a single property
* `ObjectPropertyTrait`: Added protected functions `isPropertyLoaded()`, `offsetLoad()`, `offsetPrepare()` and `offsetSerialize()`
* `Grav\Framework\Cache`: Allow unlimited TTL
* Optimizations & refactoring to the test suite [#1779](https://github.com/getgrav/grav/pull/1779)
* Slight modification of Whoops error colors
* Updated vendor libs to latest
1. [](#bugfix)
* Date ordering should always be numeric [#1810](https://github.com/getgrav/grav/issues/1810)
# v1.4.0-beta.3
## 12/29/2017
1. [](#bugfix)
* Fix for base paths containing special characters [#1799](https://github.com/getgrav/grav/issues/1799)
* Fix for session cookies in paths containing special characters
* Fix for `vundefined` error for version numbers in GPM [form#222](https://github.com/getgrav/grav-plugin-form/issues/222)
1. [](#improved)
* Added new configuration option `system.session.initialize` to delay session initialization if needed by a plugin
# v1.4.0-beta.2
## 12/18/2017
1. [](#new)
* Transferred overall copyright from RocketTheme, LLC, to Trilby Media LLC
* Added `theme_var`, `header_var` and `body_class` Twig functions for themes
1. [](#improved)
* Updated vendor libraries to latest versions
* Removed constructor from `ObjectInterface`
1. [](#bugfix)
* Fixed `BadMethodCallException` thrown in GPM updates [#1784](https://github.com/getgrav/grav/issues/1784)
# v1.4.0-beta.1
## 12/11/2017
1. [](#new)
* Added `Grav\Framework\Cache` classes providing PSR-16 `Simple Cache` implementation
* Added `Grav\Framework\ContentBlock` classes for nested HTML blocks with CSS/JS assets
* Added `Grav\Framework\Object` classes for creating collections of objects
* Added `|nicenumber` Twig filter
* Added `{% try %} ... {% catch %} Error: {{ e.message }} {% endcatch %}` tag to allow basic exception handling inside Twig
* Added `{% script %}` and `{% style %}` tags for Twig templates
* Deprecated GravTrait
1. [](#improved)
* Make it possible to include debug bar also into non-HTML responses
# v1.3.11
## mm/dd/2017
@@ -10,14 +102,14 @@
## 12/06/2017
1. [](#bugfix)
* Reverted GPM Local pull request as it broken admin [#1742](https://github.com/getgrav/grav/issues/1742)
* Reverted GPM Local pull request as it broken admin [#1742](https://github.com/getgrav/grav/issues/1742)
# v1.3.9
## 12/05/2017
1. [](#new)
* Added new core Twig templates for `partials/metadata.html.twig` and `partials/messages.html.twig`
* Added ability to work with GPM locally [#1742](https://github.com/getgrav/grav/issues/1742)
* Added ability to work with GPM locally [#1742](https://github.com/getgrav/grav/issues/1742)
* Added new HTML5 audio controls [#1756](https://github.com/getgrav/grav/issues/1756)
* Added `Medium::copy()` method to create a copy of a medium object
* Added new `force_lowercase_urls` functionality on routes and slugs
@@ -41,15 +133,15 @@
* Fixed token creation issue with `Uri` params like `/id:3`
* Fixed CSS Pipeline failing with Google remote fonts if the file was minified [#1261](https://github.com/getgrav/grav-plugin-admin/issues/1261)
* Forced `field.multiple: true` to allow use of min/max options in `checkboxes.validate`
# v1.3.8
## 10/26/2017
1. [](#new)
* Added Page `media_order` capability to manually order page media via a page header
1. [](#bugfix)
* Fixed GPM update issue with filtered slugs [#1711](https://github.com/getgrav/grav/issues/1711)
* Fixed issue with missing image file not throwing 404 properly [#1713](https://github.com/getgrav/grav/issues/1713)
* Fixed GPM update issue with filtered slugs [#1711](https://github.com/getgrav/grav/issues/1711)
* Fixed issue with missing image file not throwing 404 properly [#1713](https://github.com/getgrav/grav/issues/1713)
# v1.3.7
## 10/18/2017
@@ -65,20 +157,20 @@
1. [](#bugfix)
* Regression: Ajax error in Nginx [admin#1244](https://github.com/getgrav/grav-plugin-admin/issues/1244)
* Remove the `_url=$uri` portion of the the Nginx `try_files` command [admin#1244](https://github.com/getgrav/grav-plugin-admin/issues/1244)
# v1.3.5
## 10/11/2017
1. [](#improved)
* Refactored `URI` class with numerous bug fixes, and optimizations
* Override `system.media.upload_limit` with PHP's `post_max_size` or `upload_max_filesize`
* Updated `bin/grav clean` command to remove unnecessary vendor files (save some bytes)
* Updated `bin/grav clean` command to remove unnecessary vendor files (save some bytes)
* Added a `http_status_code` Twig function to allow setting HTTP status codes from Twig directly.
* Deter XSS attacks via URI path/uri methods (credit:newbthenewbd)
* Added support for `$uri->toArray()` and `(string)$uri`
* Added support for `type` on `Asstes::addInlineJs()` [#1683](https://github.com/getgrav/grav/pull/1683)
1. [](#bugfix)
* Fixed method signature error with `GPM\InstallCommand::processPackage()` [#1682](https://github.com/getgrav/grav/pull/1682)
* Fixed method signature error with `GPM\InstallCommand::processPackage()` [#1682](https://github.com/getgrav/grav/pull/1682)
# v1.3.4
## 09/29/2017
@@ -92,7 +184,7 @@
* Improved support for Assets with query strings [#1451](https://github.com/getgrav/grav/issues/1451)
* Twig extension cleanup
1. [](#bugfix)
* Fixed an issue where fallback was not supporting dynamic page generation
* Fixed an issue where fallback was not supporting dynamic page generation
* Fixed issue with Image query string not being fully URL encoded [#1622](https://github.com/getgrav/grav/issues/1622)
* Fixed `Page::summary()` when using delimiter and multibyte UTF8 Characters [#1644](https://github.com/getgrav/grav/issues/1644)
* Fixed missing `.json` thumbnail throwing error when adding media [grav-plugin-admin#1156](https://github.com/getgrav/grav-plugin-admin/issues/1156)
@@ -135,7 +227,7 @@
* Allow `session.timeout` field to be set to `0` via blueprints [#1598](https://github.com/getgrav/grav/issues/1598)
* Fixed `Data::exists()` and `Data::raw()` functions breaking if `Data::file()` hasn't been called with non-null value
* Fixed parent theme auto-loading in child themes of Gantry 5
# v1.3.1
## 07/19/2017

View File

View File

@@ -16,15 +16,16 @@
"symfony/event-dispatcher": "~2.8",
"symfony/var-dumper": "~2.8",
"symfony/polyfill-iconv": "~1.0",
"doctrine/cache": "1.6.*",
"doctrine/cache": "^1.6",
"doctrine/collections": "1.3",
"psr/simple-cache": "^1.0",
"filp/whoops": "~2.0",
"matthiasmullie/minify": "^1.3",
"monolog/monolog": "~1.0",
"gregwar/image": "2.*",
"donatj/phpuseragentparser": "~0.3",
"pimple/pimple": "~3.0",
"rockettheme/toolbox": "~1.0",
"rockettheme/toolbox": "~1.3",
"maximebf/debugbar": "~1.10",
"ext-mbstring": "*",
"ext-openssl": "*",

433
composer.lock generated
View File

@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "6ee956d337b26a464deac44ba90da27d",
"content-hash": "863f839a5a0e0ebbf94742efc24cb6a4",
"packages": [
{
"name": "antoligy/dom-string-iterators",
"version": "v1.0.0",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/antoligy/dom-string-iterators.git",
"reference": "9a624b082493fee9b972840dbd677494edb94cf7"
"reference": "fae88f66e1970d68c5585fc42db44f1217bf74e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antoligy/dom-string-iterators/zipball/9a624b082493fee9b972840dbd677494edb94cf7",
"reference": "9a624b082493fee9b972840dbd677494edb94cf7",
"url": "https://api.github.com/repos/antoligy/dom-string-iterators/zipball/fae88f66e1970d68c5585fc42db44f1217bf74e6",
"reference": "fae88f66e1970d68c5585fc42db44f1217bf74e6",
"shasum": ""
},
"require": {
@@ -31,7 +31,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Public Domain"
"CC0-1.0"
],
"authors": [
{
@@ -48,7 +48,7 @@
}
],
"description": "Composer package for DOMWordsIterator and DOMLettersIterator",
"time": "2015-11-04T17:33:14+00:00"
"time": "2018-02-03T16:01:11+00:00"
},
{
"name": "composer/ca-bundle",
@@ -295,19 +295,20 @@
},
{
"name": "erusev/parsedown",
"version": "1.6.4",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "fbe3fe878f4fe69048bb8a52783a09802004f548"
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/fbe3fe878f4fe69048bb8a52783a09802004f548",
"reference": "fbe3fe878f4fe69048bb8a52783a09802004f548",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
@@ -336,7 +337,7 @@
"markdown",
"parser"
],
"time": "2017-11-14T20:44:03+00:00"
"time": "2018-03-08T01:11:30+00:00"
},
{
"name": "erusev/parsedown-extra",
@@ -488,17 +489,17 @@
},
{
"name": "gregwar/image",
"version": "v2.0.21",
"version": "v2.0.22",
"target-dir": "Gregwar/Image",
"source": {
"type": "git",
"url": "https://github.com/Gregwar/Image.git",
"reference": "c9899e4c71009338f89a8c63c12c681692533ede"
"reference": "c506d57d7fb5e67961d4eea6540ae8e23dffd406"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Gregwar/Image/zipball/c9899e4c71009338f89a8c63c12c681692533ede",
"reference": "c9899e4c71009338f89a8c63c12c681692533ede",
"url": "https://api.github.com/repos/Gregwar/Image/zipball/c506d57d7fb5e67961d4eea6540ae8e23dffd406",
"reference": "c506d57d7fb5e67961d4eea6540ae8e23dffd406",
"shasum": ""
},
"require": {
@@ -536,20 +537,20 @@
"gd",
"image"
],
"time": "2017-01-24T09:29:39+00:00"
"time": "2018-01-31T17:40:17+00:00"
},
{
"name": "league/climate",
"version": "3.2.1",
"version": "3.2.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/climate.git",
"reference": "b103fc8faa3780c802cc507d5f0ff534ecc94fb5"
"reference": "ca70f67f7739cca823eba0ad98f8130bca226bf0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/climate/zipball/b103fc8faa3780c802cc507d5f0ff534ecc94fb5",
"reference": "b103fc8faa3780c802cc507d5f0ff534ecc94fb5",
"url": "https://api.github.com/repos/thephpleague/climate/zipball/ca70f67f7739cca823eba0ad98f8130bca226bf0",
"reference": "ca70f67f7739cca823eba0ad98f8130bca226bf0",
"shasum": ""
},
"require": {
@@ -587,20 +588,20 @@
"php",
"terminal"
],
"time": "2016-04-04T20:24:59+00:00"
"time": "2016-10-30T22:18:25+00:00"
},
{
"name": "matthiasmullie/minify",
"version": "1.3.57",
"version": "1.3.59",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "7559ac0806f39f89f949c917e6612dda8154488b"
"reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/7559ac0806f39f89f949c917e6612dda8154488b",
"reference": "7559ac0806f39f89f949c917e6612dda8154488b",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/62dac3bce06de66f0d71fe6490cf1c508d3c3ff7",
"reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7",
"shasum": ""
},
"require": {
@@ -647,20 +648,20 @@
"minifier",
"minify"
],
"time": "2017-12-06T12:46:42+00:00"
"time": "2018-02-02T12:44:18+00:00"
},
{
"name": "matthiasmullie/path-converter",
"version": "1.1.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/path-converter.git",
"reference": "08551ec1b156e923c242a10ab484bd4d6ead6631"
"reference": "3082a6838be02b930239a97d38b5c9da4d693aca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/08551ec1b156e923c242a10ab484bd4d6ead6631",
"reference": "08551ec1b156e923c242a10ab484bd4d6ead6631",
"url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca",
"reference": "3082a6838be02b930239a97d38b5c9da4d693aca",
"shasum": ""
},
"require": {
@@ -696,26 +697,26 @@
"paths",
"relative"
],
"time": "2017-01-26T08:54:49+00:00"
"time": "2018-02-02T11:30:10+00:00"
},
{
"name": "maximebf/debugbar",
"version": "v1.14.1",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "64251a392344e3d22f3d21c3b7c531ba96eb01d2"
"reference": "30e7d60937ee5f1320975ca9bc7bcdd44d500f07"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/64251a392344e3d22f3d21c3b7c531ba96eb01d2",
"reference": "64251a392344e3d22f3d21c3b7c531ba96eb01d2",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/30e7d60937ee5f1320975ca9bc7bcdd44d500f07",
"reference": "30e7d60937ee5f1320975ca9bc7bcdd44d500f07",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "^1.0",
"symfony/var-dumper": "^2.6|^3.0"
"symfony/var-dumper": "^2.6|^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0"
@@ -757,7 +758,7 @@
"debug",
"debugbar"
],
"time": "2017-09-13T12:19:36+00:00"
"time": "2017-12-15T11:13:46+00:00"
},
{
"name": "miljar/php-exif",
@@ -894,16 +895,16 @@
},
{
"name": "pimple/pimple",
"version": "v3.2.2",
"version": "v3.2.3",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Pimple.git",
"reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a"
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/4d45fb62d96418396ec58ba76e6f065bca16e10a",
"reference": "4d45fb62d96418396ec58ba76e6f065bca16e10a",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
"shasum": ""
},
"require": {
@@ -940,7 +941,7 @@
"container",
"dependency injection"
],
"time": "2017-07-23T07:32:15+00:00"
"time": "2018-01-21T07:42:36+00:00"
},
{
"name": "psr/container",
@@ -1038,23 +1039,73 @@
],
"time": "2016-10-10T12:19:37+00:00"
},
{
"name": "psr/simple-cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "roave/security-advisories",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "40b035345ed34a4cc92c842f60a6cc739101542f"
"reference": "664836e89c7ecad3dbaabc1572ea752c0d532d80"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/40b035345ed34a4cc92c842f60a6cc739101542f",
"reference": "40b035345ed34a4cc92c842f60a6cc739101542f",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/664836e89c7ecad3dbaabc1572ea752c0d532d80",
"reference": "664836e89c7ecad3dbaabc1572ea752c0d532d80",
"shasum": ""
},
"conflict": {
"3f/pygmentize": "<1.2",
"adodb/adodb-php": "<5.20.6",
"amphp/artax": "<1.0.6|>=2,<2.0.6",
"asymmetricrypt/asymmetricrypt": ">=0,<9.9.99",
"aws/aws-sdk-php": ">=3,<3.2.1",
"bugsnag/bugsnag-laravel": ">=2,<2.0.2",
"cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4",
@@ -1063,9 +1114,10 @@
"codeigniter/framework": "<=3.0.6",
"composer/composer": "<=1.0.0-alpha11",
"contao-components/mediaelement": ">=2.14.2,<2.21.1",
"contao/core": ">=2,<3.5.31",
"contao/core": ">=2,<3.5.32",
"contao/core-bundle": ">=4,<4.4.8",
"contao/listing-bundle": ">=4,<4.4.8",
"contao/newsletter-bundle": ">=4,<4.1",
"doctrine/annotations": ">=1,<1.2.7",
"doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2",
"doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1",
@@ -1076,9 +1128,10 @@
"doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
"doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1",
"dompdf/dompdf": ">=0.6,<0.6.2",
"drupal/core": ">=8,<8.3.7",
"drupal/drupal": ">=8,<8.3.7",
"ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.2|>=5.4,<5.4.10.1|>=2017.8,<2017.8.1.1",
"drupal/core": ">=8,<8.4.5",
"drupal/drupal": ">=8,<8.4.5",
"erusev/parsedown": "<1.7",
"ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1",
"firebase/php-jwt": "<2",
"friendsofsymfony/rest-bundle": ">=1.2,<1.2.2",
"friendsofsymfony/user-bundle": ">=1.2,<1.3.5",
@@ -1098,21 +1151,27 @@
"onelogin/php-saml": "<2.10.4",
"oro/crm": ">=1.7,<1.7.4",
"oro/platform": ">=1.7,<1.7.4",
"padraic/humbug_get_contents": "<1.1.2",
"pagarme/pagarme-php": ">=0,<3",
"paragonie/random_compat": "<2",
"phpmailer/phpmailer": ">=5,<5.2.24",
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"phpxmlrpc/extras": "<6.0.1",
"phpxmlrpc/extras": "<0.6.1",
"propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7",
"propel/propel1": ">=1,<=1.7.1",
"pusher/pusher-php-server": "<2.2.1",
"sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
"shopware/shopware": "<5.2.25",
"shopware/shopware": "<5.3.7",
"silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11",
"silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
"silverstripe/framework": ">=3,<3.3",
"silverstripe/userforms": "<3",
"simplesamlphp/saml2": "<1.8.1|>=1.9,<1.9.1|>=1.10,<1.10.3|>=2,<2.3.3",
"simplesamlphp/simplesamlphp": "<1.14.16",
"simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
"simplesamlphp/simplesamlphp": "<1.15.2",
"simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
"socalnick/scn-social-auth": "<1.15.2",
"squizlabs/php_codesniffer": ">=1,<2.8.1",
"stormpath/sdk": ">=0,<9.9.99",
"swiftmailer/swiftmailer": ">=4,<5.4.5",
"symfony/dependency-injection": ">=2,<2.0.17",
"symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
@@ -1133,15 +1192,16 @@
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"thelia/backoffice-default-template": ">=2.1,<2.1.2",
"thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3",
"titon/framework": ">=0,<9.9.99",
"twig/twig": "<1.20",
"typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
"typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4",
"willdurand/js-translation-bundle": "<2.1.1",
"yiisoft/yii": ">=1.1.14,<1.1.15",
"yiisoft/yii2": "<2.0.5",
"yiisoft/yii2": "<2.0.14",
"yiisoft/yii2-bootstrap": "<2.0.4",
"yiisoft/yii2-dev": "<2.0.4",
"yiisoft/yii2-dev": "<2.0.14",
"yiisoft/yii2-gii": "<2.0.4",
"yiisoft/yii2-jui": "<2.0.4",
"zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3",
@@ -1181,20 +1241,20 @@
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2017-12-12T00:38:43+00:00"
"time": "2018-03-07T15:45:44+00:00"
},
{
"name": "rockettheme/toolbox",
"version": "1.3.8",
"version": "1.3.9",
"source": {
"type": "git",
"url": "https://github.com/rockettheme/toolbox.git",
"reference": "2f7c83780bbcf527e057f15efe755e10694eb2bc"
"reference": "1deea4b45e09f6e0c3e6e075e175e50d05ccbf70"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/2f7c83780bbcf527e057f15efe755e10694eb2bc",
"reference": "2f7c83780bbcf527e057f15efe755e10694eb2bc",
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/1deea4b45e09f6e0c3e6e075e175e50d05ccbf70",
"reference": "1deea4b45e09f6e0c3e6e075e175e50d05ccbf70",
"shasum": ""
},
"require": {
@@ -1229,7 +1289,7 @@
"php",
"rockettheme"
],
"time": "2017-09-23T13:39:25+00:00"
"time": "2018-03-09T00:03:18+00:00"
},
{
"name": "seld/cli-prompt",
@@ -1281,16 +1341,16 @@
},
{
"name": "symfony/console",
"version": "v2.8.32",
"version": "v2.8.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de"
"reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/46270f1ca44f08ebc134ce120fd2c2baf5fd63de",
"reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de",
"url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27",
"reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27",
"shasum": ""
},
"require": {
@@ -1338,7 +1398,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-11-29T09:33:18+00:00"
"time": "2018-02-26T15:33:21+00:00"
},
{
"name": "symfony/debug",
@@ -1399,16 +1459,16 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.32",
"version": "v2.8.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b59aacf238fadda50d612c9de73b74751872a903"
"reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903",
"reference": "b59aacf238fadda50d612c9de73b74751872a903",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f5d2d7dcc33b89e20c2696ea9afcbddf6540081c",
"reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c",
"shasum": ""
},
"require": {
@@ -1455,20 +1515,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2017-11-05T15:25:56+00:00"
"time": "2018-02-11T16:53:59+00:00"
},
{
"name": "symfony/polyfill-iconv",
"version": "v1.6.0",
"version": "v1.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git",
"reference": "7a84ccdb8c953ee274c96dd6bde778d873fc824a"
"reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/7a84ccdb8c953ee274c96dd6bde778d873fc824a",
"reference": "7a84ccdb8c953ee274c96dd6bde778d873fc824a",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/bd515d8f392730c833bc1ba993a4f598da64fa5b",
"reference": "bd515d8f392730c833bc1ba993a4f598da64fa5b",
"shasum": ""
},
"require": {
@@ -1480,7 +1540,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
"dev-master": "1.7-dev"
}
},
"autoload": {
@@ -1514,20 +1574,20 @@
"portable",
"shim"
],
"time": "2017-10-11T12:05:26+00:00"
"time": "2018-01-30T19:27:44+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.6.0",
"version": "v1.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296"
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
"shasum": ""
},
"require": {
@@ -1539,7 +1599,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
"dev-master": "1.7-dev"
}
},
"autoload": {
@@ -1573,20 +1633,20 @@
"portable",
"shim"
],
"time": "2017-10-11T12:05:26+00:00"
"time": "2018-01-30T19:27:44+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v2.8.32",
"version": "v2.8.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "0f2d237b01db1a1a486e330ad89be836513e19a0"
"reference": "e6a3e8c832096f8902a3e80169fca5d202e7e0d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/0f2d237b01db1a1a486e330ad89be836513e19a0",
"reference": "0f2d237b01db1a1a486e330ad89be836513e19a0",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/e6a3e8c832096f8902a3e80169fca5d202e7e0d3",
"reference": "e6a3e8c832096f8902a3e80169fca5d202e7e0d3",
"shasum": ""
},
"require": {
@@ -1641,20 +1701,20 @@
"debug",
"dump"
],
"time": "2017-11-07T14:08:47+00:00"
"time": "2018-01-31T10:36:06+00:00"
},
{
"name": "symfony/yaml",
"version": "v2.8.32",
"version": "v2.8.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "968ef42161e4bc04200119da473077f9e7015128"
"reference": "be720fcfae4614df204190d57795351059946a77"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128",
"reference": "968ef42161e4bc04200119da473077f9e7015128",
"url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77",
"reference": "be720fcfae4614df204190d57795351059946a77",
"shasum": ""
},
"require": {
@@ -1690,20 +1750,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-11-29T09:33:18+00:00"
"time": "2018-01-03T07:36:31+00:00"
},
{
"name": "twig/twig",
"version": "v1.35.0",
"version": "v1.35.2",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f"
"reference": "9c24f2cd39dc1906b76879e099970b7e53724601"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f",
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9c24f2cd39dc1906b76879e099970b7e53724601",
"reference": "9c24f2cd39dc1906b76879e099970b7e53724601",
"shasum": ""
},
"require": {
@@ -1755,22 +1815,22 @@
"keywords": [
"templating"
],
"time": "2017-09-27T18:06:46+00:00"
"time": "2018-03-03T16:21:29+00:00"
}
],
"packages-dev": [
{
"name": "behat/gherkin",
"version": "v4.4.5",
"version": "v4.5.1",
"source": {
"type": "git",
"url": "https://github.com/Behat/Gherkin.git",
"reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
"reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
"reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a",
"reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a",
"shasum": ""
},
"require": {
@@ -1816,35 +1876,32 @@
"gherkin",
"parser"
],
"time": "2016-10-30T11:50:56+00:00"
"time": "2017-08-30T11:04:43+00:00"
},
{
"name": "codeception/codeception",
"version": "2.3.7",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
"reference": "151de88277878adc18784ef3eaddd87f4a2fdc14"
"reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/151de88277878adc18784ef3eaddd87f4a2fdc14",
"reference": "151de88277878adc18784ef3eaddd87f4a2fdc14",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/c50789a9a62cc0eefc0252e88a5f04f8c47b55f4",
"reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4",
"shasum": ""
},
"require": {
"behat/gherkin": "~4.4.0",
"behat/gherkin": "^4.4.0",
"codeception/phpunit-wrapper": "^6.0|^7.0",
"codeception/stub": "^1.0",
"ext-json": "*",
"ext-mbstring": "*",
"facebook/webdriver": ">=1.1.3 <2.0",
"guzzlehttp/guzzle": ">=4.1.4 <7.0",
"guzzlehttp/psr7": "~1.0",
"php": ">=5.4.0 <8.0",
"phpunit/php-code-coverage": ">=2.2.4 <6.0",
"phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0",
"phpunit/phpunit-mock-objects": ">2.3 <5.0",
"sebastian/comparator": ">1.1 <3.0",
"sebastian/diff": ">=1.4 <3.0",
"symfony/browser-kit": ">=2.7 <5.0",
"symfony/console": ">=2.7 <5.0",
"symfony/css-selector": ">=2.7 <5.0",
@@ -1857,8 +1914,6 @@
"codeception/specify": "~0.3",
"facebook/graph-sdk": "~5.3",
"flow/jsonpath": "~0.2",
"league/factory-muffin": "^3.0",
"league/factory-muffin-faker": "^1.0",
"monolog/monolog": "~1.8",
"pda/pheanstalk": "~3.0",
"php-amqplib/php-amqplib": "~2.4",
@@ -1912,7 +1967,79 @@
"functional testing",
"unit testing"
],
"time": "2017-12-12T04:22:17+00:00"
"time": "2018-02-27T00:09:12+00:00"
},
{
"name": "codeception/phpunit-wrapper",
"version": "6.0.5",
"source": {
"type": "git",
"url": "https://github.com/Codeception/phpunit-wrapper.git",
"reference": "44e2100c300413a6b40cf8874ad402695010f443"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/44e2100c300413a6b40cf8874ad402695010f443",
"reference": "44e2100c300413a6b40cf8874ad402695010f443",
"shasum": ""
},
"require": {
"phpunit/php-code-coverage": ">=2.2.4 <6.0",
"phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0",
"sebastian/comparator": ">1.1 <3.0",
"sebastian/diff": ">=1.4 <4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Codeception\\PHPUnit\\": "src\\"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Davert",
"email": "davert.php@resend.cc"
}
],
"description": "PHPUnit classes used by Codeception",
"time": "2018-02-19T13:24:40+00:00"
},
{
"name": "codeception/stub",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Stub.git",
"reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
"reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
"shasum": ""
},
"require": {
"phpunit/phpunit-mock-objects": ">2.3 <7.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.8 <8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Codeception\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Flexible Stub wrapper for PHPUnit's Mock Builder",
"time": "2018-02-18T13:56:56+00:00"
},
{
"name": "doctrine/instantiator",
@@ -2399,16 +2526,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.7.3",
"version": "1.7.5",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"shasum": ""
},
"require": {
@@ -2420,7 +2547,7 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
@@ -2458,7 +2585,7 @@
"spy",
"stub"
],
"time": "2017-11-24T13:59:53+00:00"
"time": "2018-02-19T10:16:54+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -3260,16 +3387,16 @@
},
{
"name": "symfony/browser-kit",
"version": "v3.4.1",
"version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
"reference": "179522b5f0b5e6d00bb60f38a4d6b29962e4b61b"
"reference": "490f27762705c8489bd042fe3e9377a191dba9b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/179522b5f0b5e6d00bb60f38a4d6b29962e4b61b",
"reference": "179522b5f0b5e6d00bb60f38a4d6b29962e4b61b",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/490f27762705c8489bd042fe3e9377a191dba9b4",
"reference": "490f27762705c8489bd042fe3e9377a191dba9b4",
"shasum": ""
},
"require": {
@@ -3313,20 +3440,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
"time": "2017-11-07T14:20:24+00:00"
"time": "2018-01-03T07:37:34+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.4.1",
"version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "7134b93e90ea7e7881fcb2da006d21b4c5f31908"
"reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/7134b93e90ea7e7881fcb2da006d21b4c5f31908",
"reference": "7134b93e90ea7e7881fcb2da006d21b4c5f31908",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/544655f1fc078a9cd839fdda2b7b1e64627c826a",
"reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a",
"shasum": ""
},
"require": {
@@ -3366,20 +3493,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2017-11-05T16:10:10+00:00"
"time": "2018-02-03T14:55:07+00:00"
},
{
"name": "symfony/dom-crawler",
"version": "v3.4.1",
"version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "7bf68716e400997a291ad42c9f9fe7972e6656d2"
"reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7bf68716e400997a291ad42c9f9fe7972e6656d2",
"reference": "7bf68716e400997a291ad42c9f9fe7972e6656d2",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
"reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
"shasum": ""
},
"require": {
@@ -3422,20 +3549,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2017-11-05T16:10:10+00:00"
"time": "2018-02-22T10:48:49+00:00"
},
{
"name": "symfony/finder",
"version": "v3.4.1",
"version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a"
"reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/dac8d7db537bac7ad8143eb11360a8c2231f251a",
"reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a",
"url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625",
"reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625",
"shasum": ""
},
"require": {
@@ -3471,20 +3598,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2017-11-05T16:10:10+00:00"
"time": "2018-03-05T18:28:11+00:00"
},
{
"name": "symfony/process",
"version": "v3.4.1",
"version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea"
"reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/db25e810fd5e124085e3777257d0cf4ae533d0ea",
"reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea",
"url": "https://api.github.com/repos/symfony/process/zipball/cc4aea21f619116aaf1c58016a944e4821c8e8af",
"reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af",
"shasum": ""
},
"require": {
@@ -3520,7 +3647,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-11-22T12:18:49+00:00"
"time": "2018-02-12T17:55:00+00:00"
},
{
"name": "victorjonsson/markdowndocs",
@@ -3570,16 +3697,16 @@
},
{
"name": "webmozart/assert",
"version": "1.2.0",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
"reference": "0df1908962e7a3071564e857d86874dad1ef204a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
"url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"shasum": ""
},
"require": {
@@ -3616,7 +3743,7 @@
"check",
"validate"
],
"time": "2016-11-23T20:04:58+00:00"
"time": "2018-01-29T19:49:41+00:00"
}
],
"aliases": [],

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -1,5 +1,5 @@
body header {
background: #8552A2;
background: #3085EE;
}
body .left-panel {

View File

@@ -310,6 +310,31 @@ form:
toggleable: true
help: PLUGIN_ADMIN.APPEND_URL_EXT_HELP
routes_only:
type: section
title: PLUGIN_ADMIN.ROUTE_OVERRIDES
underline: true
fields:
header.routes.default:
type: text
toggleable: true
label: PLUGIN_ADMIN.ROUTE_DEFAULT
header.routes.canonical:
type: text
toggleable: true
label: PLUGIN_ADMIN.ROUTE_CANONICAL
header.routes.aliases:
type: array
toggleable: true
value_only: true
size: large
label: PLUGIN_ADMIN.ROUTE_ALIASES
admin_only:
type: section
title: PLUGIN_ADMIN.ADMIN_SPECIFIC_OVERRIDES

View File

@@ -1,7 +1,5 @@
title: PLUGIN_ADMIN.MODULAR
@extends:
type: default
context: blueprints://pages
'@extends': default
form:
fields:
@@ -13,35 +11,28 @@ form:
content:
fields:
modular_title:
type: spacer
title: Modular Setup
header.content.items:
type: select
type: text
label: PLUGIN_ADMIN.ITEMS
default: '@self.modular'
options:
'@self.modular': Modular Children
size: medium
header.content.order.by:
type: select
type: text
label: PLUGIN_ADMIN.ORDER_BY
default: date
options:
folder: PLUGIN_ADMIN.FOLDER
title: PLUGIN_ADMIN.TITLE
date: PLUGIN_ADMIN.DATE
default: PLUGIN_ADMIN.DEFAULT
placeholder: date
help:
size: small
header.content.order.dir:
type: select
type: text
label: PLUGIN_ADMIN.ORDER
default: desc
options:
asc: PLUGIN_ADMIN.ASCENDING
desc: PLUGIN_ADMIN.DESCENDING
help: '"desc" or "asc" are valid values'
placeholder: desc
size: small
header.process:
type: ignore
content:
type: ignore
header.media_order:
type: ignore

View File

@@ -40,6 +40,7 @@ form:
type: password
size: large
label: PLUGIN_ADMIN.PASSWORD
autocomplete: new-password
validate:
required: false
message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE

View File

@@ -132,6 +132,7 @@ media:
session:
enabled: true # Enable Session support
initialize: true # Initialize session from Grav (if false, plugin needs to start the session)
timeout: 1800 # Timeout in seconds
name: grav-site # Name prefix of the session cookie. Use alphanumeric, dashes or underscores only. Do not use dots in the session name
secure: false # Set session secure. If true, indicates that communication for this cookie must be over an encrypted transmission. Enable this only on sites that run exclusively on HTTPS

View File

@@ -2,14 +2,14 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.3.10');
//define('GRAV_TESTING', true);
define('GRAV_VERSION', '1.4.0-rc.2');
define('GRAV_TESTING', true);
define('DS', '/');
if (!defined('GRAV_PHP_MIN')) {

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Backup
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -32,7 +32,7 @@ class ZipBackup
/**
* Backup
*
* @param null $destination
* @param string|null $destination
* @param callable|null $messager
*
* @return null|string
@@ -107,18 +107,19 @@ class ZipBackup
* @param $exclusiveLength
* @param $messager
*/
private static function folderToZip($folder, \ZipArchive &$zipFile, $exclusiveLength, callable $messager = null)
private static function folderToZip($folder, \ZipArchive $zipFile, $exclusiveLength, callable $messager = null)
{
$handle = opendir($folder);
while (false !== $f = readdir($handle)) {
if ($f != '.' && $f != '..') {
if ($f !== '.' && $f !== '..') {
$filePath = "$folder/$f";
// Remove prefix from file path before add to zip.
$localPath = substr($filePath, $exclusiveLength);
if (in_array($f, static::$ignoreFolders)) {
continue;
} elseif (in_array($localPath, static::$ignorePaths)) {
}
if (in_array($localPath, static::$ignorePaths)) {
$zipFile->addEmptyDir($f);
continue;
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -429,6 +429,14 @@ class Cache extends Getters
$output[] = '';
}
// Clear stat cache
@clearstatcache();
// Clear opcache
if (function_exists('opcache_reset')) {
@opcache_reset();
}
return $output;
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common\Config;
@@ -32,7 +32,7 @@ class CompiledBlueprints extends CompiledBase
*/
public function checksum()
{
if (!isset($this->checksum)) {
if (null === $this->checksum) {
$this->checksum = md5(json_encode($this->files) . json_encode($this->getTypes()) . $this->version);
}
@@ -92,6 +92,7 @@ class CompiledBlueprints extends CompiledBase
// Convert file list into parent list.
$list = [];
/** @var array $files */
foreach ($this->files as $files) {
foreach ($files as $name => $item) {
$list[$name][] = $this->path . $item['file'];

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -60,7 +60,7 @@ class CompiledLanguages extends CompiledBase
{
$file = CompiledYamlFile::instance($filename);
if (preg_match('|languages\.yaml$|', $filename)) {
$this->object->mergeRecursive($file->content());
$this->object->mergeRecursive((array) $file->content());
} else {
$this->object->mergeRecursive([$name => $file->content()]);
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -16,6 +16,7 @@ use Grav\Common\Utils;
class Config extends Data
{
/** @var string */
protected $checksum;
protected $modified = false;
protected $timestamp = 0;

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Config
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -133,7 +133,7 @@ class Setup extends Data
*/
public function __construct($container)
{
$environment = isset(static::$environment) ? static::$environment : ($container['uri']->environment() ?: 'localhost');
$environment = null !== static::$environment ? static::$environment : ($container['uri']->environment() ?: 'localhost');
// Pre-load setup.php which contains our initial configuration.
// Configuration may contain dynamic parts, which is why we need to always load it.
@@ -151,11 +151,13 @@ class Setup extends Data
// Set up environment.
$this->def('environment', $environment ?: 'cli');
$this->def('streams.schemes.environment.prefixes', ['' => ($environment ? ["user://{$this->environment}"] : [])]);
$this->def('streams.schemes.environment.prefixes', ['' => $environment ? ["user://{$this->environment}"] : []]);
}
/**
* @return $this
* @throws \RuntimeException
* @throws \InvalidArgumentException
*/
public function init()
{
@@ -175,7 +177,7 @@ class Setup extends Data
// Update streams.
foreach (array_reverse($files) as $path) {
$file = CompiledYamlFile::instance($path);
$content = $file->content();
$content = (array)$file->content();
if (!empty($content['schemes'])) {
$this->items['streams']['schemes'] = $content['schemes'] + $this->items['streams']['schemes'];
}
@@ -196,6 +198,7 @@ class Setup extends Data
* Initialize resource locator by using the configuration.
*
* @param UniformResourceLocator $locator
* @throws \BadMethodCallException
*/
public function initializeLocator(UniformResourceLocator $locator)
{
@@ -212,7 +215,7 @@ class Setup extends Data
$force = isset($config['force']) ? $config['force'] : false;
if (isset($config['prefixes'])) {
foreach ($config['prefixes'] as $prefix => $paths) {
foreach ((array)$config['prefixes'] as $prefix => $paths) {
$locator->addPath($scheme, $prefix, $paths, $override, $force);
}
}
@@ -229,7 +232,7 @@ class Setup extends Data
$schemes = [];
foreach ((array) $this->get('streams.schemes') as $scheme => $config) {
$type = !empty($config['type']) ? $config['type'] : 'ReadOnlyStream';
if ($type[0] != '\\') {
if ($type[0] !== '\\') {
$type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
}
@@ -242,6 +245,8 @@ class Setup extends Data
/**
* @param UniformResourceLocator $locator
* @throws \InvalidArgumentException
* @throws \BadMethodCallException
* @throws \RuntimeException
*/
protected function check(UniformResourceLocator $locator)
{

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -78,7 +78,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
} elseif (is_array($field) && is_array($val)) {
// Array has been defined in blueprints.
$messages += $this->validateArray($field, $val);
} elseif (isset($rules['validation']) && $rules['validation'] == 'strict') {
} elseif (isset($rules['validation']) && $rules['validation'] === 'strict') {
// Undefined/extra item.
throw new \RuntimeException(sprintf('%s is not defined in blueprints', $key));
}
@@ -106,7 +106,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
} elseif (is_array($field) && is_array($val)) {
// Array has been defined in blueprints.
$field = $this->filterArray($field, $val);
} elseif (isset($rules['validation']) && $rules['validation'] == 'strict') {
} elseif (isset($rules['validation']) && $rules['validation'] === 'strict') {
$field = null;
}
@@ -138,7 +138,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
if (isset($data[$name])) {
continue;
}
if ($field['type'] == 'file' && isset($data['data']['name'][$name])) { //handle case of file input fields required
if ($field['type'] === 'file' && isset($data['data']['name'][$name])) { //handle case of file input fields required
continue;
}
@@ -164,7 +164,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
$default = isset($field[$property]) ? $field[$property] : null;
$config = Grav::instance()['config']->get($value, $default);
if (!is_null($config)) {
if (null !== $config) {
$field[$property] = $config;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -65,11 +65,11 @@ class Blueprints
/** @var \DirectoryIterator $file */
foreach ($iterator as $file) {
if (!$file->isFile() || '.' . $file->getExtension() != YAML_EXT) {
if (!$file->isFile() || '.' . $file->getExtension() !== YAML_EXT) {
continue;
}
$name = $file->getBasename(YAML_EXT);
$this->types[$name] = ucfirst(strtr($name, '_', ' '));
$this->types[$name] = ucfirst(str_replace('_', ' ', $name));
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -233,6 +233,7 @@ class Data implements DataInterface, \ArrayAccess, \Countable, ExportInterface
/**
* Save data if storage has been defined.
* @throws \RuntimeException
*/
public function save()
{

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -33,7 +33,7 @@ class Validation
$method = 'type'.strtr($type, '-', '_');
// If value isn't required, we will stop validation if empty value is given.
if ((empty($validate['required']) || (isset($validate['required']) && $validate['required'] !== true)) && ($value === null || $value === '' || ($field['type'] === 'checkbox' && $value == false))) {
if ((empty($validate['required']) || (isset($validate['required']) && $validate['required'] !== true)) && ($value === null || $value === '' || (($field['type'] === 'checkbox' || $field['type'] === 'switch') && $value == false))) {
return $messages;
}
@@ -41,11 +41,6 @@ class Validation
$field['type'] = 'text';
}
// If this is a YAML field, stop validation
if (isset($field['yaml']) && $field['yaml'] === true) {
return $messages;
}
// Get language class.
$language = Grav::instance()['language'];
@@ -54,6 +49,12 @@ class Validation
? $language->translate($field['validate']['message'])
: $language->translate('FORM.INVALID_INPUT', null, true) . ' "' . $language->translate($name) . '"';
// If this is a YAML field validate/filter as such
if ($type != 'yaml' && isset($field['yaml']) && $field['yaml'] === true) {
$method = 'typeYaml';
}
if (method_exists(__CLASS__, $method)) {
$success = self::$method($value, $validate, $field);
} else {
@@ -100,15 +101,16 @@ class Validation
$field['type'] = 'text';
}
// If this is a YAML field, simply parse it and return the value.
if (isset($field['yaml']) && $field['yaml'] === true) {
return $value;
}
// Validate type with fallback type text.
$type = (string) isset($field['validate']['type']) ? $field['validate']['type'] : $field['type'];
$method = 'filter' . ucfirst(strtr($type, '-', '_'));
// If this is a YAML field validate/filter as such
if ($type != 'yaml' && isset($field['yaml']) && $field['yaml'] === true) {
$method = 'filterYaml';
}
if (!method_exists(__CLASS__, $method)) {
$method = 'filterText';
}
@@ -639,22 +641,16 @@ class Validation
return (array) $value;
}
public static function typeYaml($value, $params)
{
try {
Yaml::parse($value);
return true;
} catch (ParseException $e) {
return false;
}
}
public static function filterYaml($value, $params)
{
try {
return (array) Yaml::parse($value);
if (is_string($value)) {
return (array) Yaml::parse($value);
} else {
return $value;
}
} catch (ParseException $e) {
return null;
return $value;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Data
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -36,6 +36,9 @@ class Debugger
*/
public function __construct()
{
// Enable debugger until $this->init() gets called.
$this->enabled = true;
$this->debugbar = new StandardDebugBar();
$this->debugbar['time']->addMeasure('Loading', $this->debugbar['time']->getRequestStartTime(), microtime(true));
}
@@ -51,6 +54,9 @@ class Debugger
$this->grav = Grav::instance();
$this->config = $this->grav['config'];
// Enable/disable debugger based on configuration.
$this->enabled = $this->config->get('system.debugger.enabled');
if ($this->enabled()) {
$this->debugbar->addCollector(new ConfigCollector((array)$this->config->get('system'), 'Config'));
$this->debugbar->addCollector(new ConfigCollector((array)$this->config->get('plugins'), 'Plugins'));
@@ -68,12 +74,8 @@ class Debugger
*/
public function enabled($state = null)
{
if (isset($state)) {
if ($state !== null) {
$this->enabled = $state;
} else {
if (!isset($this->enabled)) {
$this->enabled = $this->config->get('system.debugger.enabled');
}
}
return $this->enabled;
@@ -90,8 +92,7 @@ class Debugger
// Only add assets if Page is HTML
$page = $this->grav['page'];
if ($page->templateFormat() != 'html') {
$this->enabled = false;
if ($page->templateFormat() !== 'html') {
return $this;
}
@@ -106,13 +107,13 @@ class Debugger
// Get the required CSS files
list($css_files, $js_files) = $this->renderer->getAssets(null, JavascriptRenderer::RELATIVE_URL);
foreach ($css_files as $css) {
foreach ((array)$css_files as $css) {
$assets->addCss($css);
}
$assets->addCss('/system/assets/debugger.css');
foreach ($js_files as $js) {
foreach ((array)$js_files as $js) {
$assets->addJs($js);
}
}
@@ -163,6 +164,12 @@ class Debugger
public function render()
{
if ($this->enabled()) {
// Only add assets if Page is HTML
$page = $this->grav['page'];
if (!$this->renderer || $page->templateFormat() !== 'html') {
return $this;
}
echo $this->renderer->render();
}
@@ -176,11 +183,29 @@ class Debugger
*/
public function sendDataInHeaders()
{
$this->debugbar->sendDataInHeaders();
if ($this->enabled()) {
$this->debugbar->sendDataInHeaders();
}
return $this;
}
/**
* Returns collected debugger data.
*
* @return array
*/
public function getData()
{
if (!$this->enabled()) {
return null;
}
$this->timers = [];
return $this->debugbar->getData();
}
/**
* Start a timer with an associated name and description
*
@@ -191,7 +216,7 @@ class Debugger
*/
public function startTimer($name, $description = null)
{
if ($name[0] == '_' || $this->config->get('system.debugger.enabled')) {
if ($name[0] === '_' || $this->enabled()) {
$this->debugbar['time']->startMeasure($name, $description);
$this->timers[] = $name;
}
@@ -208,7 +233,7 @@ class Debugger
*/
public function stopTimer($name)
{
if (in_array($name, $this->timers) && ($name[0] == '_' || $this->config->get('system.debugger.enabled'))) {
if (in_array($name, $this->timers, true) && ($name[0] === '_' || $this->enabled())) {
$this->debugbar['time']->stopMeasure($name);
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Errors
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Errors
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Errors
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -57,6 +57,7 @@ class SimplePageHandler extends Handler
* @param $resource
*
* @return string
* @throws \RuntimeException
*/
protected function getResource($resource)
{
@@ -80,8 +81,7 @@ class SimplePageHandler extends Handler
// If we got this far, nothing was found.
throw new \RuntimeException(
"Could not find resource '$resource' in any resource paths."
. "(searched: " . join(", ", $this->searchPaths). ")"
"Could not find resource '{$resource}' in any resource paths (searched: " . implode(', ', $this->searchPaths). ')'
);
}
@@ -89,7 +89,7 @@ class SimplePageHandler extends Handler
{
if (!is_dir($path)) {
throw new \InvalidArgumentException(
"'$path' is not a valid directory"
"'{$path}' is not a valid directory"
);
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Errors
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.File
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -42,9 +42,9 @@ trait CompiledFile
// Load real file if cache isn't up to date (or is invalid).
if (
!isset($cache['@class'])
|| $cache['@class'] != $class
|| $cache['modified'] != $modified
|| $cache['filename'] != $this->filename
|| $cache['@class'] !== $class
|| $cache['modified'] !== $modified
|| $cache['filename'] !== $this->filename
) {
// Attempt to lock the file for writing.
try {

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.File
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.File
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.File
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.FileSystem
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -108,8 +108,7 @@ abstract class Folder
$files[] = $file->getPathname() . '?'. $file->getMTime();
}
$hash = md5(serialize($files));
return $hash;
return md5(serialize($files));
}
/**
@@ -234,7 +233,7 @@ abstract class Folder
/** @var \RecursiveDirectoryIterator $file */
foreach ($iterator as $file) {
// Ignore hidden files.
if ($file->getFilename()[0] == '.') {
if ($file->getFilename()[0] === '.') {
continue;
}
if (!$folders && $file->isDir()) {
@@ -339,7 +338,7 @@ abstract class Folder
}
// Don't do anything if the source is the same as the new target
if ($source == $target) {
if ($source === $target) {
return;
}
@@ -377,6 +376,7 @@ abstract class Folder
* @param string $target
* @param bool $include_target
* @return bool
* @throws \RuntimeException
*/
public static function delete($target, $include_target = true)
{
@@ -435,6 +435,7 @@ abstract class Folder
* @param $dest
*
* @return bool
* @throws \RuntimeException
*/
public static function rcopy($src, $dest)
{
@@ -447,7 +448,7 @@ abstract class Folder
// If the destination directory does not exist create it
if (!is_dir($dest)) {
Folder::mkdir($dest);
static::mkdir($dest);
}
// Open the source directory to read in files
@@ -455,10 +456,10 @@ abstract class Folder
/** @var \DirectoryIterator $f */
foreach ($i as $f) {
if ($f->isFile()) {
copy($f->getRealPath(), "$dest/" . $f->getFilename());
copy($f->getRealPath(), "{$dest}/" . $f->getFilename());
} else {
if (!$f->isDot() && $f->isDir()) {
static::rcopy($f->getRealPath(), "$dest/$f");
static::rcopy($f->getRealPath(), "{$dest}/{$f}");
}
}
}
@@ -479,10 +480,10 @@ abstract class Folder
}
// Go through all items in filesystem and recursively remove everything.
$files = array_diff(scandir($folder), array('.', '..'));
$files = array_diff(scandir($folder, SCANDIR_SORT_NONE), array('.', '..'));
foreach ($files as $file) {
$path = "{$folder}/{$file}";
(is_dir($path)) ? self::doDelete($path) : @unlink($path);
is_dir($path) ? self::doDelete($path) : @unlink($path);
}
return $include_target ? @rmdir($folder) : true;

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.FileSystem
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -37,7 +37,7 @@ class RecursiveFolderFilterIterator extends \RecursiveFilterIterator
/** @var $current \SplFileInfo */
$current = $this->current();
if ($current->isDir() && !in_array($current->getFilename(), $this::$folder_ignores)) {
if ($current->isDir() && !in_array($current->getFilename(), $this::$folder_ignores, true)) {
return true;
}
return false;

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -719,8 +719,8 @@ class GPM extends Iterator
foreach ($packages as $package_name => $package) {
if (isset($package['dependencies'])) {
foreach ($package['dependencies'] as $dependency) {
if (is_array($dependency)) {
$dependency = array_keys($dependency)[0];
if (is_array($dependency) && isset($dependency['name'])) {
$dependency = $dependency['name'];
}
if ($dependency == $slug) {
@@ -835,6 +835,20 @@ class GPM extends Iterator
continue;
}
// Check PHP version
if ($dependency_slug == 'php') {
$current_php_version = phpversion();
if (version_compare($this->calculateVersionNumberFromDependencyVersion($dependencyVersionWithOperator),
$current_php_version) === 1
) {
//Needs a Grav update first
throw new \Exception("<red>One of the packages require PHP " . $dependencies['php'] . ". Please update PHP to resolve this");
} else {
unset($dependencies[$dependency_slug]);
continue;
}
}
//First, check for Grav dependency. If a dependency requires Grav > the current version, abort and tell.
if ($dependency_slug == 'grav') {
if (version_compare($this->calculateVersionNumberFromDependencyVersion($dependencyVersionWithOperator),
@@ -1062,9 +1076,9 @@ class GPM extends Iterator
} elseif ($version == '') {
return null;
} elseif ($this->versionFormatIsNextSignificantRelease($version)) {
return substr($version, 1);
return trim(substr($version, 1));
} elseif ($this->versionFormatIsEqualOrHigher($version)) {
return substr($version, 2);
return trim(substr($version, 2));
} else {
return $version;
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -18,10 +18,12 @@ class GravCore extends AbstractPackageCollection
private $version;
private $date;
private $min_php;
/**
* @param bool $refresh
* @param null $callback
* @throws \InvalidArgumentException
*/
public function __construct($refresh = false, $callback = null)
{
@@ -36,9 +38,10 @@ class GravCore extends AbstractPackageCollection
$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->min_php = isset($this->data['min_php']) ? $this->data['min_php'] : null;
if (isset($this->data['assets'])) {
foreach ($this->data['assets'] as $slug => $data) {
foreach ((array)$this->data['assets'] as $slug => $data) {
$this->items[$slug] = new Package($data);
}
}
@@ -68,10 +71,10 @@ class GravCore extends AbstractPackageCollection
}
$diffLog = [];
foreach ($this->data['changelog'] as $version => $changelog) {
foreach ((array)$this->data['changelog'] as $version => $changelog) {
preg_match("/[\w-\.]+/", $version, $cleanVersion);
if (!$cleanVersion || version_compare($diff, $cleanVersion[0], ">=")) {
if (!$cleanVersion || version_compare($diff, $cleanVersion[0], '>=')) {
continue;
}
@@ -91,6 +94,11 @@ class GravCore extends AbstractPackageCollection
return $this->date;
}
/**
* Determine if this version of Grav is eligible to be updated
*
* @return mixed
*/
public function isUpdatable()
{
return version_compare(GRAV_VERSION, $this->getVersion(), '<');
@@ -106,6 +114,25 @@ class GravCore extends AbstractPackageCollection
return $this->version;
}
/**
* Returns the minimum PHP version
*
* @return null|string
*/
public function getMinPHPVersion()
{
// If non min set, assume current PHP version
if (is_null($this->min_php)) {
$this->min_php = phpversion();
}
return $this->min_php;
}
/**
* Is this installation symlinked?
*
* @return bool
*/
public function isSymlink()
{
return is_link(GRAV_ROOT . DS . 'index.php');

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.GPM
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -24,11 +24,14 @@ class Upgrader
*/
private $remote;
private $min_php;
/**
* 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
* @throws \InvalidArgumentException
*/
public function __construct($refresh = false, $callback = null)
{
@@ -88,17 +91,33 @@ class Upgrader
}
/**
* Make sure this meets minimum PHP requirements
*
* @return bool
*/
public function meetsRequirements()
{
if (version_compare(PHP_VERSION, GRAV_PHP_MIN, '<')) {
$current_php_version = phpversion();
if (version_compare($current_php_version, $this->minPHPVersion(), '<')) {
return false;
}
return true;
}
/**
* Get minimum PHP version from remote
*
* @return null
*/
public function minPHPVersion()
{
if (is_null($this->min_php)) {
$this->min_php = $this->remote->getMinPHPVersion();
}
return $this->min_php;
}
/**
* Checks if the currently installed Grav is upgradable to a newer version
*

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -15,6 +15,7 @@ use Grav\Common\Page\Medium\Medium;
use Grav\Common\Page\Page;
use RocketTheme\Toolbox\DI\Container;
use RocketTheme\Toolbox\Event\Event;
use RocketTheme\Toolbox\Event\EventDispatcher;
class Grav extends Container
{
@@ -38,8 +39,7 @@ class Grav extends Container
'uri' => 'Grav\Common\Uri',
'events' => 'RocketTheme\Toolbox\Event\EventDispatcher',
'cache' => 'Grav\Common\Cache',
'session' => 'Grav\Common\Session',
'Grav\Common\Service\MessagesServiceProvider',
'Grav\Common\Service\SessionServiceProvider',
'plugins' => 'Grav\Common\Plugins',
'themes' => 'Grav\Common\Themes',
'twig' => 'Grav\Common\Twig\Twig',
@@ -256,11 +256,6 @@ class Grav extends Container
header('ETag: "' . md5($page->raw() . $page->modified()).'"');
}
// Set debugger data in headers
if (!($format === null || $format == 'html')) {
$this['debugger']->enabled(false);
}
// Set HTTP response code
if (isset($this['page']->header()->http_response_code)) {
http_response_code($this['page']->header()->http_response_code);
@@ -440,7 +435,7 @@ class Grav extends Container
*/
public function fallbackUrl($path)
{
$this->fireEvent('onPageFallBackUrl');
$this->fireEvent('onPageFallBackUrl');
/** @var Uri $uri */
$uri = $this['uri'];
@@ -453,10 +448,11 @@ class Grav extends Container
$supported_types = $config->get('media.types');
// Check whitelist first, then ensure extension is a valid media type
if (!empty($fallback_types) && !in_array($uri_extension, $fallback_types)) {
return;
} elseif (!array_key_exists($uri_extension, $supported_types)) {
return;
if (!empty($fallback_types) && !\in_array($uri_extension, $fallback_types, true)) {
return false;
}
if (!array_key_exists($uri_extension, $supported_types)) {
return false;
}
$path_parts = pathinfo($path);

View File

@@ -2,12 +2,15 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common;
/**
* @deprecated 2.0
*/
trait GravTrait
{
protected static $grav;
@@ -21,7 +24,9 @@ trait GravTrait
self::$grav = Grav::instance();
}
$caller = self::$grav['debugger']->getCaller();
self::$grav['debugger']->addMessage("Deprecated GravTrait used in {$caller['file']}", 'deprecated');
return self::$grav;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Helpers
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -32,7 +32,7 @@ class Base32 {
*/
public static function encode( $bytes ) {
$i = 0; $index = 0; $digit = 0;
$base32 = "";
$base32 = '';
$bytes_len = strlen($bytes);
while( $i < $bytes_len ) {
$currByte = ord($bytes{$i});
@@ -51,7 +51,7 @@ class Base32 {
} else {
$digit = ($currByte >> (8 - ($index + 5))) & 0x1F;
$index = ($index + 5) % 8;
if( $index == 0 ) $i++;
if( $index === 0 ) $i++;
}
$base32 .= self::$base32Chars{$digit};
}
@@ -96,7 +96,7 @@ class Base32 {
$bytes[$offset] |= $digit << (8 - $index);
}
}
$bites = "";
$bites = '';
foreach( $bytes as $byte ) $bites .= chr($byte);
return $bites;
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Helpers
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -56,7 +56,7 @@ class Excerpts
public static function getExcerptFromHtml($html, $tag)
{
$doc = new \DOMDocument();
$doc->loadHtml($html);
$doc->loadHTML($html);
$images = $doc->getElementsByTagName($tag);
$excerpt = null;
@@ -142,9 +142,9 @@ class Excerpts
foreach ($actions as $attrib => $value) {
$key = $attrib;
if (in_array($attrib, $valid_attributes)) {
if (in_array($attrib, $valid_attributes, true)) {
// support both class and classes.
if ($attrib == 'classes') {
if ($attrib === 'classes') {
$attrib = 'class';
}
$excerpt['element']['attributes'][$attrib] = str_replace(',', ' ', $value);
@@ -211,8 +211,8 @@ class Excerpts
} else {
// File is also local if scheme is http(s) and host matches.
$local_file = isset($url_parts['path'])
&& (empty($url_parts['scheme']) || in_array($url_parts['scheme'], ['http', 'https']))
&& (empty($url_parts['host']) || $url_parts['host'] == Grav::instance()['uri']->host());
&& (empty($url_parts['scheme']) || in_array($url_parts['scheme'], ['http', 'https'], true))
&& (empty($url_parts['host']) || $url_parts['host'] === Grav::instance()['uri']->host());
if ($local_file) {
$filename = basename($url_parts['path']);
@@ -246,13 +246,14 @@ class Excerpts
// Process operations
$medium = static::processMediaActions($medium, $url_parts);
$element_excerpt = $excerpt['element']['attributes'];
$alt = isset($excerpt['element']['attributes']['alt']) ? $excerpt['element']['attributes']['alt'] : '';
$title = isset($excerpt['element']['attributes']['title']) ? $excerpt['element']['attributes']['title'] : '';
$class = isset($excerpt['element']['attributes']['class']) ? $excerpt['element']['attributes']['class'] : '';
$id = isset($excerpt['element']['attributes']['id']) ? $excerpt['element']['attributes']['id'] : '';
$alt = isset($element_excerpt['alt']) ? $element_excerpt['alt'] : '';
$title = isset($element_excerpt['title']) ? $element_excerpt['title'] : '';
$class = isset($element_excerpt['class']) ? $element_excerpt['class'] : '';
$id = isset($element_excerpt['id']) ? $element_excerpt['id'] : '';
$excerpt['element'] = $medium->parseDownElement($title, $alt, $class, $id, true);
$excerpt['element'] = $medium->parsedownElement($title, $alt, $class, $id, true);
} else {
// Not a current page media file, see if it needs converting to relative.

View File

@@ -2,25 +2,30 @@
/**
* @package Grav.Common.Helpers
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common\Helpers;
use Grav\Common\Grav;
use SebastianBergmann\GlobalState\RuntimeException;
class Exif
{
public $reader;
/**
* Exif constructor.
* @throws RuntimeException
*/
public function __construct()
{
if (Grav::instance()['config']->get('system.media.auto_metadata_exif')) {
if (function_exists('exif_read_data') && class_exists('\PHPExif\Reader\Reader')) {
$this->reader = \PHPExif\Reader\Reader::factory(\PHPExif\Reader\Reader::TYPE_NATIVE);
} else {
throw new \Exception('Please enable the Exif extension for PHP or disable Exif support in Grav system configuration');
throw new \RuntimeException('Please enable the Exif extension for PHP or disable Exif support in Grav system configuration');
}
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Helpers
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -34,7 +34,7 @@ class Truncator {
* @param string $ellipsis String to use as ellipsis (if any).
* @return string Safe truncated HTML.
*/
public static function truncateWords($html, $limit = 0, $ellipsis = "")
public static function truncateWords($html, $limit = 0, $ellipsis = '')
{
if ($limit <= 0) {
return $html;
@@ -94,7 +94,7 @@ class Truncator {
$dom = self::htmlToDomDocument($html);
// Grab the body of our DOM.
$body = $dom->getElementsByTagName("body")->item(0);
$body = $dom->getElementsByTagName('body')->item(0);
// Iterate over letters.
$letters = new DOMLettersIterator($body);
@@ -181,7 +181,7 @@ class Truncator {
{
$avoid = array('a', 'strong', 'em', 'h1', 'h2', 'h3', 'h4', 'h5'); //html tags to avoid appending the ellipsis to
if (in_array($domNode->parentNode->nodeName, $avoid) && $domNode->parentNode->parentNode !== null) {
if ($domNode->parentNode->parentNode !== null && in_array($domNode->parentNode->nodeName, $avoid, true)) {
// Append as text node to parent instead
$textNode = new DOMText($ellipsis);
@@ -204,7 +204,7 @@ class Truncator {
* @return string
*/
private static function innerHTML($element) {
$innerHTML = "";
$innerHTML = '';
$children = $element->childNodes;
foreach ($children as $child)
{

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Language
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -174,23 +174,23 @@ class Language
// if languages set
if ($this->enabled()) {
// try setting from prefix of URL (/en/blah/blah)
// Try setting language from prefix of URL (/en/blah/blah).
if (preg_match($regex, $uri, $matches)) {
$this->lang_in_url = true;
$this->active = $matches[2];
$uri = preg_replace("/\\" . $matches[1] . "/", '', $uri, 1);
$uri = preg_replace("/\\" . $matches[1] . '/', '', $uri, 1);
// store in session if different
if ($this->config->get('system.session.enabled', false)
// Store in session if language is different.
if (isset($this->grav['session']) && $this->grav['session']->started()
&& $this->config->get('system.languages.session_store_active', true)
&& $this->grav['session']->active_language != $this->active
) {
$this->grav['session']->active_language = $this->active;
}
} else {
// try getting from session, else no active
if ($this->config->get('system.session.enabled', false) &&
$this->config->get('system.languages.session_store_active', true)) {
// Try getting language from the session, else no active.
if (isset($this->grav['session']) && $this->grav['session']->started()
&& $this->config->get('system.languages.session_store_active', true)) {
$this->active = $this->grav['session']->active_language ?: null;
}
// if still null, try from http_accept_language header
@@ -203,8 +203,8 @@ class Language
}
}
// repeat if not found, try base language only - fixes Safari sending the language code always
// with a locale (e.g. it-it or fr-fr)
// Repeat if not found, try base language only - fixes Safari sending the language code always
// with a locale (e.g. it-it or fr-fr).
foreach ($preferred as $lang) {
$lang = substr($lang, 0, 2);
if ($this->validate($lang)) {

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Language
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -157,14 +157,13 @@ class LanguageCodes
{
if (isset(static::$codes[$code])) {
return static::get($code, 'nativeName');
} else {
if (preg_match('/[a-zA-Z]{2}-[a-zA-Z]{2}/', $code)) {
return static::get(substr($code, 0, 2), 'nativeName') . ' (' . substr($code, -2) . ')';
} else {
return $code;
}
}
if (preg_match('/[a-zA-Z]{2}-[a-zA-Z]{2}/', $code)) {
return static::get(substr($code, 0, 2), 'nativeName') . ' (' . substr($code, -2) . ')';
}
return $code;
}
public static function getOrientation($code)
@@ -179,7 +178,7 @@ class LanguageCodes
public static function isRtl($code)
{
if (static::getOrientation($code) == 'rtl') {
if (static::getOrientation($code) === 'rtl') {
return true;
}
return false;
@@ -192,7 +191,6 @@ class LanguageCodes
if (isset(static::$codes[$key])) {
$results[$key] = static::$codes[$key];
}
}
return $results;
}
@@ -201,8 +199,8 @@ class LanguageCodes
{
if (isset(static::$codes[$code][$type])) {
return static::$codes[$code][$type];
} else {
return false;
}
return false;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Markdown
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Markdown
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -17,10 +17,12 @@ class ParsedownExtra extends \ParsedownExtra
*
* @param $page
* @param $defaults
* @throws \Exception
*/
public function __construct($page, $defaults)
{
parent::__construct();
$this->init($page, $defaults);
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Markdown
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -35,7 +35,7 @@ trait ParsedownGravTrait
$grav = Grav::instance();
$this->page = $page;
$this->BlockTypes['{'] [] = "TwigTag";
$this->BlockTypes['{'] [] = 'TwigTag';
$this->special_chars = ['>' => 'gt', '<' => 'lt', '"' => 'quot'];
if ($defaults === null) {
@@ -56,6 +56,9 @@ trait ParsedownGravTrait
*
* @param $type
* @param $tag
* @param bool $continuable
* @param bool $completable
* @param $index
*/
public function addBlockType($type, $tag, $continuable = false, $completable = false, $index = null)
{
@@ -67,7 +70,7 @@ trait ParsedownGravTrait
$block = &$this->BlockTypes[$type];
}
if (!isset($index)) {
if (null === $index) {
$block[] = $tag;
} else {
array_splice($block, $index, 0, [$tag]);
@@ -86,10 +89,11 @@ trait ParsedownGravTrait
*
* @param $type
* @param $tag
* @param $index
*/
public function addInlineType($type, $tag, $index = null)
{
if (!isset($index) || !isset($this->InlineTypes[$type])) {
if (null === $index || !isset($this->InlineTypes[$type])) {
$this->InlineTypes[$type] [] = $tag;
} else {
array_splice($this->InlineTypes[$type], $index, 0, [$tag]);
@@ -109,7 +113,7 @@ trait ParsedownGravTrait
*/
protected function isBlockContinuable($Type)
{
$continuable = in_array($Type, $this->continuable_blocks) || method_exists($this, 'block' . $Type . 'Continue');
$continuable = \in_array($Type, $this->continuable_blocks) || method_exists($this, 'block' . $Type . 'Continue');
return $continuable;
}
@@ -123,7 +127,7 @@ trait ParsedownGravTrait
*/
protected function isBlockCompletable($Type)
{
$completable = in_array($Type, $this->completable_blocks) || method_exists($this, 'block' . $Type . 'Complete');
$completable = \in_array($Type, $this->completable_blocks) || method_exists($this, 'block' . $Type . 'Complete');
return $completable;
}
@@ -157,32 +161,31 @@ trait ParsedownGravTrait
/**
* Ensure Twig tags are treated as block level items with no <p></p> tags
*
* @param array $line
* @return array|null
*/
protected function blockTwigTag($Line)
protected function blockTwigTag($line)
{
if (preg_match('/(?:{{|{%|{#)(.*)(?:}}|%}|#})/', $Line['body'], $matches)) {
$Block = [
'markup' => $Line['body'],
];
return $Block;
if (preg_match('/(?:{{|{%|{#)(.*)(?:}}|%}|#})/', $line['body'], $matches)) {
return ['markup' => $line['body']];
}
return null;
}
protected function inlineSpecialCharacter($Excerpt)
protected function inlineSpecialCharacter($excerpt)
{
if ($Excerpt['text'][0] === '&' && !preg_match('/^&#?\w+;/', $Excerpt['text'])) {
if ($excerpt['text'][0] === '&' && !preg_match('/^&#?\w+;/', $excerpt['text'])) {
return [
'markup' => '&amp;',
'extent' => 1,
];
}
if (isset($this->special_chars[$Excerpt['text'][0]])) {
if (isset($this->special_chars[$excerpt['text'][0]])) {
return [
'markup' => '&' . $this->special_chars[$Excerpt['text'][0]] . ';',
'markup' => '&' . $this->special_chars[$excerpt['text'][0]] . ';',
'extent' => 1,
];
}
@@ -199,11 +202,11 @@ trait ParsedownGravTrait
$excerpt['extent'] = $excerpt['extent'] + strlen($matches[1]) - 1;
return $excerpt;
} else {
$excerpt['type'] = 'image';
$excerpt = parent::inlineImage($excerpt);
}
$excerpt['type'] = 'image';
$excerpt = parent::inlineImage($excerpt);
// if this is an image process it
if (isset($excerpt['element']['attributes']['src'])) {
$excerpt = Excerpts::processImageExcerpt($excerpt, $this->page);
@@ -228,10 +231,10 @@ trait ParsedownGravTrait
$excerpt['extent'] = $excerpt['extent'] + strlen($matches[1]) - 1;
return $excerpt;
} else {
$excerpt = parent::inlineLink($excerpt);
}
$excerpt = parent::inlineLink($excerpt);
// if this is a link
if (isset($excerpt['element']['attributes']['href'])) {
$excerpt = Excerpts::processLinkExcerpt($excerpt, $this->page, $type);
@@ -243,10 +246,10 @@ trait ParsedownGravTrait
// For extending this class via plugins
public function __call($method, $args)
{
if (isset($this->$method) === true) {
$func = $this->$method;
if (isset($this->{$method}) === true) {
$func = $this->{$method};
return call_user_func_array($func, $args);
return \call_user_func_array($func, $args);
}
return null;

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -610,4 +610,23 @@ class Collection extends Iterator
return $this;
}
/**
* Get the extended version of this Collection with each page keyed by route
*
* @return array
* @throws \Exception
*/
public function toExtendedArray()
{
$items = [];
foreach ($this->items as $path => $slug) {
$page = $this->pages->get($path);
if ($page !== null) {
$items[$page->route()] = $page->toArray();
}
}
return $items;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -92,6 +92,20 @@ class Medium extends Data implements RenderableInterface
return new Data($this->items);
}
/**
* Check if this medium exists or not
*
* @return bool
*/
public function exists()
{
$path = $this->get('filepath');
if (file_exists($path)) {
return true;
}
return false;
}
/**
* Returns an array containing just the metadata
*
@@ -270,10 +284,14 @@ class Medium extends Data implements RenderableInterface
}
if (empty($attributes['alt'])) {
if (!empty($alt) || $alt === '') {
if (!empty($alt)) {
$attributes['alt'] = $alt;
} elseif (!empty($this->items['alt'])) {
$attributes['alt'] = $this->items['alt'];
} elseif (!empty($this->items['alt_text'])) {
$attributes['alt'] = $this->items['alt_text'];
} else {
$attributes['alt'] = '';
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -34,7 +34,7 @@ class MediumFactory
$config = Grav::instance()['config'];
$media_params = $config->get("media.types.".strtolower($ext));
$media_params = $config->get("media.types." . strtolower($ext));
if (!$media_params) {
return null;
}
@@ -106,7 +106,7 @@ class MediumFactory
* @param ImageMedium $medium
* @param int $from
* @param int $to
* @return Medium
* @return Medium|array
*/
public static function scaledFromMedium($medium, $from, $to)
{

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -123,8 +123,8 @@ class ThumbnailImageMedium extends ImageMedium
{
if (!$testLinked || $this->linked) {
return $this->parent ? call_user_func_array(array($this->parent, $method), $arguments) : $this;
} else {
return call_user_func_array(array($this, 'parent::' . $method), $arguments);
}
return call_user_func_array(array($this, 'parent::' . $method), $arguments);
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -38,14 +38,12 @@ class VideoMedium extends Medium
*/
public function controls($display = true)
{
if($display)
{
if($display) {
$this->attributes['controls'] = true;
}
else
{
} else {
unset($this->attributes['controls']);
}
return $this;
}
@@ -58,6 +56,7 @@ class VideoMedium extends Medium
public function poster($urlImage)
{
$this->attributes['poster'] = $urlImage;
return $this;
}
@@ -69,14 +68,12 @@ class VideoMedium extends Medium
*/
public function loop($status = false)
{
if($status)
{
if($status) {
$this->attributes['loop'] = true;
}
else
{
} else {
unset($this->attributes['loop']);
}
return $this;
}
@@ -88,14 +85,12 @@ class VideoMedium extends Medium
*/
public function autoplay($status = false)
{
if($status)
{
if($status) {
$this->attributes['autoplay'] = true;
}
else
{
} else {
unset($this->attributes['autoplay']);
}
return $this;
}
@@ -109,6 +104,7 @@ class VideoMedium extends Medium
parent::reset();
$this->attributes['controls'] = true;
return $this;
}
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -1109,7 +1109,7 @@ class Page
*/
public function toYaml()
{
return Yaml::dump($this->toArray(), 10);
return Yaml::dump($this->toArray(), 20);
}
/**
@@ -1525,12 +1525,13 @@ class Page
$separator = strpos($key, ':');
$hasSeparator = $separator && $separator < strlen($key) - 1;
$entry = [
'name' => $key,
'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
];
if ($hasSeparator) {
if ($hasSeparator && !Utils::startsWith($key, 'twitter')) {
$entry['property'] = $key;
} else {
$entry['name'] = $key;
}
$this->metadata[$key] = $entry;
@@ -2471,7 +2472,15 @@ class Page
return new Collection();
}
$collection = $this->evaluate($params['items']);
// See if require published filter is set and use that, if assume published=true
$only_published = true;
if (isset($params['filter']['published']) && $params['filter']['published']) {
$only_published = false;
} elseif (isset($params['filter']['non-published']) && $params['filter']['non-published']) {
$only_published = false;
}
$collection = $this->evaluate($params['items'], $only_published);
if (!$collection instanceof Collection) {
$collection = new Collection();
}
@@ -2510,25 +2519,60 @@ class Page
// If a filter or filters are set, filter the collection...
if (isset($params['filter'])) {
// remove any inclusive sets from filer:
$sets = ['published', 'visible', 'modular', 'routable'];
foreach ($sets as $type) {
if (isset($params['filter'][$type]) && isset($params['filter']['non-'.$type])) {
if ($params['filter'][$type] && $params['filter']['non-'.$type]) {
unset ($params['filter'][$type]);
unset ($params['filter']['non-'.$type]);
}
}
}
foreach ((array)$params['filter'] as $type => $filter) {
switch ($type) {
case 'published':
if ((bool) $filter) {
$collection->published();
}
break;
case 'non-published':
if ((bool) $filter) {
$collection->nonPublished();
}
break;
case 'visible':
$collection->visible($filter);
if ((bool) $filter) {
$collection->visible();
}
break;
case 'non-visible':
$collection->nonVisible($filter);
if ((bool) $filter) {
$collection->nonVisible();
}
break;
case 'modular':
$collection->modular($filter);
if ((bool) $filter) {
$collection->modular();
}
break;
case 'non-modular':
$collection->nonModular($filter);
if ((bool) $filter) {
$collection->nonModular();
}
break;
case 'routable':
$collection->routable($filter);
if ((bool) $filter) {
$collection->routable();
}
break;
case 'non-routable':
$collection->nonRoutable($filter);
if ((bool) $filter) {
$collection->nonRoutable();
}
break;
case 'type':
$collection->ofType($filter);
@@ -2589,11 +2633,11 @@ class Page
/**
* @param string|array $value
*
* @param bool $only_published
* @return mixed
* @internal
*/
public function evaluate($value)
public function evaluate($value, $only_published = true)
{
// Parse command.
if (is_string($value)) {
@@ -2662,7 +2706,7 @@ class Page
}
}
$results = $results->published();
break;
case 'page@':
@@ -2706,16 +2750,14 @@ class Page
$results = $page->children()->nonModular();
}
$results = $results->published();
break;
case 'root@':
case '@root':
if (!empty($parts) && $parts[0] === 'descendants') {
$results = $pages->all($pages->root())->nonModular()->published();
$results = $pages->all($pages->root())->nonModular();
} else {
$results = $pages->root()->children()->nonModular()->published();
$results = $pages->root()->children()->nonModular();
}
break;
@@ -2732,10 +2774,14 @@ class Page
if (!empty($parts)) {
$params = [implode('.', $parts) => $params];
}
$results = $taxonomy_map->findTaxonomy($params)->published();
$results = $taxonomy_map->findTaxonomy($params);
break;
}
if ($only_published) {
$results = $results->published();
}
return $results;
}

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -1203,19 +1203,19 @@ class Pages
break;
case 'date':
$list[$key] = $child->date();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'modified':
$list[$key] = $child->modified();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'publish_date':
$list[$key] = $child->publishDate();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'unpublish_date':
$list[$key] = $child->unpublishDate();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'slug':
$list[$key] = $child->slug();

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Page
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
@@ -90,7 +90,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
/**
* Get configuration of the plugin.
*
* @return Config
* @return array
*/
public function config()
{
@@ -121,7 +121,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
if (strpos($uri->path(), $this->config->get('plugins.admin.route') . '/' . $plugin_route) === false) {
$should_run = false;
} elseif (isset($uri->paths()[1]) && $uri->paths()[1] == $plugin_route) {
} elseif (isset($uri->paths()[1]) && $uri->paths()[1] === $plugin_route) {
$should_run = true;
}
@@ -207,6 +207,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
*
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
* @throws LogicException
*/
public function offsetSet($offset, $value)
{
@@ -217,6 +218,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
* Unsets an offset.
*
* @param mixed $offset The offset to unset.
* @throws LogicException
*/
public function offsetUnset($offset)
{
@@ -299,13 +301,14 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
*/
private function mergeArrays($deep = false, $array1, $array2)
{
if ($deep == 'merge') {
if ($deep === 'merge') {
return Utils::arrayMergeRecursiveUnique($array1, $array2);
} elseif ($deep === true) {
return array_replace_recursive($array1, $array2);
} else {
return array_merge($array1, $array2);
}
if ($deep === true) {
return array_replace_recursive($array1, $array2);
}
return array_merge($array1, $array2);
}
/**

View File

@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/

Some files were not shown because too many files have changed in this diff Show More