mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 01:06:15 +02:00
Merge branch 'develop' of https://github.com/getgrav/grav into feature/1.4
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,7 +37,6 @@ Thumbs.db
|
||||
|
||||
# phpstorm
|
||||
.idea/*
|
||||
user/config/security.yaml
|
||||
|
||||
tests/_output/*
|
||||
tests/_support/_generated/*
|
||||
|
||||
@@ -4,6 +4,7 @@ php:
|
||||
- '5.6'
|
||||
- '7.0.21'
|
||||
- '7.1'
|
||||
- '7.2'
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
|
||||
118
CHANGELOG.md
118
CHANGELOG.md
@@ -1,6 +1,26 @@
|
||||
# v1.4.0-rc.3
|
||||
# v1.42
|
||||
## mm/dd/2018
|
||||
|
||||
1. [](#new)
|
||||
* Added new `|nicefilesize` Twig filter for pretty file (auto converts to bytes, kB, MB, GB, etc)
|
||||
* Added new `regex_filter()` Twig function to values in arrays
|
||||
1. [](#improved)
|
||||
* Added bosnian to lang codes [#1917](https://github.com/getgrav/grav/issues/1917)
|
||||
* Improved Zip extraction error codes [#1922](https://github.com/getgrav/grav/issues/1922)
|
||||
1. [](#bugfix)
|
||||
* Fix an issue with Markdown Video and Audio that broke after Parsedown 1.7.0 Security updates [#1924](https://github.com/getgrav/grav/issues/1924)
|
||||
* Fixx for case-sensitive page metadata [admin#1370](https://github.com/getgrav/grav-plugin-admin/issues/1370)
|
||||
|
||||
|
||||
# v1.4.1
|
||||
## 03/11/2018
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed session timing out because of session cookie was not being sent
|
||||
|
||||
# v1.4.0
|
||||
## 03/09/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
|
||||
@@ -10,73 +30,13 @@
|
||||
* 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
|
||||
1. [](#bugfix)
|
||||
* Fixed issue with remote PHP version determination for Grav updates
|
||||
|
||||
# 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
|
||||
@@ -85,15 +45,39 @@
|
||||
* Added `{% script %}` and `{% style %}` tags for Twig templates
|
||||
* Deprecated GravTrait
|
||||
1. [](#improved)
|
||||
* Improved `Session` initialization
|
||||
* Added ability to set a `theme_var()` option in page frontmatter
|
||||
* Force clearing PHP `clearstatcache` and `opcache-reset` on `Cache::clear()`
|
||||
* 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`
|
||||
* 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
|
||||
* Added new configuration option `system.session.initialize` to delay session initialization if needed by a plugin
|
||||
* Vendor library updated to latest
|
||||
* Updated vendor libraries to latest versions
|
||||
* Removed constructor from `ObjectInterface`
|
||||
* Make it possible to include debug bar also into non-HTML responses
|
||||
|
||||
# v1.3.11
|
||||
## mm/dd/2017
|
||||
|
||||
1. [](#improved)
|
||||
* Updated vendor libraries to latest
|
||||
* Updated built-in JQuery to latest 3.3.1
|
||||
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)
|
||||
* Fixed issue with _illegal scheme offset_ in `Uri::convertUrl()` [page-inject#8](https://github.com/getgrav/grav-plugin-page-inject/issues/8)
|
||||
* 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
|
||||
* Date ordering should always be numeric [#1810](https://github.com/getgrav/grav/issues/1810)
|
||||
* 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)
|
||||
* Fixed `BadMethodCallException` thrown in GPM updates [#1784](https://github.com/getgrav/grav/issues/1784)
|
||||
* NOTE: Parsedown security release now escapes `&` to `&` in Markdown links
|
||||
|
||||
# v1.3.10
|
||||
## 12/06/2017
|
||||
|
||||
0
backup/.gitkeep
Normal file
0
backup/.gitkeep
Normal file
211
composer.lock
generated
211
composer.lock
generated
@@ -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",
|
||||
@@ -540,16 +541,16 @@
|
||||
},
|
||||
{
|
||||
"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,7 +588,7 @@
|
||||
"php",
|
||||
"terminal"
|
||||
],
|
||||
"time": "2016-04-04T20:24:59+00:00"
|
||||
"time": "2016-10-30T22:18:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "matthiasmullie/minify",
|
||||
@@ -1040,16 +1041,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
"reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24"
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24",
|
||||
"reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1084,7 +1085,7 @@
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"time": "2017-01-02T13:31:39+00:00"
|
||||
"time": "2017-10-23T01:57:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "roave/security-advisories",
|
||||
@@ -1092,12 +1093,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Roave/SecurityAdvisories.git",
|
||||
"reference": "940eb3dbebd9bb2d82c94ecc896df8b19b9bd867"
|
||||
"reference": "664836e89c7ecad3dbaabc1572ea752c0d532d80"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/940eb3dbebd9bb2d82c94ecc896df8b19b9bd867",
|
||||
"reference": "940eb3dbebd9bb2d82c94ecc896df8b19b9bd867",
|
||||
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/664836e89c7ecad3dbaabc1572ea752c0d532d80",
|
||||
"reference": "664836e89c7ecad3dbaabc1572ea752c0d532d80",
|
||||
"shasum": ""
|
||||
},
|
||||
"conflict": {
|
||||
@@ -1127,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",
|
||||
@@ -1150,7 +1152,8 @@
|
||||
"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,<9.9.99",
|
||||
"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": "<0.6.1",
|
||||
@@ -1163,7 +1166,7 @@
|
||||
"silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
|
||||
"silverstripe/framework": ">=3,<3.3",
|
||||
"silverstripe/userforms": "<3",
|
||||
"simplesamlphp/saml2": "<1.10.4|>=2,<2.3.5|>=3,<3.1.1",
|
||||
"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",
|
||||
@@ -1238,20 +1241,20 @@
|
||||
}
|
||||
],
|
||||
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
|
||||
"time": "2018-02-21T14:50:18+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": {
|
||||
@@ -1286,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",
|
||||
@@ -1338,16 +1341,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v2.8.34",
|
||||
"version": "v2.8.36",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "162ca7d0ea597599967aa63b23418e747da0896b"
|
||||
"reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/162ca7d0ea597599967aa63b23418e747da0896b",
|
||||
"reference": "162ca7d0ea597599967aa63b23418e747da0896b",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27",
|
||||
"reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1395,7 +1398,7 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-29T08:54:45+00:00"
|
||||
"time": "2018-02-26T15:33:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
@@ -1456,16 +1459,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v2.8.34",
|
||||
"version": "v2.8.36",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc"
|
||||
"reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc",
|
||||
"reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f5d2d7dcc33b89e20c2696ea9afcbddf6540081c",
|
||||
"reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1512,7 +1515,7 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-03T07:36:31+00:00"
|
||||
"time": "2018-02-11T16:53:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-iconv",
|
||||
@@ -1634,16 +1637,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v2.8.34",
|
||||
"version": "v2.8.36",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "d083d1664b219a078f5b35c6ce5eab24fa07ff4b"
|
||||
"reference": "e6a3e8c832096f8902a3e80169fca5d202e7e0d3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/d083d1664b219a078f5b35c6ce5eab24fa07ff4b",
|
||||
"reference": "d083d1664b219a078f5b35c6ce5eab24fa07ff4b",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/e6a3e8c832096f8902a3e80169fca5d202e7e0d3",
|
||||
"reference": "e6a3e8c832096f8902a3e80169fca5d202e7e0d3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1698,11 +1701,11 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2018-01-29T08:54:45+00:00"
|
||||
"time": "2018-01-31T10:36:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v2.8.34",
|
||||
"version": "v2.8.36",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
@@ -1751,16 +1754,16 @@
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
@@ -1812,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": {
|
||||
@@ -1873,24 +1876,25 @@
|
||||
"gherkin",
|
||||
"parser"
|
||||
],
|
||||
"time": "2016-10-30T11:50:56+00:00"
|
||||
"time": "2017-08-30T11:04:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "codeception/codeception",
|
||||
"version": "2.3.8",
|
||||
"version": "2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Codeception/Codeception.git",
|
||||
"reference": "43eade17a8cd68e9cde401e8585b09d11d41b12d"
|
||||
"reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/43eade17a8cd68e9cde401e8585b09d11d41b12d",
|
||||
"reference": "43eade17a8cd68e9cde401e8585b09d11d41b12d",
|
||||
"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": "*",
|
||||
@@ -1898,10 +1902,6 @@
|
||||
"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",
|
||||
"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",
|
||||
@@ -1967,7 +1967,46 @@
|
||||
"functional testing",
|
||||
"unit testing"
|
||||
],
|
||||
"time": "2018-01-27T22:47:33+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",
|
||||
@@ -3348,7 +3387,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.4.4",
|
||||
"version": "v3.4.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
@@ -3405,16 +3444,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.4.4",
|
||||
"version": "v3.4.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "e66394bc7610e69279bfdb3ab11b4fe65403f556"
|
||||
"reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/e66394bc7610e69279bfdb3ab11b4fe65403f556",
|
||||
"reference": "e66394bc7610e69279bfdb3ab11b4fe65403f556",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/544655f1fc078a9cd839fdda2b7b1e64627c826a",
|
||||
"reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3454,20 +3493,20 @@
|
||||
],
|
||||
"description": "Symfony CssSelector Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-03T07:37:34+00:00"
|
||||
"time": "2018-02-03T14:55:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.4.4",
|
||||
"version": "v3.4.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a"
|
||||
"reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/09bd97b844b3151fab82f2fdd62db9c464b3910a",
|
||||
"reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
|
||||
"reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3510,20 +3549,20 @@
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-03T07:37:34+00:00"
|
||||
"time": "2018-02-22T10:48:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v3.4.4",
|
||||
"version": "v3.4.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f"
|
||||
"reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/613e26310776f49a1773b6737c6bd554b8bc8c6f",
|
||||
"reference": "613e26310776f49a1773b6737c6bd554b8bc8c6f",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625",
|
||||
"reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3559,20 +3598,20 @@
|
||||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-03T07:37:34+00:00"
|
||||
"time": "2018-03-05T18:28:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v3.4.4",
|
||||
"version": "v3.4.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "09a5172057be8fc677840e591b17f385e58c7c0d"
|
||||
"reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/09a5172057be8fc677840e591b17f385e58c7c0d",
|
||||
"reference": "09a5172057be8fc677840e591b17f385e58c7c0d",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/cc4aea21f619116aaf1c58016a944e4821c8e8af",
|
||||
"reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3608,7 +3647,7 @@
|
||||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-01-29T09:03:43+00:00"
|
||||
"time": "2018-02-12T17:55:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "victorjonsson/markdowndocs",
|
||||
|
||||
@@ -17,7 +17,7 @@ if (!is_file($autoload)) {
|
||||
|
||||
if (PHP_SAPI == 'cli-server') {
|
||||
if (!isset($_SERVER['PHP_CLI_ROUTER'])) {
|
||||
die("PHP webserver requires a router to run Grav, please use: <pre>php -S {$_SERVER["SERVER_NAME"]}:{$_SERVER["SERVER_PORT"]} system/router.php</pre>");
|
||||
die("PHP webserver requires a router to run Grav, please use: <pre>php -S {$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']} system/router.php</pre>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
6
system/assets/jquery/jquery-3.x.min.js
vendored
6
system/assets/jquery/jquery-3.x.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -25,7 +25,7 @@ home:
|
||||
hide_in_urls: false # Hide the home route in URLs
|
||||
|
||||
pages:
|
||||
theme: antimatter # Default theme (defaults to "antimatter" theme)
|
||||
theme: quark # Default theme (defaults to "quark" theme)
|
||||
order:
|
||||
by: default # Order pages by "default", "alpha" or "date"
|
||||
dir: asc # Default ordering direction, "asc" or "desc"
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.4.0-rc.2');
|
||||
define('GRAV_TESTING', true);
|
||||
define('GRAV_VERSION', '1.4.1');
|
||||
define('GRAV_TESTING', false);
|
||||
define('DS', '/');
|
||||
|
||||
if (!defined('GRAV_PHP_MIN')) {
|
||||
|
||||
@@ -617,7 +617,7 @@ class Assets
|
||||
|
||||
$inlineGroup = array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline';
|
||||
|
||||
$attributes = $this->attributes(array_merge(['type' => 'text/javascript'], $attributes));
|
||||
$attributes = $this->attributes($attributes);
|
||||
|
||||
$output = '';
|
||||
$inline_js = '';
|
||||
|
||||
@@ -429,6 +429,14 @@ class Cache extends Getters
|
||||
$output[] = '';
|
||||
}
|
||||
|
||||
// Clear stat cache
|
||||
@clearstatcache();
|
||||
|
||||
// Clear opcache
|
||||
if (function_exists('opcache_reset')) {
|
||||
@opcache_reset();
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,10 +189,59 @@ class Installer
|
||||
return $extracted_folder;
|
||||
}
|
||||
|
||||
self::$error = self::ZIP_EXTRACT_ERROR;
|
||||
self::$error = self::getZipError($archive);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a more useful ZIP error
|
||||
*
|
||||
* @param $res
|
||||
* @return string
|
||||
*/
|
||||
protected static function getZipError($res)
|
||||
{
|
||||
switch($res){
|
||||
case ZipArchive::ER_EXISTS:
|
||||
$error = "File already exists.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_INCONS:
|
||||
$error = "Zip archive inconsistent.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_MEMORY:
|
||||
$error = "Malloc failure.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_NOENT:
|
||||
$error = "No such file.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_NOZIP:
|
||||
$error = "Not a zip archive.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_OPEN:
|
||||
$error = "Can't open file.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_READ:
|
||||
$error = "Read error.";
|
||||
break;
|
||||
|
||||
case ZipArchive::ER_SEEK:
|
||||
$error = "Seek error.";
|
||||
break;
|
||||
|
||||
default:
|
||||
$error = self::ZIP_EXTRACT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates and returns the package installer class
|
||||
|
||||
@@ -246,11 +246,12 @@ 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);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ class LanguageCodes
|
||||
'bn-BD' => [ 'name' => 'Bengali (Bangladesh)', 'nativeName' => 'বাংলা (বাংলাদেশ)' ],
|
||||
'bn-IN' => [ 'name' => 'Bengali (India)', 'nativeName' => 'বাংলা (ভারত)' ],
|
||||
'br' => [ 'name' => 'Breton', 'nativeName' => 'Brezhoneg' ],
|
||||
'bs' => [ 'name' => 'Bosnian', 'nativeName' => 'Bosanski' ],
|
||||
'ca' => [ 'name' => 'Catalan', 'nativeName' => 'Català' ],
|
||||
'ca-valencia'=> [ 'name' => 'Catalan (Valencian)', 'nativeName' => 'Català (valencià)' ], // not iso-639-1. a=l10n-drivers
|
||||
'cs' => [ 'name' => 'Czech', 'nativeName' => 'Čeština' ],
|
||||
|
||||
@@ -243,6 +243,19 @@ trait ParsedownGravTrait
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Text as-is to get around Parsedown security fixes
|
||||
* which break these fields
|
||||
*
|
||||
* @param $text
|
||||
* @param $nestable
|
||||
* @return mixed
|
||||
*/
|
||||
public function html($text, $nestable)
|
||||
{
|
||||
return $text;
|
||||
}
|
||||
|
||||
// For extending this class via plugins
|
||||
public function __call($method, $args)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ class AudioMedium extends Medium
|
||||
|
||||
return [
|
||||
'name' => 'audio',
|
||||
'handler' => 'html',
|
||||
'text' => '<source src="' . $location . '">Your browser does not support the audio tag.',
|
||||
'attributes' => $attributes
|
||||
];
|
||||
|
||||
@@ -284,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'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ class VideoMedium extends Medium
|
||||
|
||||
return [
|
||||
'name' => 'video',
|
||||
'text' => '<source src="' . $location . '">Your browser does not support the video tag.',
|
||||
'handler' => 'html',
|
||||
'text' => '<source src="' . $location . '">Your2 browser does not support the video tag.',
|
||||
'attributes' => $attributes
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1109,7 +1109,7 @@ class Page
|
||||
*/
|
||||
public function toYaml()
|
||||
{
|
||||
return Yaml::dump($this->toArray(), 10);
|
||||
return Yaml::dump($this->toArray(), 20);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1499,6 +1499,8 @@ class Page
|
||||
|
||||
// Build an array of meta objects..
|
||||
foreach ((array)$metadata as $key => $value) {
|
||||
// Lowercase the key
|
||||
$key = strtolower($key);
|
||||
// If this is a property type metadata: "og", "twitter", "facebook" etc
|
||||
// Backward compatibility for nested arrays in metas
|
||||
if (is_array($value)) {
|
||||
@@ -2495,7 +2497,7 @@ class Page
|
||||
|
||||
if ($process_taxonomy) {
|
||||
foreach ((array)$config->get('site.taxonomies') as $taxonomy) {
|
||||
if ($uri->param($taxonomy)) {
|
||||
if ($uri->param(rawurlencode($taxonomy))) {
|
||||
$items = explode(',', $uri->param($taxonomy));
|
||||
$collection->setParams(['taxonomies' => [$taxonomy => $items]]);
|
||||
|
||||
|
||||
@@ -15,6 +15,29 @@ class Session extends BaseSession
|
||||
/** @var bool */
|
||||
protected $autoStart = false;
|
||||
|
||||
protected $lifetime;
|
||||
protected $path;
|
||||
protected $domain;
|
||||
protected $secure;
|
||||
protected $httpOnly;
|
||||
|
||||
/**
|
||||
* @param int $lifetime Defaults to 1800 seconds.
|
||||
* @param string $path Cookie path.
|
||||
* @param string $domain Optional, domain for the session
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function __construct($lifetime, $path, $domain = null)
|
||||
{
|
||||
$this->lifetime = $lifetime;
|
||||
$this->path = $path;
|
||||
$this->domain = $domain;
|
||||
|
||||
if (php_sapi_name() !== 'cli') {
|
||||
parent::__construct($lifetime, $path, $domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize session.
|
||||
*
|
||||
@@ -25,6 +48,9 @@ class Session extends BaseSession
|
||||
if ($this->autoStart) {
|
||||
$this->start();
|
||||
|
||||
// TODO: This setcookie shouldn't be here, session should by itself be able to update its cookie.
|
||||
setcookie(session_name(), session_id(), $this->lifetime ? time() + $this->lifetime : 0, $this->path, $this->domain, $this->secure, $this->httpOnly);
|
||||
|
||||
$this->autoStart = false;
|
||||
}
|
||||
}
|
||||
@@ -46,18 +72,20 @@ class Session extends BaseSession
|
||||
*/
|
||||
public function setSecure($secure)
|
||||
{
|
||||
$this->secure = $secure;
|
||||
ini_set('session.cookie_secure', (bool)$secure);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $httponly
|
||||
* @param bool $httpOnly
|
||||
* @return $this
|
||||
*/
|
||||
public function setHttpOnly($httponly)
|
||||
public function setHttpOnly($httpOnly)
|
||||
{
|
||||
ini_set('session.cookie_httponly', (bool)$httponly);
|
||||
$this->httpOnly = $httpOnly;
|
||||
ini_set('session.cookie_httponly', (bool)$httpOnly);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,9 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
new \Twig_SimpleFilter('absolute_url', [$this, 'absoluteUrlFilter']),
|
||||
new \Twig_SimpleFilter('contains', [$this, 'containsFilter']),
|
||||
new \Twig_SimpleFilter('chunk_split', [$this, 'chunkSplitFilter']),
|
||||
|
||||
new \Twig_SimpleFilter('nicenumber', [$this, 'niceNumberFunc']),
|
||||
new \Twig_SimpleFilter('nicefilesize', [$this, 'niceFilesizeFunc']),
|
||||
new \Twig_SimpleFilter('nicetime', [$this, 'nicetimeFunc']),
|
||||
new \Twig_SimpleFilter('defined', [$this, 'definedDefaultFilter']),
|
||||
new \Twig_SimpleFilter('ends_with', [$this, 'endsWithFilter']),
|
||||
new \Twig_SimpleFilter('fieldName', [$this, 'fieldNameFilter']),
|
||||
@@ -76,7 +77,6 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
new \Twig_SimpleFilter('base32_decode', [$this, 'base32DecodeFilter']),
|
||||
new \Twig_SimpleFilter('base64_encode', [$this, 'base64EncodeFilter']),
|
||||
new \Twig_SimpleFilter('base64_decode', [$this, 'base64DecodeFilter']),
|
||||
new \Twig_SimpleFilter('nicetime', [$this, 'nicetimeFilter']),
|
||||
new \Twig_SimpleFilter('randomize', [$this, 'randomizeFilter']),
|
||||
new \Twig_SimpleFilter('modulus', [$this, 'modulusFilter']),
|
||||
new \Twig_SimpleFilter('rtrim', [$this, 'rtrimFilter']),
|
||||
@@ -129,6 +129,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
new \Twig_simpleFunction('random_string', [$this, 'randomStringFunc']),
|
||||
new \Twig_SimpleFunction('repeat', [$this, 'repeatFunc']),
|
||||
new \Twig_SimpleFunction('regex_replace', [$this, 'regexReplace']),
|
||||
new \Twig_SimpleFunction('regex_filter', [$this, 'regexFilter']),
|
||||
new \Twig_SimpleFunction('string', [$this, 'stringFunc']),
|
||||
new \Twig_simpleFunction('t', [$this, 'translate']),
|
||||
new \Twig_simpleFunction('tl', [$this, 'translateLanguage']),
|
||||
@@ -145,6 +146,9 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
new \Twig_SimpleFunction('theme_var', [$this, 'themeVarFunc']),
|
||||
new \Twig_SimpleFunction('header_var', [$this, 'pageHeaderVarFunc']),
|
||||
new \Twig_SimpleFunction('read_file', [$this, 'readFileFunc']),
|
||||
new \Twig_SimpleFunction('nicenumber', [$this, 'niceNumberFunc']),
|
||||
new \Twig_SimpleFunction('nicefilesize', [$this, 'niceFilesizeFunc']),
|
||||
new \Twig_SimpleFunction('nicetime', [$this, 'nicetimeFilter']),
|
||||
|
||||
];
|
||||
}
|
||||
@@ -255,8 +259,8 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return $items[$remainder];
|
||||
}
|
||||
|
||||
return $items[0];
|
||||
}
|
||||
return $items[0];
|
||||
}
|
||||
|
||||
return $remainder;
|
||||
}
|
||||
@@ -299,10 +303,10 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return $inflector->$action($data, $count);
|
||||
}
|
||||
|
||||
return $inflector->$action($data);
|
||||
}
|
||||
return $inflector->$action($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +443,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function nicetimeFilter($date, $long_strings = true)
|
||||
public function nicetimeFunc($date, $long_strings = true)
|
||||
{
|
||||
if (empty($date)) {
|
||||
return $this->grav['language']->translate('NICETIME.NO_DATE_PROVIDED', null, true);
|
||||
@@ -523,7 +527,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return "{$tense}";
|
||||
}
|
||||
|
||||
return "$difference $periods[$j] {$tense}";
|
||||
return "$difference $periods[$j] {$tense}";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -599,7 +603,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
public function definedDefaultFilter($value, $default = null)
|
||||
{
|
||||
return null !== $value ? $value : $default;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
@@ -683,7 +687,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
public function urlFunc($input, $domain = false)
|
||||
{
|
||||
return Utils::url($input, $domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will evaluate Twig $twig through the $environment, and return its results.
|
||||
@@ -699,6 +703,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
|
||||
$template = $env->createTemplate($twig);
|
||||
return $template->render($context);
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -822,9 +827,9 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return array($key => $val);
|
||||
}
|
||||
|
||||
$current_array[$key] = $val;
|
||||
return $current_array;
|
||||
}
|
||||
$current_array[$key] = $val;
|
||||
return $current_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for array_intersect() method
|
||||
@@ -855,8 +860,8 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return json_encode($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a string
|
||||
@@ -957,6 +962,18 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return preg_replace($pattern, $replace, $subject, $limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Twig wrapper for PHP's preg_grep method
|
||||
*
|
||||
* @param $array
|
||||
* @param $regex
|
||||
* @param int $flags
|
||||
* @return array
|
||||
*/
|
||||
public function regexFilter($array, $regex, $flags = 0) {
|
||||
return preg_grep($regex, $array, $flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* redirect browser from twig
|
||||
*
|
||||
@@ -1025,10 +1042,10 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
return $exif_data->getRawData();
|
||||
}
|
||||
|
||||
return $exif_data->getData();
|
||||
return $exif_data->getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1050,7 +1067,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
|
||||
if (file_exists($filepath)) {
|
||||
return file_get_contents($filepath);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1087,6 +1104,43 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
var_dump($var);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a nicer more readable filesize based on bytes
|
||||
*
|
||||
* @param $bytes
|
||||
* @return string
|
||||
*/
|
||||
public function niceFilesizeFunc($bytes)
|
||||
{
|
||||
if ($bytes >= 1073741824)
|
||||
{
|
||||
$bytes = number_format($bytes / 1073741824, 2) . ' GB';
|
||||
}
|
||||
elseif ($bytes >= 1048576)
|
||||
{
|
||||
$bytes = number_format($bytes / 1048576, 2) . ' MB';
|
||||
}
|
||||
elseif ($bytes >= 1024)
|
||||
{
|
||||
$bytes = number_format($bytes / 1024, 1) . ' KB';
|
||||
}
|
||||
elseif ($bytes > 1)
|
||||
{
|
||||
$bytes = $bytes . ' bytes';
|
||||
}
|
||||
elseif ($bytes == 1)
|
||||
{
|
||||
$bytes = $bytes . ' byte';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bytes = '0 bytes';
|
||||
}
|
||||
|
||||
return $bytes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a nicer more readable number
|
||||
*
|
||||
@@ -1129,7 +1183,9 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
*/
|
||||
public function themeVarFunc($var, $default = null)
|
||||
{
|
||||
return $this->config->get('theme.' . $var, $default);
|
||||
$header = $this->grav['page']->header();
|
||||
$header_classes = isset($header->$var) ? $header->$var : null;
|
||||
return $header_classes ?: $this->config->get('theme.' . $var, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -611,8 +611,8 @@ class Uri
|
||||
return $ip;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* Returns current Uri.
|
||||
*
|
||||
* @return \Grav\Framework\Uri\Uri
|
||||
|
||||
@@ -120,6 +120,8 @@ class CleanCommand extends Command
|
||||
'vendor/league/climate/composer.json',
|
||||
'vendor/matthiasmullie/minify/bin',
|
||||
'vendor/matthiasmullie/minify/composer.json',
|
||||
'vendor/matthiasmullie/minify/docker-composer.yml',
|
||||
'vendor/matthiasmullie/minify/Dockerfile',
|
||||
'vendor/matthiasmullie/minify/CONTRIBUTING.md',
|
||||
'vendor/matthiasmullie/path-converter/composer.json',
|
||||
'vendor/maximebf/debugbar/bower.json',
|
||||
@@ -151,6 +153,7 @@ class CleanCommand extends Command
|
||||
'vendor/pimple/pimple/src/Pimple/Tests',
|
||||
'vendor/psr/container/composer.json',
|
||||
'vendor/psr/container/.gitignore',
|
||||
'vendor/psr/simple-cache/composer.json',
|
||||
'vendor/psr/log/composer.json',
|
||||
'vendor/psr/log/.gitignore',
|
||||
'vendor/rockettheme/toolbox/.git',
|
||||
|
||||
@@ -49,7 +49,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
|
||||
$this->assets->add('test.js');
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" ></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
|
||||
|
||||
$array = $this->assets->getCss();
|
||||
$this->assertSame([
|
||||
@@ -112,7 +112,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('test.js');
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" ></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
|
||||
|
||||
$array = $this->assets->getJs();
|
||||
$this->assertSame([
|
||||
@@ -154,7 +154,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$js = $this->assets->js();
|
||||
$this->assertEmpty($js);
|
||||
$js = $this->assets->js('footer');
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" ></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
|
||||
|
||||
$array = $this->assets->getJs();
|
||||
$this->assertSame([
|
||||
@@ -173,7 +173,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('test.js', null, true, 'async', null);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
|
||||
|
||||
$array = $this->assets->getJs();
|
||||
$this->assertSame([
|
||||
@@ -191,7 +191,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('test.js', null, true, 'defer', null);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" defer></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" defer></script>' . PHP_EOL, $js);
|
||||
|
||||
$array = $this->assets->getJs();
|
||||
$this->assertSame([
|
||||
@@ -235,7 +235,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('test.js', ['loading' => 'async']);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
|
||||
$this->assets->reset();
|
||||
|
||||
}
|
||||
@@ -246,24 +246,24 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('jquery', ['loading' => 'async']);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
|
||||
|
||||
//Test priority too
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('jquery', ['loading' => 'async', 'priority' => 1]);
|
||||
$this->assets->addJs('test.js', ['loading' => 'async', 'priority' => 2]);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" async></script>' . PHP_EOL .
|
||||
'<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" async></script>' . PHP_EOL .
|
||||
'<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
|
||||
|
||||
//Test multiple groups
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('jquery', ['loading' => 'async', 'priority' => 1, 'group' => 'footer']);
|
||||
$this->assets->addJs('test.js', ['loading' => 'async', 'priority' => 2]);
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
|
||||
$js = $this->assets->js('footer');
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
|
||||
|
||||
//Test adding array of assets
|
||||
//Test priority too
|
||||
@@ -271,8 +271,8 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->addJs(['jquery', 'test.js'], ['loading' => 'async']);
|
||||
$js = $this->assets->js();
|
||||
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" async></script>' . PHP_EOL .
|
||||
'<script src="/test.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL .
|
||||
'<script src="/test.js" async></script>' . PHP_EOL, $js);
|
||||
}
|
||||
|
||||
public function testAddingCSSAssetPropertiesWithArrayFromCollection()
|
||||
@@ -389,7 +389,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addAsyncJs('jquery');
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" async></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
|
||||
}
|
||||
|
||||
public function testAddDeferJs()
|
||||
@@ -397,7 +397,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->reset();
|
||||
$this->assets->addDeferJs('jquery');
|
||||
$js = $this->assets->js();
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" type="text/javascript" defer></script>' . PHP_EOL, $js);
|
||||
$this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" defer></script>' . PHP_EOL, $js);
|
||||
}
|
||||
|
||||
public function testTimestamps()
|
||||
@@ -435,28 +435,28 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->setTimestamp('foo');
|
||||
$this->assets->addJs('test.js');
|
||||
$css = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js?foo" type="text/javascript" ></script>' . PHP_EOL, $css);
|
||||
$this->assertSame('<script src="/test.js?foo" ></script>' . PHP_EOL, $css);
|
||||
|
||||
// local JS already with param
|
||||
$this->assets->reset();
|
||||
$this->assets->setTimestamp('foo');
|
||||
$this->assets->addJs('test.js?bar');
|
||||
$css = $this->assets->js();
|
||||
$this->assertSame('<script src="/test.js?bar&foo" type="text/javascript" ></script>' . PHP_EOL, $css);
|
||||
$this->assertSame('<script src="/test.js?bar&foo" ></script>' . PHP_EOL, $css);
|
||||
|
||||
// external JS already
|
||||
$this->assets->reset();
|
||||
$this->assets->setTimestamp('foo');
|
||||
$this->assets->addJs('http://somesite.com/test.js');
|
||||
$css = $this->assets->js();
|
||||
$this->assertSame('<script src="http://somesite.com/test.js?foo" type="text/javascript" ></script>' . PHP_EOL, $css);
|
||||
$this->assertSame('<script src="http://somesite.com/test.js?foo" ></script>' . PHP_EOL, $css);
|
||||
|
||||
// external JS already with param
|
||||
$this->assets->reset();
|
||||
$this->assets->setTimestamp('foo');
|
||||
$this->assets->addJs('http://somesite.com/test.js?bar');
|
||||
$css = $this->assets->js();
|
||||
$this->assertSame('<script src="http://somesite.com/test.js?bar&foo" type="text/javascript" ></script>' . PHP_EOL, $css);
|
||||
$this->assertSame('<script src="http://somesite.com/test.js?bar&foo" ></script>' . PHP_EOL, $css);
|
||||
}
|
||||
|
||||
public function testAddInlineCss()
|
||||
@@ -499,49 +499,49 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
$this->assets->addInlineJs('alert("test")');
|
||||
$this->assets->reset();
|
||||
$this->assertSame(0, count($this->assets->js()));
|
||||
$this->assertSame(0, count((array) $this->assets->js()));
|
||||
|
||||
$this->assets->addAsyncJs('jquery');
|
||||
$this->assets->reset();
|
||||
|
||||
$this->assertSame(0, count($this->assets->js()));
|
||||
$this->assertSame(0, count((array) $this->assets->js()));
|
||||
|
||||
$this->assets->addInlineCss('body { color: black }');
|
||||
$this->assets->reset();
|
||||
|
||||
$this->assertSame(0, count($this->assets->css()));
|
||||
$this->assertSame(0, count((array) $this->assets->css()));
|
||||
|
||||
$this->assets->add('/system/assets/debugger.css', null, true);
|
||||
$this->assets->reset();
|
||||
|
||||
$this->assertSame(0, count($this->assets->css()));
|
||||
$this->assertSame(0, count((array) $this->assets->css()));
|
||||
}
|
||||
|
||||
public function testResetJs()
|
||||
{
|
||||
$this->assets->addInlineJs('alert("test")');
|
||||
$this->assets->resetJs();
|
||||
$this->assertSame(0, count($this->assets->js()));
|
||||
$this->assertSame(0, count((array) $this->assets->js()));
|
||||
|
||||
$this->assets->addAsyncJs('jquery');
|
||||
$this->assets->resetJs();
|
||||
|
||||
$this->assertSame(0, count($this->assets->js()));
|
||||
$this->assertSame(0, count((array) $this->assets->js()));
|
||||
}
|
||||
|
||||
public function testResetCss()
|
||||
{
|
||||
$this->assertSame(0, count($this->assets->js()));
|
||||
$this->assertSame(0, count((array) $this->assets->js()));
|
||||
|
||||
$this->assets->addInlineCss('body { color: black }');
|
||||
$this->assets->resetCss();
|
||||
|
||||
$this->assertSame(0, count($this->assets->css()));
|
||||
$this->assertSame(0, count((array) $this->assets->css()));
|
||||
|
||||
$this->assets->add('/system/assets/debugger.css', null, true);
|
||||
$this->assets->resetCss();
|
||||
|
||||
$this->assertSame(0, count($this->assets->css()));
|
||||
$this->assertSame(0, count((array) $this->assets->css()));
|
||||
}
|
||||
|
||||
public function testAddDirCss()
|
||||
@@ -549,50 +549,50 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->addDirCss('/system');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertCount(0, $this->assets->getJs());
|
||||
$this->assertCount(0, (array) $this->assets->getJs());
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addDirCss('/system/assets');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertCount(0, $this->assets->getJs());
|
||||
$this->assertCount(0, (array) $this->assets->getJs());
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addDirJs('/system');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertCount(0, $this->assets->getCss());
|
||||
$this->assertCount(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getJs());
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addDirJs('/system/assets');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertCount(0, $this->assets->getCss());
|
||||
$this->assertCount(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getJs());
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addDir('/system/assets');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getJs());
|
||||
|
||||
//Use streams
|
||||
$this->assets->reset();
|
||||
$this->assets->addDir('system://assets');
|
||||
|
||||
$this->assertInternalType('array', $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, $this->assets->getCss());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getCss());
|
||||
$this->assertInternalType('array', $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, $this->assets->getJs());
|
||||
$this->assertGreaterThan(0, (array) $this->assets->getJs());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->parsedown->text('[cnn.com](http://www.cnn.com)'));
|
||||
$this->assertSame('<p><a href="https://www.google.com">google.com</a></p>',
|
||||
$this->parsedown->text('[google.com](https://www.google.com)'));
|
||||
$this->assertSame('<p><a href="https://github.com/getgrav/grav/issues/new?title=%5Badd-resource%5D%20New%20Plugin%2FTheme&body=Hello%20%2A%2AThere%2A%2A">complex url</a></p>',
|
||||
$this->assertSame('<p><a href="https://github.com/getgrav/grav/issues/new?title=%5Badd-resource%5D%20New%20Plugin%2FTheme&body=Hello%20%2A%2AThere%2A%2A">complex url</a></p>',
|
||||
$this->parsedown->text('[complex url](https://github.com/getgrav/grav/issues/new?title=[add-resource]%20New%20Plugin/Theme&body=Hello%20**There**)'));
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->parsedown->text('[Relative Target](../item2-3?target=_blank)'));
|
||||
$this->assertSame('<p><a href="/item2/item2-3" rel="nofollow">Relative Rel</a></p>',
|
||||
$this->parsedown->text('[Relative Rel](../item2-3?rel=nofollow)'));
|
||||
$this->assertSame('<p><a href="/item2/item2-3?foo=bar&baz=qux" rel="nofollow" class="button">Relative Mixed</a></p>',
|
||||
$this->assertSame('<p><a href="/item2/item2-3?foo=bar&baz=qux" rel="nofollow" class="button">Relative Mixed</a></p>',
|
||||
$this->parsedown->text('[Relative Mixed](../item2-3?foo=bar&baz=qux&rel=nofollow&class=button)'));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,11 +62,11 @@ class TwigExtensionTest extends \Codeception\TestCase\Test
|
||||
$threeYears = time() - (60*60*24*365*3);
|
||||
$measures = ['minutes','hours','days','months','years'];
|
||||
|
||||
$this->assertSame('No date provided', $this->twig_ext->nicetimeFilter(null));
|
||||
$this->assertSame('No date provided', $this->twig_ext->nicetimeFunc(null));
|
||||
|
||||
for ($i=0; $i<count($measures); $i++) {
|
||||
$time = 'three' . ucfirst($measures[$i]);
|
||||
$this->assertSame('3 ' . $measures[$i] . ' ago', $this->twig_ext->nicetimeFilter($$time));
|
||||
$this->assertSame('3 ' . $measures[$i] . ' ago', $this->twig_ext->nicetimeFunc($$time));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,5 +41,5 @@ debugger:
|
||||
shutdown:
|
||||
close_connection: true
|
||||
gpm:
|
||||
releases: testing
|
||||
releases: stable
|
||||
verify_peer: true
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Typography
|
||||
---
|
||||
|
||||
! Details on the full capabiltiies of Spectre.css can be found in the [Official Spectre Documentation](https://picturepan2.github.io/spectre/elements.html)
|
||||
! Details on the full capabilities of Spectre.css can be found in the [Official Spectre Documentation](https://picturepan2.github.io/spectre/elements.html)
|
||||
|
||||
The [Quark theme](https://github.com/getgrav/grav-theme-quark) is the new default theme for Grav built with [Spectre.css](https://picturepan2.github.io/spectre/) the lightweight, responsive and modern CSS framework. Spectre provides basic styles for typography, elements, and a responsive layout system that utilizes best practices and consistent language design.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user