mirror of
https://github.com/getgrav/grav.git
synced 2025-12-05 15:29:57 +01:00
Compare commits
68 Commits
1.2.0-rc.2
...
1.2.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8590b9523 | ||
|
|
e4ffc8d3de | ||
|
|
e5a522a2fe | ||
|
|
34281a14a4 | ||
|
|
f6d910f226 | ||
|
|
13b3b9875e | ||
|
|
85a25d0adc | ||
|
|
8f9e401fc9 | ||
|
|
fc7c6484a7 | ||
|
|
7bbcefbb4d | ||
|
|
749d0e3f2d | ||
|
|
7ba69dd5a1 | ||
|
|
00206d5957 | ||
|
|
d214bb5b94 | ||
|
|
1203b0d900 | ||
|
|
869b1c4c3b | ||
|
|
c06b2573a1 | ||
|
|
50dd834bc4 | ||
|
|
56e58f3b5e | ||
|
|
619dc30aca | ||
|
|
5bc3ce07dc | ||
|
|
0fe676c34b | ||
|
|
60f97f27be | ||
|
|
1d7f41e4a8 | ||
|
|
3a97502219 | ||
|
|
ca09f789a7 | ||
|
|
be94947d38 | ||
|
|
0a22ff0c68 | ||
|
|
840a349ace | ||
|
|
b85e595bbb | ||
|
|
082d4e3435 | ||
|
|
bfb6b6d68a | ||
|
|
8dc2ced94c | ||
|
|
f510e136c8 | ||
|
|
4365662304 | ||
|
|
4aa6dce853 | ||
|
|
d338d79acb | ||
|
|
459b7c4a33 | ||
|
|
06e880de57 | ||
|
|
cbf3df4bf1 | ||
|
|
aabc8aeb31 | ||
|
|
3d1ed7118e | ||
|
|
ca4f6f3c5c | ||
|
|
3a645ab4a2 | ||
|
|
25ba6198e5 | ||
|
|
6564ea98b1 | ||
|
|
8fe018a7dd | ||
|
|
5c40337ff0 | ||
|
|
41e7142dfc | ||
|
|
f45362b5b5 | ||
|
|
f8fbc82196 | ||
|
|
c153039457 | ||
|
|
88ccc25c47 | ||
|
|
b8164d3fe6 | ||
|
|
a1d4199e68 | ||
|
|
30f8eca905 | ||
|
|
ef7ff9ec4e | ||
|
|
0d471599d7 | ||
|
|
13bc19f1e3 | ||
|
|
da61196b7b | ||
|
|
04e1710de1 | ||
|
|
330a90b0ab | ||
|
|
5c34556246 | ||
|
|
10a15ef33f | ||
|
|
4eebc81808 | ||
|
|
cd37ea0689 | ||
|
|
7e50c340c7 | ||
|
|
701f18e782 |
@@ -55,6 +55,7 @@ before_install:
|
||||
fi
|
||||
- if [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == "5.6" ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then
|
||||
export TRAVIS_TAG=$(curl --fail --user "${GH_API_USER}" -s https://api.github.com/repos/getgrav/grav/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4);
|
||||
eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.8 bash)";
|
||||
go get github.com/aktau/github-release;
|
||||
git clone --quiet --depth=50 --branch=master https://${BB_TOKEN}bitbucket.org/rockettheme/grav-devtools.git $RT_DEVTOOLS &>/dev/null;
|
||||
if [ ! -z "$TRAVIS_TAG" ]; then
|
||||
|
||||
65
CHANGELOG.md
65
CHANGELOG.md
@@ -1,3 +1,68 @@
|
||||
# v1.2.4
|
||||
## 04/24/2017
|
||||
|
||||
1. [](#improved)
|
||||
* Added optional ignores for `Installer::sophisticatedInstall()` [#1447](https://github.com/getgrav/grav/issues/1447)
|
||||
1. [](#bugfix)
|
||||
* Allow multiple calls to `Themes::initTheme()` without throwing errors
|
||||
* Fixed querystrings in root pages with multi-lang enabled [#1436](https://github.com/getgrav/grav/issues/1436)
|
||||
* Allow support for `Pages::getList()` with `show_modular` option [#1080](https://github.com/getgrav/grav-plugin-admin/issues/1080)
|
||||
|
||||
# v1.2.3
|
||||
## 04/19/2017
|
||||
|
||||
1. [](#improved)
|
||||
* Added new `pwd_regex` and `username_regex` system configuration options to allow format modifications
|
||||
* Allow `user/accounts.yaml` overrides and implemented more robust theme initialization
|
||||
* improved `getList()` method to do more powerful things
|
||||
* Fix Typo in GPM [#1427](https://github.com/getgrav/grav/issues/1427)
|
||||
|
||||
# v1.2.2
|
||||
## 04/11/2017
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix for redirects breaking [#1420](https://github.com/getgrav/grav/issues/1420)
|
||||
* Fix issue in direct-install with github-style dependencies [#1405](https://github.com/getgrav/grav/issues/1405)
|
||||
|
||||
# v1.2.1
|
||||
## 04/10/2017
|
||||
|
||||
1. [](#improved)
|
||||
* Added various `ancestor` helper methods in Page and Pages classes [#1362](https://github.com/getgrav/grav/pull/1362)
|
||||
* Added new `parents` field and switched Page blueprints to use this
|
||||
* Added `isajaxrequest()` Twig function [#1400](https://github.com/getgrav/grav/issues/1400)
|
||||
* Added ability to inline CSS and JS code via Asset manager [#1377](https://github.com/getgrav/grav/pull/1377)
|
||||
* Add query string in lighttpd default config [#1393](https://github.com/getgrav/grav/issues/1393)
|
||||
* Add `--all-yes` and `--destination` options for `bin/gpm direct-install` [#1397](https://github.com/getgrav/grav/pull/1397)
|
||||
1. [](#bugfix)
|
||||
* Fix for direct-install of plugins with `languages.yaml` [#1396](https://github.com/getgrav/grav/issues/1396)
|
||||
* When determining language from HTTP_ACCEPT_LANGUAGE, also try base language only [#1402](https://github.com/getgrav/grav/issues/1402)
|
||||
* Fixed a bad method signature causing warning when running tests on `GPMTest` object
|
||||
|
||||
# v1.2.0
|
||||
## 03/31/2017
|
||||
|
||||
1. [](#new)
|
||||
* Added file upload for user avatar in user/admin blueprint
|
||||
1. [](#improved)
|
||||
* Analysis fixes
|
||||
* Switched to stable composer lib versions
|
||||
|
||||
# v1.2.0-rc.3
|
||||
## 03/22/2017
|
||||
|
||||
1. [](#new)
|
||||
* Refactored Page re-ordering to handle all siblings at once
|
||||
* Added `language_codes` to Twig init to allow for easy language name/code/native-name lookup
|
||||
1. [](#improved)
|
||||
* Added an _Admin Overrides_ section with option to choose the order of children in Pages Management
|
||||
1. [](#bugfix)
|
||||
* Fixed loading issues with improperly named themes (use old broken method first) [#1373](https://github.com/getgrav/grav/issues/1373)
|
||||
* Simplified modular/twig processing logic and fixed an issue with system process config [#1351](https://github.com/getgrav/grav/issues/1351)
|
||||
* Cleanup package files via GPM install to make them more windows-friendly [#1361](https://github.com/getgrav/grav/pull/1361)
|
||||
* Fix for page-level debugger override changing the option site-wide
|
||||
* Allow `url()` twig function to pass-through external links
|
||||
|
||||
# v1.2.0-rc.2
|
||||
## 03/17/2017
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ Good pull requests - patches, improvements, new features - are a fantastic
|
||||
help. They should remain focused in scope and avoid containing unrelated
|
||||
commits.
|
||||
|
||||
**Please ask first** in Gitter or in the Forum before embarking on any significant pull request (e.g.
|
||||
**Please ask first** in [Slack](https://getgrav.org/slack) or in the Forum before embarking on any significant pull request (e.g.
|
||||
implementing features, refactoring code..),
|
||||
otherwise you risk spending a lot of time working on something that the
|
||||
project's developers might not want to merge into the project.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"twig/twig": "~1.24",
|
||||
"erusev/parsedown": "dev-master as 1.6.0",
|
||||
"erusev/parsedown": "~1.6",
|
||||
"erusev/parsedown-extra": "~0.7",
|
||||
"symfony/yaml": "~2.8",
|
||||
"symfony/console": "~2.8",
|
||||
@@ -19,7 +19,7 @@
|
||||
"filp/whoops": "~2.0",
|
||||
"matthiasmullie/minify": "^1.3",
|
||||
"monolog/monolog": "~1.0",
|
||||
"gregwar/image": "dev-master#72568cfbeb77515278f2ccb386fc344e874b7ae8",
|
||||
"gregwar/image": "~2.0",
|
||||
"donatj/phpuseragentparser": "~0.3",
|
||||
"pimple/pimple": "~3.0",
|
||||
"rockettheme/toolbox": "~1.0",
|
||||
|
||||
159
composer.lock
generated
159
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"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": "4e5b9333d3ac2de823c68c9c8e0f2017",
|
||||
"content-hash": "e981b23b44354d081ec1e1ac214656a1",
|
||||
"packages": [
|
||||
{
|
||||
"name": "antoligy/dom-string-iterators",
|
||||
@@ -173,16 +173,16 @@
|
||||
},
|
||||
{
|
||||
"name": "erusev/parsedown",
|
||||
"version": "dev-master",
|
||||
"version": "1.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erusev/parsedown.git",
|
||||
"reference": "3fc442b07857aa11a63fcb2fb6aa03a569153240"
|
||||
"reference": "1bf24f7334fe16c88bf9d467863309ceaf285b01"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/3fc442b07857aa11a63fcb2fb6aa03a569153240",
|
||||
"reference": "3fc442b07857aa11a63fcb2fb6aa03a569153240",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/1bf24f7334fe16c88bf9d467863309ceaf285b01",
|
||||
"reference": "1bf24f7334fe16c88bf9d467863309ceaf285b01",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -211,7 +211,7 @@
|
||||
"markdown",
|
||||
"parser"
|
||||
],
|
||||
"time": "2017-03-10 07:41:24"
|
||||
"time": "2017-03-29T16:04:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "erusev/parsedown-extra",
|
||||
@@ -363,17 +363,17 @@
|
||||
},
|
||||
{
|
||||
"name": "gregwar/image",
|
||||
"version": "dev-master",
|
||||
"version": "v2.0.21",
|
||||
"target-dir": "Gregwar/Image",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Gregwar/Image.git",
|
||||
"reference": "72568cfbeb77515278f2ccb386fc344e874b7ae8"
|
||||
"reference": "c9899e4c71009338f89a8c63c12c681692533ede"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Gregwar/Image/zipball/72568cfbeb77515278f2ccb386fc344e874b7ae8",
|
||||
"reference": "72568cfbeb77515278f2ccb386fc344e874b7ae8",
|
||||
"url": "https://api.github.com/repos/Gregwar/Image/zipball/c9899e4c71009338f89a8c63c12c681692533ede",
|
||||
"reference": "c9899e4c71009338f89a8c63c12c681692533ede",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -411,7 +411,7 @@
|
||||
"gd",
|
||||
"image"
|
||||
],
|
||||
"time": "2016-07-12 17:02:18"
|
||||
"time": "2017-01-24T09:29:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/climate",
|
||||
@@ -466,16 +466,16 @@
|
||||
},
|
||||
{
|
||||
"name": "matthiasmullie/minify",
|
||||
"version": "1.3.43",
|
||||
"version": "1.3.44",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/matthiasmullie/minify.git",
|
||||
"reference": "aa50b2dab6fa7bfd402d334fe51005d6f2526ad7"
|
||||
"reference": "a7fc4a98ef8f2cf38bba701b51f1a84a1d67bc5c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/aa50b2dab6fa7bfd402d334fe51005d6f2526ad7",
|
||||
"reference": "aa50b2dab6fa7bfd402d334fe51005d6f2526ad7",
|
||||
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a7fc4a98ef8f2cf38bba701b51f1a84a1d67bc5c",
|
||||
"reference": "a7fc4a98ef8f2cf38bba701b51f1a84a1d67bc5c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -519,7 +519,7 @@
|
||||
"minifier",
|
||||
"minify"
|
||||
],
|
||||
"time": "2017-01-26T15:48:07+00:00"
|
||||
"time": "2017-03-16T16:42:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "matthiasmullie/path-converter",
|
||||
@@ -852,16 +852,16 @@
|
||||
},
|
||||
{
|
||||
"name": "seld/cli-prompt",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/cli-prompt.git",
|
||||
"reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4"
|
||||
"reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4",
|
||||
"reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4",
|
||||
"url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
|
||||
"reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -896,7 +896,7 @@
|
||||
"input",
|
||||
"prompt"
|
||||
],
|
||||
"time": "2016-04-18T09:31:41+00:00"
|
||||
"time": "2017-03-18T11:32:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
@@ -1311,16 +1311,16 @@
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.32.0",
|
||||
"version": "v1.33.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "9935b662e24d6e634da88901ab534cc12e8c728f"
|
||||
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f",
|
||||
"reference": "9935b662e24d6e634da88901ab534cc12e8c728f",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
|
||||
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1329,12 +1329,12 @@
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0",
|
||||
"symfony/debug": "~2.7",
|
||||
"symfony/phpunit-bridge": "~3.2"
|
||||
"symfony/phpunit-bridge": "~3.3@dev"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.32-dev"
|
||||
"dev-master": "1.33-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1369,7 +1369,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2017-02-27T00:07:03+00:00"
|
||||
"time": "2017-03-22T15:40:09+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@@ -1434,16 +1434,16 @@
|
||||
},
|
||||
{
|
||||
"name": "codeception/codeception",
|
||||
"version": "2.2.9",
|
||||
"version": "2.2.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Codeception/Codeception.git",
|
||||
"reference": "0204f1362040d3e408404af2545e5fa27e8964e2"
|
||||
"reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/0204f1362040d3e408404af2545e5fa27e8964e2",
|
||||
"reference": "0204f1362040d3e408404af2545e5fa27e8964e2",
|
||||
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/c32a3f92834db08ceedb4666ea2265c3aa43396e",
|
||||
"reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1458,6 +1458,7 @@
|
||||
"phpunit/phpunit": ">4.8.20 <6.0",
|
||||
"sebastian/comparator": "~1.1",
|
||||
"sebastian/diff": "^1.4",
|
||||
"stecman/symfony-console-completion": "^0.7.0",
|
||||
"symfony/browser-kit": ">=2.7 <4.0",
|
||||
"symfony/console": ">=2.7 <4.0",
|
||||
"symfony/css-selector": ">=2.7 <4.0",
|
||||
@@ -1522,7 +1523,7 @@
|
||||
"functional testing",
|
||||
"unit testing"
|
||||
],
|
||||
"time": "2017-02-04T02:04:21+00:00"
|
||||
"time": "2017-03-25T03:19:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
@@ -1580,34 +1581,37 @@
|
||||
},
|
||||
{
|
||||
"name": "facebook/webdriver",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/php-webdriver.git",
|
||||
"reference": "77300c4ab2025d4316635f592ec849ca7323bd8c"
|
||||
"reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/facebook/php-webdriver/zipball/77300c4ab2025d4316635f592ec849ca7323bd8c",
|
||||
"reference": "77300c4ab2025d4316635f592ec849ca7323bd8c",
|
||||
"url": "https://api.github.com/repos/facebook/php-webdriver/zipball/3ea034c056189e11c0ce7985332a9f4b5b2b5db2",
|
||||
"reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-zip": "*",
|
||||
"php": "^5.5 || ~7.0",
|
||||
"symfony/process": "^2.8 || ^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^1.11",
|
||||
"friendsofphp/php-cs-fixer": "^2.0",
|
||||
"php-mock/php-mock-phpunit": "^1.1",
|
||||
"phpunit/phpunit": "4.6.* || ~5.0",
|
||||
"satooshi/php-coveralls": "^1.0",
|
||||
"squizlabs/php_codesniffer": "^2.6"
|
||||
},
|
||||
"suggest": {
|
||||
"phpdocumentor/phpdocumentor": "2.*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-community": "1.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Facebook\\WebDriver\\": "lib/"
|
||||
@@ -1617,7 +1621,7 @@
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"description": "A PHP client for WebDriver",
|
||||
"description": "A PHP client for Selenium WebDriver",
|
||||
"homepage": "https://github.com/facebook/php-webdriver",
|
||||
"keywords": [
|
||||
"facebook",
|
||||
@@ -1625,7 +1629,7 @@
|
||||
"selenium",
|
||||
"webdriver"
|
||||
],
|
||||
"time": "2017-01-13T15:48:08+00:00"
|
||||
"time": "2017-03-22T10:56:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fzaninotto/faker",
|
||||
@@ -1790,16 +1794,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855"
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/0d6c7ca039329247e4f0f8f8f6506810e8248855",
|
||||
"reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1851,7 +1855,7 @@
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2017-02-27T10:51:17+00:00"
|
||||
"time": "2017-03-20T17:10:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
@@ -2860,6 +2864,51 @@
|
||||
"homepage": "https://github.com/sebastianbergmann/version",
|
||||
"time": "2015-06-21T13:59:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "stecman/symfony-console-completion",
|
||||
"version": "0.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/stecman/symfony-console-completion.git",
|
||||
"reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb",
|
||||
"reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2",
|
||||
"symfony/console": "~2.3 || ~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stephen Holdaway",
|
||||
"email": "stephen@stecman.co.nz"
|
||||
}
|
||||
],
|
||||
"description": "Automatic BASH completion for Symfony Console Component based applications.",
|
||||
"time": "2016-02-24T05:08:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.2.6",
|
||||
@@ -3175,19 +3224,9 @@
|
||||
"time": "2016-11-23T20:04:58+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [
|
||||
{
|
||||
"alias": "1.6.0",
|
||||
"alias_normalized": "1.6.0.0",
|
||||
"version": "9999999-dev",
|
||||
"package": "erusev/parsedown"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {
|
||||
"erusev/parsedown": 20,
|
||||
"gregwar/image": 20
|
||||
},
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* @package Grav.Core
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ form:
|
||||
default_lang:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.SITE_DEFAULT_LANG
|
||||
size: vsmall
|
||||
size: x-small
|
||||
placeholder: PLUGIN_ADMIN.SITE_DEFAULT_LANG_PLACEHOLDER
|
||||
help: PLUGIN_ADMIN.SITE_DEFAULT_LANG_HELP
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@ form:
|
||||
fields:
|
||||
home.alias:
|
||||
type: pages
|
||||
size: medium
|
||||
size: large
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.HOME_PAGE
|
||||
show_all: false
|
||||
show_modular: false
|
||||
show_root: false
|
||||
show_slug: true
|
||||
help: PLUGIN_ADMIN.HOME_PAGE_HELP
|
||||
|
||||
home.hide_in_urls:
|
||||
@@ -102,7 +103,7 @@ form:
|
||||
|
||||
pages.order.by:
|
||||
type: select
|
||||
size: long
|
||||
size: large
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.DEFAULT_ORDERING
|
||||
help: PLUGIN_ADMIN.DEFAULT_ORDERING_HELP
|
||||
@@ -155,6 +156,7 @@ form:
|
||||
|
||||
pages.append_url_extension:
|
||||
type: text
|
||||
size: x-small
|
||||
placeholder: "e.g. .html"
|
||||
label: PLUGIN_ADMIN.APPEND_URL_EXT
|
||||
help: PLUGIN_ADMIN.APPEND_URL_EXT_HELP
|
||||
@@ -856,13 +858,12 @@ form:
|
||||
|
||||
fields:
|
||||
images.default_image_quality:
|
||||
type: text
|
||||
type: range
|
||||
append: '%'
|
||||
label: PLUGIN_ADMIN.DEFAULT_IMAGE_QUALITY
|
||||
help: PLUGIN_ADMIN.DEFAULT_IMAGE_QUALITY_HELP
|
||||
classes: x-small
|
||||
validate:
|
||||
type: number
|
||||
min: 1
|
||||
max: 100
|
||||
|
||||
@@ -1092,6 +1093,19 @@ form:
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
username_regex:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.USERNAME_REGEX
|
||||
help: PLUGIN_ADMIN.USERNAME_REGEX_HELP
|
||||
|
||||
pwd_regex:
|
||||
type: text
|
||||
size: large
|
||||
label: PLUGIN_ADMIN.PWD_REGEX
|
||||
help: PLUGIN_ADMIN.PWD_REGEX_HELP
|
||||
|
||||
|
||||
wrapped_site:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.WRAPPED_SITE
|
||||
|
||||
@@ -117,17 +117,6 @@ form:
|
||||
title: PLUGIN_ADMIN.SETTINGS
|
||||
underline: true
|
||||
|
||||
ordering:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
@@ -135,13 +124,9 @@ form:
|
||||
rule: slug
|
||||
|
||||
route:
|
||||
type: select
|
||||
type: parents
|
||||
label: PLUGIN_ADMIN.PARENT
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::rawRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
|
||||
name:
|
||||
type: select
|
||||
@@ -165,9 +150,20 @@ form:
|
||||
title: PLUGIN_ADMIN.ORDERING
|
||||
underline: true
|
||||
|
||||
ordering:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
order:
|
||||
type: order
|
||||
label: PLUGIN_ADMIN.PAGE_ORDER
|
||||
label: PLUGIN_ADMIN.SORTABLE_PAGES
|
||||
sitemap:
|
||||
|
||||
overrides:
|
||||
@@ -314,6 +310,25 @@ form:
|
||||
toggleable: true
|
||||
help: PLUGIN_ADMIN.APPEND_URL_EXT_HELP
|
||||
|
||||
admin_only:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ADMIN_SPECIFIC_OVERRIDES
|
||||
underline: true
|
||||
|
||||
fields:
|
||||
|
||||
header.admin.children_display_order:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.ADMIN_CHILDREN_DISPLAY_ORDER
|
||||
help: PLUGIN_ADMIN.ADMIN_CHILDREN_DISPLAY_ORDER_HELP
|
||||
toggleable: true
|
||||
classes: fancy
|
||||
default: 'collection'
|
||||
options:
|
||||
'default': 'Ordered by Folder name (default)'
|
||||
'collection': 'Ordered by Collection definition'
|
||||
|
||||
|
||||
header.order_by:
|
||||
type: hidden
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
section:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ADD_MODULAR_CONTENT
|
||||
|
||||
title:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.PAGE_TITLE
|
||||
validate:
|
||||
required: true
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
validate:
|
||||
rule: slug
|
||||
required: true
|
||||
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PAGE
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::rawRoute'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
name:
|
||||
type: select
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.MODULAR_TEMPLATE
|
||||
help: PLUGIN_ADMIN.PAGE_FILE_HELP
|
||||
default: default
|
||||
data-options@: '\Grav\Common\Page\Pages::modularTypes'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
modular:
|
||||
type: hidden
|
||||
default: 1
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
blueprint:
|
||||
type: blueprint
|
||||
@@ -1,106 +0,0 @@
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
tabs:
|
||||
type: tabs
|
||||
active: 1
|
||||
|
||||
fields:
|
||||
content:
|
||||
type: tab
|
||||
title: PLUGIN_ADMIN.CONTENT
|
||||
|
||||
fields:
|
||||
frontmatter:
|
||||
classes: frontmatter
|
||||
type: editor
|
||||
label: PLUGIN_ADMIN.FRONTMATTER
|
||||
autofocus: true
|
||||
codemirror:
|
||||
mode: 'yaml'
|
||||
indentUnit: 4
|
||||
autofocus: true
|
||||
indentWithTabs: false
|
||||
lineNumbers: true
|
||||
styleActiveLine: true
|
||||
gutters: ['CodeMirror-lint-markers']
|
||||
lint: true
|
||||
|
||||
content:
|
||||
type: markdown
|
||||
|
||||
uploads:
|
||||
type: pagemedia
|
||||
label: PLUGIN_ADMIN.PAGE_MEDIA
|
||||
|
||||
|
||||
options:
|
||||
type: tab
|
||||
title: PLUGIN_ADMIN.OPTIONS
|
||||
|
||||
fields:
|
||||
|
||||
columns:
|
||||
type: columns
|
||||
|
||||
fields:
|
||||
column1:
|
||||
type: column
|
||||
|
||||
fields:
|
||||
|
||||
ordering:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FILENAME
|
||||
validate:
|
||||
rule: slug
|
||||
required: true
|
||||
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::rawRoute'
|
||||
options:
|
||||
'': PLUGIN_ADMIN.DEFAULT_OPTION_SELECT
|
||||
validate:
|
||||
required: true
|
||||
|
||||
name:
|
||||
type: select
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.MODULAR_TEMPLATE
|
||||
default: default
|
||||
data-options@: '\Grav\Common\Page\Pages::modularTypes'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
column2:
|
||||
type: column
|
||||
|
||||
fields:
|
||||
order:
|
||||
type: order
|
||||
label: PLUGIN_ADMIN.ORDERING
|
||||
|
||||
blueprint:
|
||||
type: blueprint
|
||||
@@ -1,11 +0,0 @@
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::rawRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
@@ -1,66 +0,0 @@
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
section:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ADD_PAGE
|
||||
|
||||
title:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.PAGE_TITLE
|
||||
help: PLUGIN_ADMIN.PAGE_TITLE_HELP
|
||||
validate:
|
||||
required: true
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||
validate:
|
||||
rule: slug
|
||||
required: true
|
||||
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::getLastPageRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
validate:
|
||||
required: true
|
||||
|
||||
name:
|
||||
type: select
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.PAGE_FILE
|
||||
help: PLUGIN_ADMIN.PAGE_FILE_HELP
|
||||
data-options@: '\Grav\Common\Page\Pages::types'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::getLastPageName'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
visible:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.VISIBLE
|
||||
help: PLUGIN_ADMIN.VISIBLE_HELP
|
||||
highlight: ''
|
||||
default: ''
|
||||
options:
|
||||
'': Auto
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
required: true
|
||||
|
||||
blueprint:
|
||||
type: blueprint
|
||||
@@ -1,35 +0,0 @@
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
section:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ADD_FOLDER
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||
validate:
|
||||
rule: slug
|
||||
required: true
|
||||
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::getLastPageRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
validate:
|
||||
required: true
|
||||
|
||||
blueprint:
|
||||
type: blueprint
|
||||
@@ -1,105 +0,0 @@
|
||||
rules:
|
||||
slug:
|
||||
pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
|
||||
min: 1
|
||||
max: 200
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
tabs:
|
||||
type: tabs
|
||||
active: 1
|
||||
|
||||
fields:
|
||||
content:
|
||||
type: tab
|
||||
title: PLUGIN_ADMIN.CONTENT
|
||||
|
||||
fields:
|
||||
frontmatter:
|
||||
classes: frontmatter
|
||||
type: editor
|
||||
label: PLUGIN_ADMIN.FRONTMATTER
|
||||
autofocus: true
|
||||
codemirror:
|
||||
mode: 'yaml'
|
||||
indentUnit: 4
|
||||
autofocus: true
|
||||
indentWithTabs: false
|
||||
lineNumbers: true
|
||||
styleActiveLine: true
|
||||
gutters: ['CodeMirror-lint-markers']
|
||||
lint: true
|
||||
|
||||
content:
|
||||
type: markdown
|
||||
|
||||
uploads:
|
||||
type: pagemedia
|
||||
label: PLUGIN_ADMIN.PAGE_MEDIA
|
||||
|
||||
options:
|
||||
type: tab
|
||||
title: PLUGIN_ADMIN.OPTIONS
|
||||
|
||||
fields:
|
||||
|
||||
columns:
|
||||
type: columns
|
||||
|
||||
fields:
|
||||
column1:
|
||||
type: column
|
||||
|
||||
fields:
|
||||
|
||||
ordering:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
|
||||
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
|
||||
highlight: 1
|
||||
options:
|
||||
1: PLUGIN_ADMIN.ENABLED
|
||||
0: PLUGIN_ADMIN.DISABLED
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
folder:
|
||||
type: text
|
||||
label: PLUGIN_ADMIN.FOLDER_NAME
|
||||
help: PLUGIN_ADMIN.FOLDER_NAME_HELP
|
||||
validate:
|
||||
rule: slug
|
||||
required: true
|
||||
|
||||
route:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\Admin\Admin::rawRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
|
||||
name:
|
||||
type: select
|
||||
classes: fancy
|
||||
label: PLUGIN_ADMIN.DISPLAY_TEMPLATE
|
||||
help: PLUGIN_ADMIN.DISPLAY_TEMPLATE_HELP
|
||||
default: default
|
||||
data-options@: '\Grav\Common\Page\Pages::types'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
column2:
|
||||
type: column
|
||||
|
||||
fields:
|
||||
order:
|
||||
type: order
|
||||
label: PLUGIN_ADMIN.ORDERING
|
||||
|
||||
blueprint:
|
||||
type: blueprint
|
||||
@@ -8,6 +8,13 @@ form:
|
||||
type: userinfo
|
||||
size: large
|
||||
|
||||
avatar:
|
||||
type: file
|
||||
size: large
|
||||
destination: 'user://accounts/avatars'
|
||||
multiple: false
|
||||
random_name: true
|
||||
|
||||
content:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.ACCOUNT
|
||||
@@ -37,7 +44,7 @@ form:
|
||||
validate:
|
||||
required: false
|
||||
message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE
|
||||
pattern: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'
|
||||
config-pattern@: system.pwd_regex
|
||||
|
||||
fullname:
|
||||
type: text
|
||||
|
||||
@@ -1,141 +1,143 @@
|
||||
absolute_urls: false # Absolute or relative URLs for `base_url`
|
||||
timezone: '' # Valid values: http://php.net/manual/en/timezones.php
|
||||
default_locale: # Default locale (defaults to system)
|
||||
param_sep: ':' # Parameter separator, use ';' for Apache on windows
|
||||
wrapped_site: false # For themes/plugins to know if Grav is wrapped by another platform
|
||||
reverse_proxy_setup: false # Running in a reverse proxy scenario with different webserver ports than proxy
|
||||
force_ssl: false # If enabled, Grav forces to be accessed via HTTPS (NOTE: Not an ideal solution)
|
||||
custom_base_url: '' # Set the base_url manually, e.g. http://yoursite.com/yourpath
|
||||
absolute_urls: false # Absolute or relative URLs for `base_url`
|
||||
timezone: '' # Valid values: http://php.net/manual/en/timezones.php
|
||||
default_locale: # Default locale (defaults to system)
|
||||
param_sep: ':' # Parameter separator, use ';' for Apache on windows
|
||||
wrapped_site: false # For themes/plugins to know if Grav is wrapped by another platform
|
||||
reverse_proxy_setup: false # Running in a reverse proxy scenario with different webserver ports than proxy
|
||||
force_ssl: false # If enabled, Grav forces to be accessed via HTTPS (NOTE: Not an ideal solution)
|
||||
custom_base_url: '' # Set the base_url manually, e.g. http://yoursite.com/yourpath
|
||||
username_regex: '^[a-z0-9_-]{3,16}$' # Only lowercase chars, digits, dashes, underscores. 3 - 16 chars
|
||||
pwd_regex: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}' # At least one number, one uppercase and lowercase letter, and be at least 8+ chars
|
||||
|
||||
languages:
|
||||
supported: [] # List of languages supported. eg: [en, fr, de]
|
||||
include_default_lang: true # Include the default lang prefix in all URLs
|
||||
translations: true # Enable translations by default
|
||||
translations_fallback: true # Fallback through supported translations if active lang doesn't exist
|
||||
session_store_active: false # Store active language in session
|
||||
http_accept_language: false # Attempt to set the language based on http_accept_language header in the browser
|
||||
override_locale: false # Override the default or system locale with language specific one
|
||||
supported: [] # List of languages supported. eg: [en, fr, de]
|
||||
include_default_lang: true # Include the default lang prefix in all URLs
|
||||
translations: true # Enable translations by default
|
||||
translations_fallback: true # Fallback through supported translations if active lang doesn't exist
|
||||
session_store_active: false # Store active language in session
|
||||
http_accept_language: false # Attempt to set the language based on http_accept_language header in the browser
|
||||
override_locale: false # Override the default or system locale with language specific one
|
||||
|
||||
home:
|
||||
alias: '/home' # Default path for home, ie /
|
||||
hide_in_urls: false # Hide the home route in URLs
|
||||
alias: '/home' # Default path for home, ie /
|
||||
hide_in_urls: false # Hide the home route in URLs
|
||||
|
||||
pages:
|
||||
theme: antimatter # Default theme (defaults to "antimatter" theme)
|
||||
theme: antimatter # Default theme (defaults to "antimatter" theme)
|
||||
order:
|
||||
by: default # Order pages by "default", "alpha" or "date"
|
||||
dir: asc # Default ordering direction, "asc" or "desc"
|
||||
by: default # Order pages by "default", "alpha" or "date"
|
||||
dir: asc # Default ordering direction, "asc" or "desc"
|
||||
list:
|
||||
count: 20 # Default item count per page
|
||||
count: 20 # Default item count per page
|
||||
dateformat:
|
||||
default: # The default date format Grav expects in the `date: ` field
|
||||
short: 'jS M Y' # Short date format
|
||||
long: 'F jS \a\t g:ia' # Long date format
|
||||
publish_dates: true # automatically publish/unpublish based on dates
|
||||
default: # The default date format Grav expects in the `date: ` field
|
||||
short: 'jS M Y' # Short date format
|
||||
long: 'F jS \a\t g:ia' # Long date format
|
||||
publish_dates: true # automatically publish/unpublish based on dates
|
||||
process:
|
||||
markdown: true # Process Markdown
|
||||
twig: false # Process Twig
|
||||
twig_first: false # Process Twig before markdown when processing both on a page
|
||||
never_cache_twig: false # Only cache content, never cache twig processed in content (incompatible with `twig_first: true`)
|
||||
markdown: true # Process Markdown
|
||||
twig: false # Process Twig
|
||||
twig_first: false # Process Twig before markdown when processing both on a page
|
||||
never_cache_twig: false # Only cache content, never cache twig processed in content (incompatible with `twig_first: true`)
|
||||
events:
|
||||
page: true # Enable page level events
|
||||
twig: true # Enable Twig level events
|
||||
page: true # Enable page level events
|
||||
twig: true # Enable Twig level events
|
||||
markdown:
|
||||
extra: false # Enable support for Markdown Extra support (GFM by default)
|
||||
auto_line_breaks: false # Enable automatic line breaks
|
||||
auto_url_links: false # Enable automatic HTML links
|
||||
escape_markup: false # Escape markup tags into entities
|
||||
special_chars: # List of special characters to automatically convert to entities
|
||||
extra: false # Enable support for Markdown Extra support (GFM by default)
|
||||
auto_line_breaks: false # Enable automatic line breaks
|
||||
auto_url_links: false # Enable automatic HTML links
|
||||
escape_markup: false # Escape markup tags into entities
|
||||
special_chars: # List of special characters to automatically convert to entities
|
||||
'>': 'gt'
|
||||
'<': 'lt'
|
||||
types: [txt,xml,html,htm,json,rss,atom] # list of valid page types
|
||||
append_url_extension: '' # Append page's extension in Page urls (e.g. '.html' results in /path/page.html)
|
||||
expires: 604800 # Page expires time in seconds (604800 seconds = 7 days)
|
||||
last_modified: false # Set the last modified date header based on file modification timestamp
|
||||
etag: false # Set the etag header tag
|
||||
vary_accept_encoding: false # Add `Vary: Accept-Encoding` header
|
||||
redirect_default_route: false # Automatically redirect to a page's default route
|
||||
redirect_default_code: 301 # Default code to use for redirects
|
||||
redirect_trailing_slash: true # Handle automatically or 301 redirect a trailing / URL
|
||||
ignore_files: [.DS_Store] # Files to ignore in Pages
|
||||
ignore_folders: [.git, .idea] # Folders to ignore in Pages
|
||||
ignore_hidden: true # Ignore all Hidden files and folders
|
||||
url_taxonomy_filters: true # Enable auto-magic URL-based taxonomy filters for page collections
|
||||
types: [txt,xml,html,htm,json,rss,atom] # list of valid page types
|
||||
append_url_extension: '' # Append page's extension in Page urls (e.g. '.html' results in /path/page.html)
|
||||
expires: 604800 # Page expires time in seconds (604800 seconds = 7 days)
|
||||
last_modified: false # Set the last modified date header based on file modification timestamp
|
||||
etag: false # Set the etag header tag
|
||||
vary_accept_encoding: false # Add `Vary: Accept-Encoding` header
|
||||
redirect_default_route: false # Automatically redirect to a page's default route
|
||||
redirect_default_code: 301 # Default code to use for redirects
|
||||
redirect_trailing_slash: true # Handle automatically or 301 redirect a trailing / URL
|
||||
ignore_files: [.DS_Store] # Files to ignore in Pages
|
||||
ignore_folders: [.git, .idea] # Folders to ignore in Pages
|
||||
ignore_hidden: true # Ignore all Hidden files and folders
|
||||
url_taxonomy_filters: true # Enable auto-magic URL-based taxonomy filters for page collections
|
||||
frontmatter:
|
||||
process_twig: false # Should the frontmatter be processed to replace Twig variables?
|
||||
ignore_fields: ['form','forms'] # Fields that might contain Twig variables and should not be processed
|
||||
process_twig: false # Should the frontmatter be processed to replace Twig variables?
|
||||
ignore_fields: ['form','forms'] # Fields that might contain Twig variables and should not be processed
|
||||
|
||||
cache:
|
||||
enabled: true # Set to true to enable caching
|
||||
enabled: true # Set to true to enable caching
|
||||
check:
|
||||
method: file # Method to check for updates in pages: file|folder|hash|none
|
||||
driver: auto # One of: auto|file|apc|xcache|memcache|wincache
|
||||
prefix: 'g' # Cache prefix string (prevents cache conflicts)
|
||||
cli_compatibility: false # Ensures only non-volatile drivers are used (file, redis, memcache, etc.)
|
||||
lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite)
|
||||
gzip: false # GZip compress the page output
|
||||
allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event
|
||||
method: file # Method to check for updates in pages: file|folder|hash|none
|
||||
driver: auto # One of: auto|file|apc|xcache|memcache|wincache
|
||||
prefix: 'g' # Cache prefix string (prevents cache conflicts)
|
||||
cli_compatibility: false # Ensures only non-volatile drivers are used (file, redis, memcache, etc.)
|
||||
lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite)
|
||||
gzip: false # GZip compress the page output
|
||||
allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event
|
||||
redis:
|
||||
socket: false # Path to redis unix socket (e.g. /var/run/redis/redis.sock), false = use server and port to connect
|
||||
socket: false # Path to redis unix socket (e.g. /var/run/redis/redis.sock), false = use server and port to connect
|
||||
|
||||
twig:
|
||||
cache: true # Set to true to enable Twig caching
|
||||
debug: true # Enable Twig debug
|
||||
auto_reload: true # Refresh cache on changes
|
||||
autoescape: false # Autoescape Twig vars
|
||||
undefined_functions: true # Allow undefined functions
|
||||
undefined_filters: true # Allow undefined filters
|
||||
umask_fix: false # By default Twig creates cached files as 755, fix switches this to 775
|
||||
cache: true # Set to true to enable Twig caching
|
||||
debug: true # Enable Twig debug
|
||||
auto_reload: true # Refresh cache on changes
|
||||
autoescape: false # Autoescape Twig vars
|
||||
undefined_functions: true # Allow undefined functions
|
||||
undefined_filters: true # Allow undefined filters
|
||||
umask_fix: false # By default Twig creates cached files as 755, fix switches this to 775
|
||||
|
||||
assets: # Configuration for Assets Manager (JS, CSS)
|
||||
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
|
||||
css_pipeline_include_externals: true # Include external URLs in the pipeline by default
|
||||
css_pipeline_before_excludes: true # Render the pipeline before any excluded files
|
||||
css_minify: true # Minify the CSS during pipelining
|
||||
css_minify_windows: false # Minify Override for Windows platforms. False by default due to ThreadStackSize
|
||||
css_rewrite: true # Rewrite any CSS relative URLs during pipelining
|
||||
js_pipeline: false # The JS pipeline is the unification of multiple JS resources into one file
|
||||
js_pipeline_include_externals: true # Include external URLs in the pipeline by default
|
||||
js_pipeline_before_excludes: true # Render the pipeline before any excluded files
|
||||
js_minify: true # Minify the JS during pipelining
|
||||
enable_asset_timestamp: false # Enable asset timestamps
|
||||
assets: # Configuration for Assets Manager (JS, CSS)
|
||||
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
|
||||
css_pipeline_include_externals: true # Include external URLs in the pipeline by default
|
||||
css_pipeline_before_excludes: true # Render the pipeline before any excluded files
|
||||
css_minify: true # Minify the CSS during pipelining
|
||||
css_minify_windows: false # Minify Override for Windows platforms. False by default due to ThreadStackSize
|
||||
css_rewrite: true # Rewrite any CSS relative URLs during pipelining
|
||||
js_pipeline: false # The JS pipeline is the unification of multiple JS resources into one file
|
||||
js_pipeline_include_externals: true # Include external URLs in the pipeline by default
|
||||
js_pipeline_before_excludes: true # Render the pipeline before any excluded files
|
||||
js_minify: true # Minify the JS during pipelining
|
||||
enable_asset_timestamp: false # Enable asset timestamps
|
||||
collections:
|
||||
jquery: system://assets/jquery/jquery-2.x.min.js
|
||||
|
||||
errors:
|
||||
display: 0 # Display either (1) Full backtrace | (0) Simple Error | (-1) System Error
|
||||
log: true # Log errors to /logs folder
|
||||
display: 0 # Display either (1) Full backtrace | (0) Simple Error | (-1) System Error
|
||||
log: true # Log errors to /logs folder
|
||||
|
||||
debugger:
|
||||
enabled: false # Enable Grav debugger and following settings
|
||||
enabled: false # Enable Grav debugger and following settings
|
||||
shutdown:
|
||||
close_connection: true # Close the connection before calling onShutdown(). false for debugging
|
||||
close_connection: true # Close the connection before calling onShutdown(). false for debugging
|
||||
|
||||
images:
|
||||
default_image_quality: 85 # Default image quality to use when resampling images (85%)
|
||||
cache_all: false # Cache all image by default
|
||||
cache_perms: '0755' # MUST BE IN QUOTES!! Default cache folder perms. Usually '0755' or '0775'
|
||||
debug: false # Show an overlay over images indicating the pixel depth of the image when working with retina for example
|
||||
auto_fix_orientation: false # Automatically fix the image orientation based on the Exif data
|
||||
default_image_quality: 85 # Default image quality to use when resampling images (85%)
|
||||
cache_all: false # Cache all image by default
|
||||
cache_perms: '0755' # MUST BE IN QUOTES!! Default cache folder perms. Usually '0755' or '0775'
|
||||
debug: false # Show an overlay over images indicating the pixel depth of the image when working with retina for example
|
||||
auto_fix_orientation: false # Automatically fix the image orientation based on the Exif data
|
||||
|
||||
media:
|
||||
enable_media_timestamp: false # Enable media timetsamps
|
||||
upload_limit: 0 # Set maximum upload size in bytes (0 is unlimited)
|
||||
unsupported_inline_types: [] # Array of supported media types to try to display inline
|
||||
allowed_fallback_types: [] # Array of allowed media types of files found if accessed via Page route
|
||||
enable_media_timestamp: false # Enable media timetsamps
|
||||
upload_limit: 0 # Set maximum upload size in bytes (0 is unlimited)
|
||||
unsupported_inline_types: [] # Array of supported media types to try to display inline
|
||||
allowed_fallback_types: [] # Array of allowed media types of files found if accessed via Page route
|
||||
|
||||
session:
|
||||
enabled: true # Enable Session support
|
||||
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
|
||||
httponly: true # Set session HTTP only. If true, indicates that cookies should be used only over HTTP, and JavaScript modification is not allowed.
|
||||
split: true # Sessions should be independent between site and plugins (such as admin)
|
||||
enabled: true # Enable Session support
|
||||
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
|
||||
httponly: true # Set session HTTP only. If true, indicates that cookies should be used only over HTTP, and JavaScript modification is not allowed.
|
||||
split: true # Sessions should be independent between site and plugins (such as admin)
|
||||
path:
|
||||
|
||||
gpm:
|
||||
releases: testing # Set to either 'stable' or 'testing'
|
||||
proxy_url: # Configure a manual proxy URL for GPM (eg 127.0.0.1:3128)
|
||||
method: 'auto' # Either 'curl', 'fopen' or 'auto'. 'auto' will try fopen first and if not available cURL
|
||||
verify_peer: true # Sometimes on some systems (Windows most commonly) GPM is unable to connect because the SSL certificate cannot be verified. Disabling this setting might help.
|
||||
official_gpm_only: true # By default GPM direct-install will only allow URLs via the official GPM proxy to ensure security
|
||||
releases: stable # Set to either 'stable' or 'testing'
|
||||
proxy_url: # Configure a manual proxy URL for GPM (eg 127.0.0.1:3128)
|
||||
method: 'auto' # Either 'curl', 'fopen' or 'auto'. 'auto' will try fopen first and if not available cURL
|
||||
verify_peer: true # Sometimes on some systems (Windows most commonly) GPM is unable to connect because the SSL certificate cannot be verified. Disabling this setting might help.
|
||||
official_gpm_only: true # By default GPM direct-install will only allow URLs via the official GPM proxy to ensure security
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.2.0-rc.2');
|
||||
define('GRAV_TESTING', true);
|
||||
define('GRAV_VERSION', '1.2.4');
|
||||
define('GRAV_TESTING', false);
|
||||
define('DS', '/');
|
||||
|
||||
if (!defined('GRAV_PHP_MIN')) {
|
||||
|
||||
@@ -255,28 +255,32 @@ class Assets
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a CSS asset.
|
||||
* Add an asset to its assembly.
|
||||
*
|
||||
* It checks for duplicates.
|
||||
* You may add more than one asset passing an array as argument.
|
||||
* The third argument may alternatively contain an array of options which take precedence over positional
|
||||
* arguments.
|
||||
*
|
||||
* @param mixed $asset
|
||||
* @param int $priority the priority, bigger comes first
|
||||
* @param bool $pipeline false if this should not be pipelined
|
||||
* @param null $group
|
||||
* @param array $assembly the array assembling the assets
|
||||
* @param mixed $asset
|
||||
* @param int $priority the priority, bigger comes first
|
||||
* @param bool $pipeline false if this should not be pipelined
|
||||
* @param string $loading how the asset is loaded (async/defer/inline, for CSS: only inline)
|
||||
* @param string $group name of the group
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addCss($asset, $priority = null, $pipeline = true, $group = null)
|
||||
public function addTo(&$assembly, $asset, $priority = null, $pipeline = true, $loading = null, $group = null)
|
||||
{
|
||||
if (is_array($asset)) {
|
||||
foreach ($asset as $a) {
|
||||
$this->addCss($a, $priority, $pipeline, $group);
|
||||
$this->addTo($assembly, $a, $priority, $pipeline, $loading, $group);
|
||||
}
|
||||
|
||||
return $this;
|
||||
} elseif (isset($this->collections[$asset])) {
|
||||
$this->addCss($this->collections[$asset], $priority, $pipeline, $group);
|
||||
$this->addTo($assembly, $this->collections[$asset], $priority, $pipeline, $loading, $group);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -297,15 +301,16 @@ class Assets
|
||||
'asset' => $asset,
|
||||
'remote' => $remote,
|
||||
'priority' => intval($priority ?: 10),
|
||||
'order' => count($this->css),
|
||||
'order' => count($assembly),
|
||||
'pipeline' => (bool) $pipeline,
|
||||
'loading' => $loading ?: '',
|
||||
'group' => $group ?: 'head',
|
||||
'modified' => $modified
|
||||
];
|
||||
|
||||
// check for dynamic array and merge with defaults
|
||||
if (func_num_args() > 1) {
|
||||
$dynamic_arg = func_get_arg(1);
|
||||
if (func_num_args() > 2) {
|
||||
$dynamic_arg = func_get_arg(2);
|
||||
if (is_array($dynamic_arg)) {
|
||||
$data = array_merge($data, $dynamic_arg);
|
||||
}
|
||||
@@ -313,17 +318,40 @@ class Assets
|
||||
|
||||
$key = md5($asset);
|
||||
if ($asset) {
|
||||
$this->css[$key] = $data;
|
||||
$assembly[$key] = $data;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a CSS asset.
|
||||
*
|
||||
* It checks for duplicates.
|
||||
* You may add more than one asset passing an array as argument.
|
||||
* The second argument may alternatively contain an array of options which take precedence over positional
|
||||
* arguments.
|
||||
*
|
||||
* @param mixed $asset
|
||||
* @param int $priority the priority, bigger comes first
|
||||
* @param bool $pipeline false if this should not be pipelined
|
||||
* @param string $group
|
||||
* @param string $loading how the asset is loaded (async/defer/inline, for CSS: only inline)
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addCss($asset, $priority = null, $pipeline = true, $group = null, $loading = null)
|
||||
{
|
||||
return $this->addTo($this->css, $asset, $priority, $pipeline, $loading, $group);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a JavaScript asset.
|
||||
*
|
||||
* It checks for duplicates.
|
||||
* You may add more than one asset passing an array as argument.
|
||||
* The second argument may alternatively contain an array of options which take precedence over positional
|
||||
* arguments.
|
||||
*
|
||||
* @param mixed $asset
|
||||
* @param int $priority the priority, bigger comes first
|
||||
@@ -335,55 +363,7 @@ class Assets
|
||||
*/
|
||||
public function addJs($asset, $priority = null, $pipeline = true, $loading = null, $group = null)
|
||||
{
|
||||
if (is_array($asset)) {
|
||||
foreach ($asset as $a) {
|
||||
$this->addJs($a, $priority, $pipeline, $loading, $group);
|
||||
}
|
||||
|
||||
return $this;
|
||||
} elseif (isset($this->collections[$asset])) {
|
||||
$this->addJs($this->collections[$asset], $priority, $pipeline, $loading, $group);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
$modified = false;
|
||||
$remote = $this->isRemoteLink($asset);
|
||||
if (!$remote) {
|
||||
$modified = $this->getLastModificationTime($asset);
|
||||
$asset = $this->buildLocalLink($asset);
|
||||
}
|
||||
|
||||
// Check for existence
|
||||
if ($asset === false) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'asset' => $asset,
|
||||
'remote' => $remote ,
|
||||
'priority' => intval($priority ?: 10),
|
||||
'order' => count($this->js),
|
||||
'pipeline' => (bool) $pipeline,
|
||||
'loading' => $loading ?: '',
|
||||
'group' => $group ?: 'head',
|
||||
'modified' => $modified
|
||||
];
|
||||
|
||||
// check for dynamic array and merge with defaults
|
||||
if (func_num_args() > 1) {
|
||||
$dynamic_arg = func_get_arg(1);
|
||||
if (is_array($dynamic_arg)) {
|
||||
$data = array_merge($data, $dynamic_arg);
|
||||
}
|
||||
}
|
||||
|
||||
$key = md5($asset);
|
||||
if ($asset) {
|
||||
$this->js[$key] = $data;
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $this->addTo($this->js, $asset, $priority, $pipeline, $loading, $group);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -547,32 +527,54 @@ class Assets
|
||||
$this->css = array_reverse($this->css);
|
||||
$this->inline_css = array_reverse($this->inline_css);
|
||||
|
||||
$inlineGroup = array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline';
|
||||
|
||||
$attributes = $this->attributes(array_merge(['type' => 'text/css', 'rel' => 'stylesheet'], $attributes));
|
||||
|
||||
$output = '';
|
||||
$inline_css = '';
|
||||
|
||||
if ($this->css_pipeline) {
|
||||
$pipeline_result = $this->pipelineCss($group);
|
||||
$pipeline_html = '<link href="' . $pipeline_result . '"' . $attributes . ' />' . "\n";
|
||||
$pipeline_result = $this->pipelineCss($group, !$inlineGroup);
|
||||
$pipeline_html = ($inlineGroup ? '' : '<link href="' . $pipeline_result . '"' . $attributes . ' />' . "\n");
|
||||
|
||||
if ($this->css_pipeline_before_excludes && $pipeline_result) {
|
||||
$output .= $pipeline_html;
|
||||
if ($inlineGroup) {
|
||||
$inline_css .= $pipeline_result;
|
||||
}
|
||||
else {
|
||||
$output .= $pipeline_html;
|
||||
}
|
||||
}
|
||||
foreach ($this->css_no_pipeline as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
if ($file['loading'] === 'inline') {
|
||||
$inline_css .= $this->gatherLinks([$file], CSS_ASSET) . "\n";
|
||||
}
|
||||
else {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$this->css_pipeline_before_excludes && $pipeline_result) {
|
||||
$output .= $pipeline_html;
|
||||
if ($inlineGroup) {
|
||||
$inline_css .= $pipeline_result;
|
||||
}
|
||||
else {
|
||||
$output .= $pipeline_html;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($this->css as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
if ($inlineGroup || $file['loading'] === 'inline') {
|
||||
$inline_css .= $this->gatherLinks([$file], CSS_ASSET) . "\n";
|
||||
}
|
||||
else {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -626,30 +628,52 @@ class Assets
|
||||
$this->js = array_reverse($this->js);
|
||||
$this->inline_js = array_reverse($this->inline_js);
|
||||
|
||||
$inlineGroup = array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline';
|
||||
|
||||
$attributes = $this->attributes(array_merge(['type' => 'text/javascript'], $attributes));
|
||||
|
||||
$output = '';
|
||||
$inline_js = '';
|
||||
|
||||
if ($this->js_pipeline) {
|
||||
$pipeline_result = $this->pipelineJs($group);
|
||||
$pipeline_html = '<script src="' . $pipeline_result . '"' . $attributes . ' ></script>' . "\n";
|
||||
$pipeline_result = $this->pipelineJs($group, !$inlineGroup);
|
||||
$pipeline_html = ($inlineGroup ? '' : '<script src="' . $pipeline_result . '"' . $attributes . ' ></script>' . "\n");
|
||||
|
||||
if ($this->js_pipeline_before_excludes && $pipeline_result) {
|
||||
$output .= $pipeline_html;
|
||||
if ($inlineGroup) {
|
||||
$inline_js .= $pipeline_result;
|
||||
}
|
||||
else {
|
||||
$output .= $pipeline_html;
|
||||
}
|
||||
}
|
||||
foreach ($this->js_no_pipeline as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
if ($file['loading'] === 'inline') {
|
||||
$inline_js .= $this->gatherLinks([$file], JS_ASSET) . "\n";
|
||||
}
|
||||
else {
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$this->js_pipeline_before_excludes && $pipeline_result) {
|
||||
$output .= $pipeline_html;
|
||||
if ($inlineGroup) {
|
||||
$inline_js .= $pipeline_result;
|
||||
}
|
||||
else {
|
||||
$output .= $pipeline_html;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($this->js as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
if ($inlineGroup || $file['loading'] === 'inline') {
|
||||
$inline_js .= $this->gatherLinks([$file], JS_ASSET) . "\n";
|
||||
}
|
||||
else {
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -672,10 +696,11 @@ class Assets
|
||||
* Minify and concatenate CSS
|
||||
*
|
||||
* @param string $group
|
||||
* @param bool $returnURL true if pipeline should return the URL, otherwise the content
|
||||
*
|
||||
* @return bool|string
|
||||
* @return bool|string URL or generated content if available, else false
|
||||
*/
|
||||
protected function pipelineCss($group = 'head')
|
||||
protected function pipelineCss($group = 'head', $returnURL = true)
|
||||
{
|
||||
// temporary list of assets to pipeline
|
||||
$temp_css = [];
|
||||
@@ -695,9 +720,14 @@ class Assets
|
||||
$this->css_no_pipeline = json_decode(file_get_contents($this->assets_dir . $inline_file), true);
|
||||
}
|
||||
|
||||
// If pipeline exist return it
|
||||
// If pipeline exist return its URL or content
|
||||
if (file_exists($this->assets_dir . $file)) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
if ($returnURL) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
else {
|
||||
return file_get_contents($this->assets_dir . $file) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any non-pipeline files
|
||||
@@ -744,7 +774,12 @@ class Assets
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
file_put_contents($this->assets_dir . $file, $buffer);
|
||||
|
||||
return $relative_path . $this->getTimestamp();
|
||||
if ($returnURL) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
else {
|
||||
return $buffer . "\n";
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -754,10 +789,11 @@ class Assets
|
||||
* Minify and concatenate JS files.
|
||||
*
|
||||
* @param string $group
|
||||
* @param bool $returnURL true if pipeline should return the URL, otherwise the content
|
||||
*
|
||||
* @return string
|
||||
* @return bool|string URL or generated content if available, else false
|
||||
*/
|
||||
protected function pipelineJs($group = 'head')
|
||||
protected function pipelineJs($group = 'head', $returnURL = true)
|
||||
{
|
||||
// temporary list of assets to pipeline
|
||||
$temp_js = [];
|
||||
@@ -777,9 +813,14 @@ class Assets
|
||||
$this->js_no_pipeline = json_decode(file_get_contents($this->assets_dir . $inline_file), true);
|
||||
}
|
||||
|
||||
// If pipeline exist return it
|
||||
// If pipeline exist return its URL or content
|
||||
if (file_exists($this->assets_dir . $file)) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
if ($returnURL) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
else {
|
||||
return file_get_contents($this->assets_dir . $file) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any non-pipeline files
|
||||
@@ -816,7 +857,12 @@ class Assets
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
file_put_contents($this->assets_dir . $file, $buffer);
|
||||
|
||||
return $relative_path . $this->getTimestamp();
|
||||
if ($returnURL) {
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
else {
|
||||
return $buffer . "\n";
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -1255,13 +1301,8 @@ class Assets
|
||||
|
||||
$old_url = $matches[2];
|
||||
|
||||
// ensure this is not a data url
|
||||
if (strpos($old_url, 'data:') === 0) {
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
// ensure this is not a remote url
|
||||
if ($this->isRemoteLink($old_url)) {
|
||||
// Ensure link is not rooted to webserver, a data URL, or to a remote host
|
||||
if (Utils::startsWith($old_url, '/') || Utils::startsWith($old_url, 'data:') || $this->isRemoteLink($old_url)) {
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ class GPM extends Iterator
|
||||
$filename = basename($package['path']);
|
||||
|
||||
if (Grav::instance()['config']->get('system.gpm.official_gpm_only') && $package['host'] !== 'getgrav.org') {
|
||||
throw new \RuntimeException("Only offical GPM URLs are allowed. You can modify this behavior in the System configuration.");
|
||||
throw new \RuntimeException("Only official GPM URLs are allowed. You can modify this behavior in the System configuration.");
|
||||
}
|
||||
|
||||
$output = Response::get($package_file, []);
|
||||
@@ -599,9 +599,11 @@ class GPM extends Iterator
|
||||
*/
|
||||
public static function getPackageName($source)
|
||||
{
|
||||
$ignore_yaml_files = ['blueprints', 'languages'];
|
||||
|
||||
foreach (glob($source . "*.yaml") as $filename) {
|
||||
$name = strtolower(basename($filename, '.yaml'));
|
||||
if ($name == 'blueprints') {
|
||||
if (in_array($name, $ignore_yaml_files)) {
|
||||
continue;
|
||||
}
|
||||
return $name;
|
||||
|
||||
@@ -58,6 +58,7 @@ class Installer
|
||||
'sophisticated' => false,
|
||||
'theme' => false,
|
||||
'install_path' => '',
|
||||
'ignores' => [],
|
||||
'exclude_checks' => [self::EXISTS, self::NOT_FOUND, self::IS_LINK]
|
||||
];
|
||||
|
||||
@@ -134,7 +135,7 @@ class Installer
|
||||
self::moveInstall($extracted, $install_path);
|
||||
}
|
||||
} else {
|
||||
self::sophisticatedInstall($extracted, $install_path);
|
||||
self::sophisticatedInstall($extracted, $install_path, $options['ignores']);
|
||||
}
|
||||
|
||||
Folder::delete($tmp);
|
||||
@@ -280,11 +281,11 @@ class Installer
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function sophisticatedInstall($source_path, $install_path)
|
||||
public static function sophisticatedInstall($source_path, $install_path, $ignores = [])
|
||||
{
|
||||
foreach (new \DirectoryIterator($source_path) as $file) {
|
||||
|
||||
if ($file->isLink() || $file->isDot()) {
|
||||
if ($file->isLink() || $file->isDot() || in_array($file->getBasename(),$ignores)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -296,7 +297,7 @@ class Installer
|
||||
|
||||
if ($file->getBasename() == 'bin') {
|
||||
foreach (glob($path . DS . '*') as $bin_file) {
|
||||
@chmod($bin_file, 0755);
|
||||
@chmod($bin_file, 0755);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -170,7 +170,7 @@ class Language
|
||||
*/
|
||||
public function setActiveFromUri($uri)
|
||||
{
|
||||
$regex = '/(^\/(' . $this->getAvailable() . '))(?:\/.*|$)/i';
|
||||
$regex = '/(^\/(' . $this->getAvailable() . '))(?:\/|\?|$)/i';
|
||||
|
||||
// if languages set
|
||||
if ($this->enabled()) {
|
||||
@@ -178,7 +178,7 @@ class Language
|
||||
if (preg_match($regex, $uri, $matches)) {
|
||||
$this->lang_in_url = true;
|
||||
$this->active = $matches[2];
|
||||
$uri = preg_replace("/\\" . $matches[1] . "/", '', $matches[0], 1);
|
||||
$uri = preg_replace("/\\" . $matches[1] . "/", '', $uri, 1);
|
||||
|
||||
// store in session if different
|
||||
if ($this->config->get('system.session.enabled', false)
|
||||
@@ -203,6 +203,15 @@ 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)
|
||||
foreach ($preferred as $lang) {
|
||||
$lang = substr($lang, 0, 2);
|
||||
if ($this->validate($lang)) {
|
||||
$this->active = $lang;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,11 +146,6 @@ class Page
|
||||
$this->extension($extension);
|
||||
}
|
||||
|
||||
// some debugger logic
|
||||
if (isset($this->debugger) && $this->debugger == false) {
|
||||
Grav::instance()['debugger']->enabled(false);
|
||||
}
|
||||
|
||||
// extract page language from page extension
|
||||
$language = trim(basename($this->extension(), 'md'), '.') ?: null;
|
||||
$this->language($language);
|
||||
@@ -575,7 +570,8 @@ class Page
|
||||
|
||||
|
||||
$process_markdown = $this->shouldProcess('markdown');
|
||||
$process_twig = $this->shouldProcess('twig');
|
||||
$process_twig = $this->shouldProcess('twig') || $this->modularTwig() ;
|
||||
|
||||
$cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : $config->get('system.cache.enabled',
|
||||
true);
|
||||
$twig_first = isset($this->header->twig_first) ? $this->header->twig_first : $config->get('system.pages.twig_first',
|
||||
@@ -808,6 +804,9 @@ class Page
|
||||
if ($name == 'folder') {
|
||||
return preg_replace(PAGE_ORDER_PREFIX_REGEX, '', $this->folder);
|
||||
}
|
||||
if ($name == 'slug') {
|
||||
return $this->slug();
|
||||
}
|
||||
if ($name == 'name') {
|
||||
$language = $this->language() ? '.' . $this->language() : '';
|
||||
$name_val = str_replace($language . '.md', '', $this->name());
|
||||
@@ -891,12 +890,12 @@ class Page
|
||||
/**
|
||||
* Save page if there's a file assigned to it.
|
||||
*
|
||||
* @param bool $reorder Internal use.
|
||||
* @param bool|mixed $reorder Internal use.
|
||||
*/
|
||||
public function save($reorder = true)
|
||||
{
|
||||
// Perform move, copy or reordering if needed.
|
||||
$this->doRelocation($reorder);
|
||||
// Perform move, copy [or reordering] if needed.
|
||||
$this->doRelocation();
|
||||
|
||||
$file = $this->file();
|
||||
if ($file) {
|
||||
@@ -905,6 +904,13 @@ class Page
|
||||
$file->markdown($this->raw_content);
|
||||
$file->save();
|
||||
}
|
||||
|
||||
// Perform reorder if required
|
||||
if ($reorder && is_array($reorder)) {
|
||||
$this->doReorder($reorder);
|
||||
}
|
||||
|
||||
$this->_original = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -924,6 +930,14 @@ class Page
|
||||
}
|
||||
|
||||
$this->_action = 'move';
|
||||
|
||||
if ($this->route() == $parent->route()) {
|
||||
throw new Exception('Failed: Cannot set page parent to self');
|
||||
}
|
||||
if (Utils::startsWith($parent->rawRoute(), $this->rawRoute())) {
|
||||
throw new Exception('Failed: Cannot set page parent to a child of current page');
|
||||
}
|
||||
|
||||
$this->parent($parent);
|
||||
$this->id(time() . md5($this->filePath()));
|
||||
|
||||
@@ -1120,7 +1134,7 @@ class Page
|
||||
*/
|
||||
public function childType()
|
||||
{
|
||||
return isset($this->header->child_type) ? (string)$this->header->child_type : 'default';
|
||||
return isset($this->header->child_type) ? (string)$this->header->child_type : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1382,6 +1396,20 @@ class Page
|
||||
return $this->process;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the state of the debugger override etting for this page
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function debugger()
|
||||
{
|
||||
if (isset($this->debugger) && $this->debugger === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to merge page metadata tags and build an array of Metadata objects
|
||||
* that can then be rendered in the page.
|
||||
@@ -2036,7 +2064,6 @@ class Page
|
||||
if ($var !== null) {
|
||||
$this->modular_twig = (bool)$var;
|
||||
if ($var) {
|
||||
$this->process['twig'] = true;
|
||||
$this->visible(false);
|
||||
// some routable logic
|
||||
if (empty($this->header->routable)) {
|
||||
@@ -2263,6 +2290,74 @@ class Page
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to return an ancestor page.
|
||||
*
|
||||
* @param string $url The url of the page
|
||||
* @param bool $lookup Name of the parent folder
|
||||
*
|
||||
* @return \Grav\Common\Page\Page page you were looking for if it exists
|
||||
*/
|
||||
public function ancestor($lookup = null)
|
||||
{
|
||||
/** @var Pages $pages */
|
||||
$pages = Grav::instance()['pages'];
|
||||
|
||||
return $pages->ancestor($this->route, $lookup);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to return an ancestor page to inherit from. The current
|
||||
* page object is returned.
|
||||
*
|
||||
* @param string $field Name of the parent folder
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
public function inherited($field)
|
||||
{
|
||||
list($inherited, $currentParams) = $this->getInheritedParams($field);
|
||||
|
||||
$this->modifyHeader($field, $currentParams);
|
||||
|
||||
return $inherited;
|
||||
}
|
||||
/**
|
||||
* Helper method to return an ancestor field only to inherit from. The
|
||||
* first occurrence of an ancestor field will be returned if at all.
|
||||
*
|
||||
* @param string $field Name of the parent folder
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inheritedField($field)
|
||||
{
|
||||
list($inherited, $currentParams) = $this->getInheritedParams($field);
|
||||
|
||||
return $currentParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that contains shared logic for inherited() and inheritedField()
|
||||
*
|
||||
* @param string $field Name of the parent folder
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getInheritedParams($field)
|
||||
{
|
||||
$pages = Grav::instance()['pages'];
|
||||
|
||||
/** @var Pages $pages */
|
||||
$inherited = $pages->inherited($this->route, $field);
|
||||
$inheritedParams = (array) $inherited->value('header.' . $field);
|
||||
$currentParams = (array) $this->value('header.' . $field);
|
||||
if($inheritedParams && is_array($inheritedParams)) {
|
||||
$currentParams = array_replace_recursive($inheritedParams, $currentParams);
|
||||
}
|
||||
return [$inherited, $currentParams];
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to return a page.
|
||||
*
|
||||
@@ -2597,65 +2692,62 @@ class Page
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves or copies the page in filesystem.
|
||||
* Reorders all siblings according to a defined order
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @param bool $reorder
|
||||
*
|
||||
* @throws Exception
|
||||
* @param $new_order
|
||||
*/
|
||||
protected function doRelocation($reorder)
|
||||
protected function doReorder($new_order)
|
||||
{
|
||||
if (!$this->_original) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do reordering.
|
||||
if ($reorder && $this->order() != $this->_original->order()) {
|
||||
/** @var Pages $pages */
|
||||
$pages = Grav::instance()['pages'];
|
||||
$pages = Grav::instance()['pages'];
|
||||
$pages->init();
|
||||
|
||||
$parent = $this->parent();
|
||||
$this->_original->path($this->path());
|
||||
|
||||
// Extract visible children from the parent page.
|
||||
$list = [];
|
||||
/** @var Page $page */
|
||||
foreach ($parent->children()->visible() as $page) {
|
||||
if ($page->order()) {
|
||||
$list[$page->slug] = $page->path();
|
||||
}
|
||||
}
|
||||
$siblings = $this->parent()->children();
|
||||
$siblings->order('slug', 'asc', $new_order);
|
||||
|
||||
// If page was moved, take it out of the list.
|
||||
if ($this->_action == 'move') {
|
||||
unset($list[$this->slug()]);
|
||||
}
|
||||
$counter = 0;
|
||||
|
||||
$list = array_values($list);
|
||||
// Reorder all moved pages.
|
||||
foreach ($siblings as $slug => $page) {
|
||||
$order = intval(trim($page->order(),'.'));
|
||||
$counter++;
|
||||
|
||||
// Then add it back to the new location (if needed).
|
||||
if ($this->order()) {
|
||||
array_splice($list, min($this->order() - 1, count($list)), 0, [$this->path()]);
|
||||
}
|
||||
|
||||
// Reorder all moved pages.
|
||||
foreach ($list as $order => $path) {
|
||||
if ($path == $this->path()) {
|
||||
if ($order) {
|
||||
if ($page->path() == $this->path() && $this->folderExists()) {
|
||||
// Handle current page; we do want to change ordering number, but nothing else.
|
||||
$this->order($order + 1);
|
||||
$this->order($counter);
|
||||
$this->save(false);
|
||||
} else {
|
||||
// Handle all the other pages.
|
||||
$page = $pages->get($path);
|
||||
|
||||
if ($page && $page->exists() && !$page->_action && $page->order() != $order + 1) {
|
||||
$page = $page->move($parent);
|
||||
$page->order($order + 1);
|
||||
$page = $pages->get($page->path());
|
||||
if ($page && $page->folderExists() && !$page->_action) {
|
||||
$page = $page->move($this->parent());
|
||||
$page->order($counter);
|
||||
$page->save(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves or copies the page in filesystem.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function doRelocation()
|
||||
{
|
||||
if (!$this->_original) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_dir($this->_original->path())) {
|
||||
if ($this->_action == 'move') {
|
||||
Folder::move($this->_original->path(), $this->path());
|
||||
@@ -2671,7 +2763,6 @@ class Page
|
||||
}
|
||||
}
|
||||
|
||||
$this->_original = null;
|
||||
}
|
||||
|
||||
protected function setPublishState()
|
||||
|
||||
@@ -291,36 +291,86 @@ class Pages
|
||||
return new Collection($children, [], $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a page ancestor.
|
||||
*
|
||||
* @param string $route The relative URL of the page
|
||||
* @param string $path The relative path of the ancestor folder
|
||||
*
|
||||
* @return Page|null
|
||||
*/
|
||||
public function ancestor($route, $path = null)
|
||||
{
|
||||
if (!is_null($path)) {
|
||||
|
||||
$page = $this->dispatch($route, true);
|
||||
|
||||
if ($page->path() == $path) {
|
||||
return $page;
|
||||
} elseif (!$page->parent()->root()) {
|
||||
return $this->ancestor($page->parent()->route(), $path);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a page ancestor trait.
|
||||
*
|
||||
* @param string $route The relative route of the page
|
||||
* @param string $field The field name of the ancestor to query for
|
||||
*
|
||||
* @return Page|null
|
||||
*/
|
||||
public function inherited($route, $field = null)
|
||||
{
|
||||
if (!is_null($field)) {
|
||||
|
||||
$page = $this->dispatch($route, true);
|
||||
|
||||
$ancestorField = $page->parent()->value('header.' . $field);
|
||||
|
||||
if ($ancestorField != null) {
|
||||
return $page->parent();
|
||||
} elseif (!$page->parent()->root()) {
|
||||
return $this->inherited($page->parent()->route(), $field);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* alias method to return find a page.
|
||||
*
|
||||
* @param string $url The relative URL of the page
|
||||
* @param string $route The relative URL of the page
|
||||
* @param bool $all
|
||||
*
|
||||
* @return Page|null
|
||||
*/
|
||||
public function find($url, $all = false)
|
||||
public function find($route, $all = false)
|
||||
{
|
||||
return $this->dispatch($url, $all, false);
|
||||
return $this->dispatch($route, $all, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch URI to a page.
|
||||
*
|
||||
* @param string $url The relative URL of the page
|
||||
* @param string $route The relative URL of the page
|
||||
* @param bool $all
|
||||
*
|
||||
* @param bool $redirect
|
||||
* @return Page|null
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dispatch($url, $all = false, $redirect = true)
|
||||
public function dispatch($route, $all = false, $redirect = true)
|
||||
{
|
||||
// Fetch page if there's a defined route to it.
|
||||
$page = isset($this->routes[$url]) ? $this->get($this->routes[$url]) : null;
|
||||
$page = isset($this->routes[$route]) ? $this->get($this->routes[$route]) : null;
|
||||
// Try without trailing slash
|
||||
if (!$page && Utils::endsWith($url, '/')) {
|
||||
$page = isset($this->routes[rtrim($url, '/')]) ? $this->get($this->routes[rtrim($url, '/')]) : null;
|
||||
if (!$page && Utils::endsWith($route, '/')) {
|
||||
$page = isset($this->routes[rtrim($route, '/')]) ? $this->get($this->routes[rtrim($route, '/')]) : null;
|
||||
}
|
||||
|
||||
// Are we in the admin? this is important!
|
||||
@@ -340,13 +390,13 @@ class Pages
|
||||
$config = $this->grav['config'];
|
||||
|
||||
// See if route matches one in the site configuration
|
||||
$route = $config->get("site.routes.{$url}");
|
||||
if ($route) {
|
||||
$page = $this->dispatch($route, $all);
|
||||
$site_route = $config->get("site.routes.{$route}");
|
||||
if ($site_route) {
|
||||
$page = $this->dispatch($site_route, $all);
|
||||
} else {
|
||||
// Try Regex style redirects
|
||||
$uri = $this->grav['uri'];
|
||||
$source_url = $url;
|
||||
$source_url = $route;
|
||||
$extension = $uri->extension();
|
||||
if (isset($extension) && !Utils::endsWith($uri->url(), $extension)) {
|
||||
$source_url.= '.' . $extension;
|
||||
@@ -453,18 +503,66 @@ class Pages
|
||||
return $all;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available parents raw routes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function parentsRawRoutes()
|
||||
{
|
||||
$rawRoutes = true;
|
||||
|
||||
return self::getParents($rawRoutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available parents routes
|
||||
*
|
||||
* @param bool $rawRoutes get the raw route or the normal route
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getParents($rawRoutes)
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
|
||||
/** @var Pages $pages */
|
||||
$pages = $grav['pages'];
|
||||
|
||||
$parents = $pages->getList(null, 0, $rawRoutes);
|
||||
|
||||
if (isset($grav['admin'])) {
|
||||
// Remove current route from parents
|
||||
|
||||
/** @var Admin $admin */
|
||||
$admin = $grav['admin'];
|
||||
|
||||
$page = $admin->getPage($admin->route);
|
||||
$page_route = $page->route();
|
||||
if (isset($parents[$page_route])) {
|
||||
unset($parents[$page_route]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of route/title of all pages.
|
||||
*
|
||||
* @param Page $current
|
||||
* @param int $level
|
||||
* @param int $level
|
||||
* @param bool $rawRoutes
|
||||
*
|
||||
* @param bool $showAll
|
||||
* @param bool $showFullpath
|
||||
* @param bool $showSlug
|
||||
* @param bool $showModular
|
||||
* @param bool $limitLevels
|
||||
* @return array
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function getList(Page $current = null, $level = 0, $rawRoutes = false)
|
||||
public function getList(Page $current = null, $level = 0, $rawRoutes = false, $showAll = true, $showFullpath = false, $showSlug = false, $showModular = false, $limitLevels = false)
|
||||
{
|
||||
if (!$current) {
|
||||
if ($level) {
|
||||
@@ -482,11 +580,27 @@ class Pages
|
||||
} else {
|
||||
$route = $current->route();
|
||||
}
|
||||
$list[$route] = str_repeat(' ', ($level - 1) * 2) . $current->title();
|
||||
|
||||
if ($showFullpath) {
|
||||
$option = $current->route();
|
||||
} else {
|
||||
$extra = $showSlug ? '(' . $current->slug() . ') ' : '';
|
||||
$option = str_repeat('—-', $level). '▸ ' . $extra . $current->title();
|
||||
|
||||
|
||||
}
|
||||
|
||||
$list[$route] = $option;
|
||||
|
||||
|
||||
}
|
||||
|
||||
foreach ($current->children() as $next) {
|
||||
$list = array_merge($list, $this->getList($next, $level + 1, $rawRoutes));
|
||||
if ($limitLevels == false || ($level+1 < $limitLevels)) {
|
||||
foreach ($current->children() as $next) {
|
||||
if ($showAll || $next->routable() || ($next->modular() && $showModular)) {
|
||||
$list = array_merge($list, $this->getList($next, $level + 1, $rawRoutes, $showAll, $showFullpath, $showSlug, $showModular, $limitLevels));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
@@ -633,50 +747,7 @@ class Pages
|
||||
return self::getParents($rawRoutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available parents raw routes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function parentsRawRoutes()
|
||||
{
|
||||
$rawRoutes = true;
|
||||
|
||||
return self::getParents($rawRoutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available parents routes
|
||||
*
|
||||
* @param bool $rawRoutes get the raw route or the normal route
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getParents($rawRoutes)
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
|
||||
/** @var Pages $pages */
|
||||
$pages = $grav['pages'];
|
||||
|
||||
$parents = $pages->getList(null, 0, $rawRoutes);
|
||||
|
||||
if (isset($grav['admin'])) {
|
||||
// Remove current route from parents
|
||||
|
||||
/** @var Admin $admin */
|
||||
$admin = $grav['admin'];
|
||||
|
||||
$page = $admin->getPage($admin->route);
|
||||
$page_route = $page->route();
|
||||
if (isset($parents[$page_route])) {
|
||||
unset($parents[$page_route]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the home route
|
||||
|
||||
@@ -39,6 +39,11 @@ class PageServiceProvider implements ServiceProviderInterface
|
||||
/** @var Language $language */
|
||||
$language = $c['language'];
|
||||
|
||||
// some debugger override logic
|
||||
if ($page->debugger() === false) {
|
||||
Grav::instance()['debugger']->enabled(false);
|
||||
}
|
||||
|
||||
if ($c['config']->get('system.force_ssl')) {
|
||||
if (!isset($_SERVER['HTTPS']) || $_SERVER["HTTPS"] != "on") {
|
||||
$url = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
||||
|
||||
@@ -24,6 +24,8 @@ class Themes extends Iterator
|
||||
/** @var Config */
|
||||
protected $config;
|
||||
|
||||
protected $inited = false;
|
||||
|
||||
/**
|
||||
* Themes constructor.
|
||||
*
|
||||
@@ -51,25 +53,29 @@ class Themes extends Iterator
|
||||
|
||||
public function initTheme()
|
||||
{
|
||||
/** @var Themes $themes */
|
||||
$themes = $this->grav['themes'];
|
||||
if ($this->inited === false) {
|
||||
/** @var Themes $themes */
|
||||
$themes = $this->grav['themes'];
|
||||
|
||||
try {
|
||||
$instance = $themes->load();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new \RuntimeException($this->current() . ' theme could not be found');
|
||||
try {
|
||||
$instance = $themes->load();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new \RuntimeException($this->current() . ' theme could not be found');
|
||||
}
|
||||
|
||||
if ($instance instanceof EventSubscriberInterface) {
|
||||
/** @var EventDispatcher $events */
|
||||
$events = $this->grav['events'];
|
||||
|
||||
$events->addSubscriber($instance);
|
||||
}
|
||||
|
||||
$this->grav['theme'] = $instance;
|
||||
|
||||
$this->grav->fireEvent('onThemeInitialized');
|
||||
|
||||
$this->inited = true;
|
||||
}
|
||||
|
||||
if ($instance instanceof EventSubscriberInterface) {
|
||||
/** @var EventDispatcher $events */
|
||||
$events = $this->grav['events'];
|
||||
|
||||
$events->addSubscriber($instance);
|
||||
}
|
||||
|
||||
$this->grav['theme'] = $instance;
|
||||
|
||||
$this->grav->fireEvent('onThemeInitialized');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,10 +230,14 @@ class Themes extends Iterator
|
||||
$locator = $this->grav['locator'];
|
||||
|
||||
$registered = stream_get_wrappers();
|
||||
$schemes = $config->get(
|
||||
"themes.{$name}.streams.schemes",
|
||||
['theme' => ['paths' => $locator->findResources("themes://{$name}", false)]]
|
||||
);
|
||||
|
||||
$schemes = $config->get("themes.{$name}.streams.schemes", []);
|
||||
$schemes += [
|
||||
'theme' => [
|
||||
'type' => 'ReadOnlyStream',
|
||||
'paths' => $locator->findResources("themes://{$name}", false)
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($schemes as $scheme => $config) {
|
||||
if (isset($config['paths'])) {
|
||||
@@ -316,6 +326,15 @@ class Themes extends Iterator
|
||||
// Remove prefix from class
|
||||
$class = substr($class, strlen($prefix));
|
||||
|
||||
// Try Old style theme classes
|
||||
$path = strtolower(ltrim(preg_replace('#\\\|_(?!.+\\\)#', '/', $class), '/'));
|
||||
$file = $this->grav['locator']->findResource("themes://{$path}/{$path}.php");
|
||||
|
||||
// Load class
|
||||
if (file_exists($file)) {
|
||||
return include_once($file);
|
||||
}
|
||||
|
||||
// Replace namespace tokens to directory separators
|
||||
$path = $this->grav['inflector']->hyphenize(ltrim($class,"\\"));
|
||||
$file = $this->grav['locator']->findResource("themes://{$path}/{$path}.php");
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Grav\Common\Twig;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\Config\Config;
|
||||
use Grav\Common\Language\Language;
|
||||
use Grav\Common\Language\LanguageCodes;
|
||||
use Grav\Common\Page\Page;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
use RocketTheme\Toolbox\Event\Event;
|
||||
@@ -173,7 +174,7 @@ class Twig
|
||||
'theme_dir' => $locator->findResource('theme://'),
|
||||
'theme_url' => $this->grav['base_url'] . '/' . $locator->findResource('theme://', false),
|
||||
'html_lang' => $this->grav['language']->getActive() ?: $config->get('site.default_lang', 'en'),
|
||||
|
||||
'language_codes' => new LanguageCodes,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -229,25 +230,22 @@ class Twig
|
||||
$twig_vars['header'] = $item->header();
|
||||
|
||||
$local_twig = clone($this->twig);
|
||||
$modular_twig = $item->modularTwig();
|
||||
$process_twig = isset($item->header()->process['twig']) ? $item->header()->process['twig'] : false;
|
||||
|
||||
$output = '';
|
||||
|
||||
try {
|
||||
// Process Modular Twig
|
||||
if ($modular_twig) {
|
||||
if ($item->modularTwig()) {
|
||||
$twig_vars['content'] = $content;
|
||||
$template = $item->template() . TEMPLATE_EXT;
|
||||
$output = $content = $local_twig->render($template, $twig_vars);
|
||||
}
|
||||
|
||||
// Process in-page Twig
|
||||
if (!$modular_twig || ($modular_twig && $process_twig)) {
|
||||
if ($item->shouldProcess('twig')) {
|
||||
$name = '@Page:' . $item->path();
|
||||
$this->setTemplate($name, $content);
|
||||
$output = $local_twig->render($name, $twig_vars);
|
||||
}
|
||||
|
||||
} catch (\Twig_Error_Loader $e) {
|
||||
throw new \RuntimeException($e->getRawMessage(), 404, $e);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ class TwigExtension extends \Twig_Extension
|
||||
new \Twig_SimpleFunction('get_cookie', [$this, 'getCookie']),
|
||||
new \Twig_SimpleFunction('redirect_me', [$this, 'redirectFunc']),
|
||||
new \Twig_SimpleFunction('range', [$this, 'rangeFunc']),
|
||||
new \Twig_SimpleFunction('isajaxrequest', [$this, 'isAjaxFunc']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -570,15 +571,22 @@ class TwigExtension extends \Twig_Extension
|
||||
$domain = true;
|
||||
}
|
||||
|
||||
if (Grav::instance()['uri']->isExternal($input)) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
if (strpos((string)$input, '://')) {
|
||||
$input = ltrim((string)$input, '/');
|
||||
|
||||
if (Utils::contains((string)$input, '://')) {
|
||||
/** @var UniformResourceLocator $locator */
|
||||
$locator = $this->grav['locator'];
|
||||
|
||||
|
||||
|
||||
// Get relative path to the resource (or false if not found).
|
||||
$resource = $locator->findResource((string)$input, false);
|
||||
$resource = $locator->findResource($input, false);
|
||||
} else {
|
||||
$resource = (string)$input;
|
||||
$resource = $input;
|
||||
}
|
||||
|
||||
/** @var Uri $uri */
|
||||
@@ -885,4 +893,17 @@ class TwigExtension extends \Twig_Extension
|
||||
{
|
||||
return range($start, $end, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if HTTP_X_REQUESTED_WITH has been set to xmlhttprequest,
|
||||
* in which case we may unsafely assume ajax. Non critical use only.
|
||||
*
|
||||
* @return true if HTTP_X_REQUESTED_WITH exists and has been set to xmlhttprequest
|
||||
*/
|
||||
public function isAjaxFunc()
|
||||
{
|
||||
return (
|
||||
!empty($_SERVER['HTTP_X_REQUESTED_WITH'])
|
||||
&& strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,4 +239,20 @@ class User extends Data
|
||||
{
|
||||
return $this->authorize($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the User's avatar URL
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function avatarUrl()
|
||||
{
|
||||
if ($this->avatar) {
|
||||
$avatar = $this->avatar;
|
||||
$avatar = array_shift($avatar);
|
||||
return Grav::instance()['base_url'] . '/' . $avatar['path'];
|
||||
} else {
|
||||
return 'https://www.gravatar.com/avatar/' . md5($this->email);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ use Grav\Common\GPM\Installer;
|
||||
use Grav\Common\GPM\Response;
|
||||
use Grav\Console\ConsoleCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||
|
||||
class DirectInstallCommand extends ConsoleCommand
|
||||
@@ -31,7 +32,20 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
->addArgument(
|
||||
'package-file',
|
||||
InputArgument::REQUIRED,
|
||||
'The local location or remote URL to an installable package file'
|
||||
'Installable package local <path> or remote <URL>. Can install specific version'
|
||||
)
|
||||
->addOption(
|
||||
'all-yes',
|
||||
'y',
|
||||
InputOption::VALUE_NONE,
|
||||
'Assumes yes (or best approach) instead of prompting'
|
||||
)
|
||||
->addOption(
|
||||
'destination',
|
||||
'd',
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
'The destination where the package should be installed at. By default this would be where the grav instance has been launched from',
|
||||
GRAV_ROOT
|
||||
)
|
||||
->setDescription("Installs Grav, plugin, or theme directly from a file or a URL")
|
||||
->setHelp('The <info>direct-install</info> command installs Grav, plugin, or theme directly from a file or a URL');
|
||||
@@ -42,12 +56,26 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
*/
|
||||
protected function serve()
|
||||
{
|
||||
// Making sure the destination is usable
|
||||
$this->destination = realpath($this->input->getOption('destination'));
|
||||
|
||||
if (
|
||||
!Installer::isGravInstance($this->destination) ||
|
||||
!Installer::isValidDestination($this->destination, [Installer::EXISTS, Installer::IS_LINK])
|
||||
) {
|
||||
$this->output->writeln("<red>ERROR</red>: " . Installer::lastErrorMsg());
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$this->all_yes = $this->input->getOption('all-yes');
|
||||
|
||||
$package_file = $this->input->getArgument('package-file');
|
||||
|
||||
$helper = $this->getHelper('question');
|
||||
$question = new ConfirmationQuestion('Are you sure you want to direct-install <cyan>'.$package_file.'</cyan> [y|N] ', false);
|
||||
|
||||
$answer = $helper->ask($this->input, $this->output, $question);
|
||||
$answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
|
||||
|
||||
if (!$answer) {
|
||||
$this->output->writeln("exiting...");
|
||||
@@ -72,7 +100,7 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
$this->output->writeln('');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($zip) {
|
||||
$this->output->write("\x0D");
|
||||
$this->output->write(" |- Downloading package... 100%");
|
||||
@@ -97,6 +125,8 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
if (!$extracted) {
|
||||
$this->output->write("\x0D");
|
||||
$this->output->writeln(" |- Extracting package... <red>failed</red>");
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -109,6 +139,8 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
if (!$type) {
|
||||
$this->output->writeln(" '- <red>ERROR: Not a valid Grav package</red>");
|
||||
$this->output->writeln('');
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -117,22 +149,27 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
if (isset($blueprint['dependencies'])) {
|
||||
$depencencies = [];
|
||||
foreach ($blueprint['dependencies'] as $dependency) {
|
||||
if (is_array($dependency) && isset($dependency['name'])) {
|
||||
$depencencies[] = $dependency['name'];
|
||||
if (is_array($dependency)){
|
||||
if (isset($dependency['name'])) {
|
||||
$depencencies[] = $dependency['name'];
|
||||
}
|
||||
if (isset($dependency['github'])) {
|
||||
$depencencies[] = $dependency['github'];
|
||||
}
|
||||
} else {
|
||||
$depencencies[] = $dependency;
|
||||
$depencencies[] = $dependency;
|
||||
}
|
||||
}
|
||||
$this->output->writeln(" |- Dependencies found... <cyan>[" . implode(',', $depencencies) . "]</cyan>");
|
||||
|
||||
|
||||
|
||||
$question = new ConfirmationQuestion(" | '- Dependencies will not be satisfied. Continue ? [y|N] ", false);
|
||||
$answer = $helper->ask($this->input, $this->output, $question);
|
||||
$answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
|
||||
|
||||
if (!$answer) {
|
||||
$this->output->writeln("exiting...");
|
||||
$this->output->writeln('');
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -147,6 +184,8 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
$this->output->writeln(" |- Checking destination... <yellow>symbolic link</yellow>");
|
||||
$this->output->writeln(" '- <red>ERROR: symlinks found...</red> <yellow>" . GRAV_ROOT."</yellow>");
|
||||
$this->output->writeln('');
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -161,6 +200,8 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
if (!$name) {
|
||||
$this->output->writeln("<red>ERROR: Name could not be determined.</red> Please specify with --name|-n");
|
||||
$this->output->writeln('');
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -175,6 +216,8 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
$this->output->writeln(" |- Checking destination... <yellow>symbolic link</yellow>");
|
||||
$this->output->writeln(" '- <red>ERROR: symlink found...</red> <yellow>" . GRAV_ROOT . DS . $install_path . '</yellow>');
|
||||
$this->output->writeln('');
|
||||
Folder::delete($tmp_source);
|
||||
Folder::delete($tmp_zip);
|
||||
exit;
|
||||
|
||||
} else {
|
||||
@@ -184,7 +227,16 @@ class DirectInstallCommand extends ConsoleCommand
|
||||
|
||||
$this->output->write(" |- Installing package... ");
|
||||
|
||||
Installer::install($zip, GRAV_ROOT, ['install_path' => $install_path, 'theme' => (($type == 'theme')), 'is_update' => $is_update], $extracted);
|
||||
Installer::install(
|
||||
$zip,
|
||||
$this->destination,
|
||||
$options = [
|
||||
'install_path' => $install_path,
|
||||
'theme' => (($type == 'theme')),
|
||||
'is_update' => $is_update
|
||||
],
|
||||
$extracted
|
||||
);
|
||||
}
|
||||
|
||||
Folder::delete($tmp_source);
|
||||
|
||||
@@ -80,7 +80,7 @@ class InstallCommand extends ConsoleCommand
|
||||
->addArgument(
|
||||
'package',
|
||||
InputArgument::IS_ARRAY | InputArgument::REQUIRED,
|
||||
'The package(s) that are desired to be installed. Use the "index" command for a list of packages'
|
||||
'Package(s) to install. Use "bin/gpm index" to list packages. Use "bin/gpm direct-install" to install a specific version'
|
||||
)
|
||||
->setDescription("Performs the installation of plugins and themes")
|
||||
->setHelp('The <info>install</info> command allows to install plugins and themes');
|
||||
@@ -563,6 +563,7 @@ class InstallCommand extends ConsoleCommand
|
||||
$tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true);
|
||||
$this->tmp = $tmp_dir . '/Grav-' . uniqid();
|
||||
$filename = $package->slug . basename($package->zipball_url);
|
||||
$filename = preg_replace('/[\\\\\/:"*?&<>|]+/mi', '-', $filename);
|
||||
$query = '';
|
||||
|
||||
if ($package->premium) {
|
||||
|
||||
40
tests/functional/Grav/Console/DirectInstallCommandTest.php
Normal file
40
tests/functional/Grav/Console/DirectInstallCommandTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Codeception\Util\Fixtures;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Console\Gpm\DirectInstallCommand;
|
||||
|
||||
|
||||
/**
|
||||
* Class DirectInstallCommandTest
|
||||
*/
|
||||
class DirectInstallCommandTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
|
||||
/** @var DirectInstallCommand */
|
||||
protected $directInstall;
|
||||
|
||||
|
||||
protected function _before()
|
||||
{
|
||||
$this->grav = Fixtures::get('grav');
|
||||
$this->directInstallCommand = new DirectInstallCommand();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Why this test file is empty
|
||||
*
|
||||
* Wasn't able to call a symfony\console. Kept having $output problem.
|
||||
* symfony console \NullOutput didn't cut it.
|
||||
*
|
||||
* We would also need to Mock tests since downloading packages would
|
||||
* make tests slow and unreliable. But it's not worth the time ATM.
|
||||
*
|
||||
* Look at Gpm/InstallCommandTest.php
|
||||
*
|
||||
* For the full story: https://git.io/vSlI3
|
||||
*/
|
||||
@@ -41,6 +41,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'priority' => 10,
|
||||
'order' => 0,
|
||||
'pipeline' => true,
|
||||
'loading' => '',
|
||||
'group' => 'head',
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
@@ -56,6 +57,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'priority' => 10,
|
||||
'order' => 0,
|
||||
'pipeline' => true,
|
||||
'loading' => '',
|
||||
'group' => 'head',
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
@@ -73,6 +75,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'priority' => 10,
|
||||
'order' => 0,
|
||||
'pipeline' => true,
|
||||
'loading' => '',
|
||||
'group' => 'head',
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
@@ -90,6 +93,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'priority' => 10,
|
||||
'order' => 0,
|
||||
'pipeline' => true,
|
||||
'loading' => '',
|
||||
'group' => 'head',
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
@@ -133,6 +137,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'priority' => 10,
|
||||
'order' => 0,
|
||||
'pipeline' => true,
|
||||
'loading' => '',
|
||||
'group' => 'footer',
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
@@ -192,6 +197,22 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
'modified' => false
|
||||
], reset($array));
|
||||
|
||||
//Test inline
|
||||
$this->assets->reset();
|
||||
$this->assets->addJs('/system/assets/jquery/jquery-2.x.min.js', null, true, 'inline', null);
|
||||
$js = $this->assets->js();
|
||||
$this->assertContains('jQuery Foundation', $js);
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addCss('/system/assets/debugger.css', null, true, null, 'inline');
|
||||
$css = $this->assets->css();
|
||||
$this->assertContains('div.phpdebugbar', $css);
|
||||
|
||||
$this->assets->reset();
|
||||
$this->assets->addCss('https://fonts.googleapis.com/css?family=Roboto', null, true, null, 'inline');
|
||||
$css = $this->assets->css();
|
||||
$this->assertContains('font-family: \'Roboto\';', $css);
|
||||
|
||||
//Test adding media queries
|
||||
$this->assets->reset();
|
||||
$this->assets->add('test.css', ['media' => 'only screen and (min-width: 640px)']);
|
||||
@@ -336,6 +357,24 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assertContains($this->assets->getTimestamp(), $css);
|
||||
}
|
||||
|
||||
public function testInlinePipeline()
|
||||
{
|
||||
$this->assets->reset();
|
||||
|
||||
//File not existing. Pipeline searches for that file without reaching it. Output is empty.
|
||||
$this->assets->add('test.css', null, true);
|
||||
$this->assets->setCssPipeline(true);
|
||||
$css = $this->assets->css('head', ['loading' => 'inline']);
|
||||
$this->assertSame('', $css);
|
||||
|
||||
//Add a core Grav CSS file, which is found. Pipeline will now return its content.
|
||||
$this->assets->addCss('https://fonts.googleapis.com/css?family=Roboto', null, true);
|
||||
$this->assets->add('/system/assets/debugger.css', null, true);
|
||||
$css = $this->assets->css('head', ['loading' => 'inline']);
|
||||
$this->assertContains('font-family:\'Roboto\';', $css);
|
||||
$this->assertContains('div.phpdebugbar', $css);
|
||||
}
|
||||
|
||||
public function testAddAsyncJs()
|
||||
{
|
||||
$this->assets->reset();
|
||||
|
||||
@@ -11,7 +11,7 @@ class GpmStub extends GPM
|
||||
{
|
||||
public $data;
|
||||
|
||||
public function findPackage($packageName)
|
||||
public function findPackage($packageName, $ignore_exception = false)
|
||||
{
|
||||
if (isset($this->data[$packageName])) {
|
||||
return $this->data[$packageName];
|
||||
@@ -320,4 +320,4 @@ class GpmTest extends \Codeception\TestCase\Test
|
||||
$this->assertSame(null, $this->gpm->calculateVersionNumberFromDependencyVersion('*'));
|
||||
$this->assertSame('2.0.2', $this->gpm->calculateVersionNumberFromDependencyVersion('2.0.2'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,8 +229,8 @@ class PagesTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
$list = $this->pages->getList();
|
||||
$this->assertTrue(is_array($list));
|
||||
$this->assertSame('Home', $list['/']);
|
||||
$this->assertSame('Blog', $list['/blog']);
|
||||
$this->assertSame('—-▸ Home', $list['/']);
|
||||
$this->assertSame('—-▸ Blog', $list['/blog']);
|
||||
}
|
||||
|
||||
public function testGetTypes()
|
||||
|
||||
@@ -23,7 +23,7 @@ $HTTP["querystring"] =~ "_REQUEST(=|\[|\%[0-9A-Z])" {
|
||||
|
||||
#REROUTING TO THE INDEX PAGE
|
||||
url.rewrite-if-not-file = (
|
||||
"^/grav_path/(.*)$" => "/grav_path/index.php"
|
||||
"^/grav_path/(.*)$" => "/grav_path/index.php$1"
|
||||
)
|
||||
|
||||
#IMPROVING SECURITY
|
||||
|
||||
Reference in New Issue
Block a user