Compare commits

...

118 Commits

Author SHA1 Message Date
Andy Miller
cd30e6a331 version update 2016-06-01 17:43:54 -06:00
Andy Miller
35c7698139 Reverted the gzip fixes.. will try again! 2016-05-31 11:51:51 -06:00
Andy Miller
471cf7fe31 Removed references to mcrclay/minify's CSS and JS min 2016-05-31 11:29:37 -06:00
Andy Miller
88fad44dca switched mcrclay/minify library for matthiasmullie/minify 2016-05-31 11:26:27 -06:00
Flavio Copes
cb28112d94 Also enable system.apache_zlib_fix if apache+fcgi 2016-05-31 17:12:45 +02:00
Flavio Copes
822a111919 Re-apply 7619d3b54a which got lost in the Grav classes refactoring
Preserve url query/fragment/params on lang redirect
2016-05-31 13:17:00 +02:00
Andy Miller
d6a47af84a updated changelog 2016-05-30 23:07:04 -06:00
Andy Miller
a24b7faef5 Added a new CSS / JS minify library that seems to do a better job #864 2016-05-30 23:05:59 -06:00
Andy Miller
395e640e39 Changelog + Version update 2016-05-30 20:27:23 -06:00
Andy Miller
db082e4e62 updated composer packages 2016-05-30 20:23:31 -06:00
Andy Miller
4de9c94bd5 Remove double URL encode when processing params in links - #860 2016-05-30 17:14:21 -06:00
Andy Miller
7fc2f20f1b Better handling of params with more complex Urls - #859 2016-05-30 16:41:07 -06:00
Andy Miller
1c12bb5fc1 I broke InitializeProcessor in last commit! 2016-05-30 16:02:31 -06:00
Quy
a485644c38 Replace underscore with space for display of timezones #626 (#861)
Thanks!
2016-05-30 15:03:42 -06:00
Andy Miller
32cf73e865 changelog updated 2016-05-30 12:29:53 -06:00
Andy Miller
e4a3d6a3b9 Merge branch 'feature/bettef-gzip-flush-buffers' into develop 2016-05-30 12:27:16 -06:00
Andy Miller
4fbf4329fd Fix for Validation::typeX() missing causing validation errors - #626 2016-05-30 12:17:13 -06:00
Flavio Copes
43c0ac275f Correctly handle language strings to termine if it's admin or not Fix https://github.com/getgrav/grav-plugin-admin/issues/627 2016-05-30 18:28:50 +02:00
Flavio Copes
a381e5bb66 Fix #798 use raw routes in blueprints 2016-05-30 10:44:11 +02:00
Andy Miller
971c5d326d Code cleanup 2016-05-29 19:36:17 -06:00
Benny
4c687ee368 Install plugins and themes in correct multisite folders (#841)
* Adresses #319 (https://github.com/getgrav/grav-plugin-admin/issues/319)
2016-05-29 19:27:25 -06:00
Andy Miller
7b56041dad The fix here seems to do more damage than harm.. removing 2016-05-28 21:38:54 -06:00
Andy Miller
d7f286f601 Updated with more lang codes 2016-05-28 18:25:13 -06:00
Andy Miller
581bbaf19c Updated with more lang codes 2016-05-28 18:24:27 -06:00
Andy Miller
6c9037e125 flush any and all buffers 2016-05-28 16:52:04 -06:00
Andy Miller
da0f9cd4d9 bit more compression 2016-05-28 16:51:34 -06:00
Andy Miller
6ed1f767b9 Fixed issue with zlib and no shutdown close_connection false 2016-05-28 13:50:18 -06:00
Andy Miller
13c5035386 zlib + gzip incompatibility is not specific to mod_php, it's for all.. so that needed adjusting 2016-05-27 18:03:12 -06:00
Andy Miller
5acfdee876 Only implement zlib fix for apache2handler - tested fine with Caddy 2016-05-27 17:50:31 -06:00
Andy Miller
7a3ae9186b working pretty well with zlib + grav gzip.. deflate needs work 2016-05-27 16:37:40 -06:00
Flavio Copes
02f863ad2c Use the raw route for page parent select 2016-05-27 19:50:15 +02:00
Andy Miller
d048057249 Added back GravTrait::$grav for compatibility for < 1.0.10 versions of admin plugin 2016-05-26 17:46:14 -06:00
Andy Miller
5fb6b634e9 Changelog updated 2016-05-25 17:12:52 -06:00
Andy Miller
c7fe13aa6a updated changelog 2016-05-25 15:40:26 -06:00
Andy Miller
36661a88d0 fixed a bug in Page::relativePagePath() when name is not defined 2016-05-25 15:39:30 -06:00
Andy Miller
e8f3a43ded changelog updated 2016-05-25 11:13:32 -06:00
Andy Miller
78891add6a setDotNotation() Test added 2016-05-25 11:12:56 -06:00
Andy Miller
892fb83a32 Replace remove with dotNotation() methods 2016-05-25 11:05:52 -06:00
Andy Miller
841d4727ef useful functions for getting and setting dot notation based arrays 2016-05-24 21:50:56 -06:00
Andy Miller
a3e31c786e Better fix for redirects loop (admin safe) 2016-05-24 11:43:44 -06:00
Andy Miller
24bc4b2644 Merge branch 'develop' of https://github.com/getgrav/grav into develop 2016-05-24 10:56:22 -06:00
Andy Miller
0b81fda01c Break redirect logic out of the main page not found if statement - causing infinite loops 2016-05-24 10:56:07 -06:00
Matias Griese
a3ec59d678 Detect if user really meant to extend parent blueprint, not another one (composer update) 2016-05-24 11:09:51 +03:00
Andy Miller
2ce137eb3e Switch to markdown-notices styling rather than older >>> block quote overrides 2016-05-23 15:39:43 -06:00
Andy Miller
d18aa3e11e version update 2016-05-23 14:44:02 -06:00
Andy Miller
f549b27dfc Modular Children text 2016-05-23 12:59:45 -06:00
Andy Miller
83bbc497a8 Added ability to get a specific item of content meta 2016-05-23 12:51:53 -06:00
Andy Miller
10d301a179 Added flash storage 2016-05-20 16:53:00 -06:00
Andy Miller
18a8483522 Updated some vendor libs 2016-05-20 13:13:18 -06:00
Andy Miller
daebf05f9b Make URI::ip() static by default 2016-05-20 13:13:03 -06:00
Matias Griese
7e4dad1cb1 Blueprint::setTypes(): initialize internals before setting the types 2016-05-20 22:06:01 +03:00
Matias Griese
b3755b371f Revert last change (not needed) 2016-05-20 22:03:17 +03:00
Matias Griese
4cba419d6d Set default form field types while loading blueprint 2016-05-20 21:57:15 +03:00
Matias Griese
57544f6fe3 Add function Blueprint::setTypes() 2016-05-20 21:52:31 +03:00
Andy Miller
f449c560c4 fix for getting admin route when Uri::init() is called after Session::init() 2016-05-20 10:38:43 -06:00
Flavio Copes
77d03b6a46 Load session prior to uri as the initialization of Uri does some session handling for the active language (#843)
Refs https://github.com/getgrav/grav/issues/842
2016-05-20 10:13:01 -06:00
Flavio Copes
d9ebf3580a Update changelog 2016-05-18 10:14:48 +02:00
Djamil Legato
16527218b9 Updated changelog 2016-05-17 18:30:26 -07:00
Djamil Legato
f4b7e36763 Fixed Filtering for files, always threat as multiple 2016-05-17 14:20:03 -07:00
Flavio Copes
6bd7641862 Ignore errors with ob_gzhandler.
We handle the possible error in the Problems plugin via
https://github.com/getgrav/grav-plugin-problems/commit/83ef2a2917e5ad2f0
a8d4eb62b16fde3a621e4f0
2016-05-17 09:45:53 +02:00
Philipp Kitzberger
97ffb87d69 Fix absolute URLs in pipelined CSS (#837)
* Fix absolute URLs in pipelined CSS

The way that absolute URLs get excluded during cssRewrite() doesn't cover all possible cases due to a incorrect CSS_URL_REGEX.

* Improve CSS_URL_REGEX

Performance improvement by using a back reference. Additionally this makes sure the same kind of quote (single, double, none) is being used.
2016-05-16 17:57:08 -06:00
Flavio Copes
504f3df857 Update from jQuery 2.2.0 to jQuery 2.2.3 2016-05-16 18:06:15 +02:00
Flavio Copes
cfe1734d50 Fix indentation, use 4 spaces 2016-05-16 11:51:58 +02:00
Flavio Copes
a4bc30d725 Fix #835 check for empty image file first to prevent getimagesize() fatal error 2016-05-16 09:30:57 +02:00
Matias Griese
7d6ffe01a9 Merge remote-tracking branch 'origin/develop' into develop 2016-05-12 21:38:44 +03:00
Matias Griese
0e08f97f46 Make registering page types to remember previous additions 2016-05-12 21:38:35 +03:00
Andy Miller
b3db9876e0 various vendor updates 2016-05-12 12:12:01 -06:00
Matias Griese
b25eeb9586 Add support for extending system page types 2016-05-12 17:40:51 +03:00
Matias Griese
966308b14a Fix Page Type blueprints not being able to extend their parents 2016-05-12 15:43:02 +03:00
Andy Miller
6959012a0f Merge branch 'develop' of https://github.com/getgrav/grav into develop 2016-05-11 15:14:17 -06:00
Andy Miller
09f766bcf5 typo in docblock 2016-05-11 15:13:42 -06:00
Flavio Copes
62f794e6cd Add explicit encoding to htmlspecialchars 2016-05-11 14:29:49 +02:00
Andy Miller
ad74446a89 Don't try to set Page::slug() to empty string causing error in slug format 2016-05-10 11:01:17 -06:00
Flavio Copes
eacdea5377 Only ignore main vendor folder 2016-05-10 15:41:23 +02:00
Flavio Copes
896808c824 Fix trying to delete grav when removing a plugin which has a dependency on a specific grav version 2016-05-10 15:39:27 +02:00
Andy Miller
9a54c3257c version update 2016-05-09 16:04:41 -06:00
Andy Miller
30163aadad Fix for entities not being properly decoded in Page::summary() #825 2016-05-09 10:27:43 -06:00
Flavio Copes
59c320eb17 Also send package name 2016-05-07 10:45:07 +02:00
Flavio Copes
44dbb7f509 Drop Grav from dependencies list, already taken care of 2016-05-07 10:24:20 +02:00
Flavio Copes
a862f18836 If a plugin is installed as symlink, drop from dependencies calculation 2016-05-07 10:23:57 +02:00
Andy Miller
c64c0bc2a0 updated beta version 2016-05-04 16:29:53 -06:00
Andy Miller
c78104d8de added new prepend/append prefixes 2016-05-04 15:53:01 -06:00
Andy Miller
521d7a7ef1 cleanup 2016-05-03 14:10:10 -06:00
Flavio Copes
dd0a2e8ef1 Update changelog 2016-05-03 13:10:20 +02:00
Andy Miller
f3ea342882 Added PUBLISHING translation string 2016-05-02 18:52:17 -06:00
Andy Miller
bddf8751b2 Make cachePageContent() method publicly accessible - #810 2016-05-02 17:37:27 -06:00
Flavio Copes
400b87fb96 Fix when installing multiple packages and one is a dependency of the other
e.g. `bin/gpm install login login-oauth`
2016-05-02 09:37:58 +02:00
Flavio Copes
a9e31f45e2 When a package has a Grav version in its requirements, if fulfilled just go on
Do not try to install it as if it was a plugin
2016-04-30 17:20:40 +02:00
Flavio Copes
a2c60f1eee use slug instead of name to determine the package folder 2016-04-29 20:18:33 +02:00
Flavio Copes
1f030a5654 Update changelog 2016-04-29 19:23:15 +02:00
Flavio Copes
d9a1b1da0f Add the page type to the onBlueprintCreated Event object 2016-04-29 19:19:56 +02:00
Andy Miller
e30d342071 Removed unused use statement 2016-04-28 12:14:55 -06:00
Andy Miller
b935729c1b Fix for broken bin/gpm version command 2016-04-28 12:08:06 -06:00
Andy Miller
1f9c7ea8a2 Boolean should be compared strictly 2016-04-28 11:56:10 -06:00
Andy Miller
7463bad8dd fix for modular page modal #529 2016-04-28 11:46:34 -06:00
Andy Miller
12ca443cb4 Fixed async loading on assets pipeline output 2016-04-28 10:20:35 -06:00
Andy Miller
e4aad9797d version updates 2016-04-27 17:34:55 -06:00
Andy Miller
1f24ab3a96 Merge branch 'feature/non-standard-slugs' into develop
# Conflicts:
#	CHANGELOG.md
2016-04-27 13:44:56 -06:00
Andy Miller
91b29178bd updated CHANGELOG.md 2016-04-27 13:43:24 -06:00
Andy Miller
4573173456 Allow Cyrillic slugs 2016-04-27 13:36:12 -06:00
Flavio Copes
e2453b891d Fix #784 ordering in page collections
Fixes accentuated characters ordering and also uppercase letters being
put first.

Re-done implementation made in
https://github.com/getgrav/grav/commit/fc5302f334fd3f616177b70fd41314980
6a817ed but reverted in
https://github.com/getgrav/grav/commit/894142d2782aca734305c68201a3c1afd
6167ae2 due to extension not checked
2016-04-27 18:47:31 +02:00
Flavio Copes
98fb622bac Make sure there's an end of line after each file added to the pipeline (#806)
Fixes an issue with files ending with a line comment, but no new line.

Also fixes (in a case I found) the already-seen JSMin fatal issue with
"Regex not terminated" error.
2016-04-27 08:17:34 -06:00
Flavio Copes
9129ce25d4 Fix directory separator issue creating cachecompiled and cachetmp folders 2016-04-27 10:18:34 +02:00
Andy Miller
c91ce79dc7 Fix for ksortFilter operating on null 2016-04-26 20:42:01 -06:00
Andy Miller
55f0fc82e8 Reverted change made in cd31d41 that broke saving plugin/theme locations 2016-04-26 16:22:14 -06:00
Andy Miller
c125ff54ba updated composer libs 2016-04-26 16:06:55 -06:00
Andy Miller
a2acb99c79 Added new Plugin::getBlueprint() and Theme::getBlueprint() method 2016-04-26 13:00:17 -06:00
Flavio Copes
d407c89c74 Allow page blueprints in plugins. Also invert order of loading templates, themes load last and have the "final word". Cache everything if cache is enabled (#801) 2016-04-26 11:57:19 +02:00
Flavio Copes
34a408e995 Autoformat code styling 2016-04-23 19:45:24 +02:00
Flavio Copes
894142d278 Revert "Fix #784 ordering in page collections"
This reverts commit fc5302f334.
2016-04-22 19:51:25 +02:00
Flavio Copes
cd31d41b07 Use locator instead of CACHE_DIR 2016-04-22 18:39:10 +02:00
Flavio Copes
ecf51536b9 Revert Add twig/extensions to allow Twig dates translation
Revert
https://github.com/getgrav/grav/commit/810deb41056948896a90a51751dff6e44
f05de95
2016-04-22 18:33:45 +02:00
Flavio Copes
fc5302f334 Fix #784 ordering in page collections
Fixes accentuated characters ordering and also uppercase letters being
put first
2016-04-22 15:22:08 +02:00
Andy Miller
385c076964 fix for issue with absolute_urls: true and link rewriting with assets pipeline 2016-04-21 17:41:14 -06:00
Andy Miller
2abd70467c Set twig.debug to true by default 2016-04-21 14:01:58 -06:00
Andy Miller
c5316aff58 updated CHANGELOG.md 2016-04-21 13:43:12 -06:00
Andy Miller
9bfeb0ce6e Changed to new form data-*@ format in blueprints 2016-04-21 13:42:05 -06:00
Oscar Recio
a56fa4b03a Deleted Whoops aliases (#797)
Deleted Whoops aliases as they are in `Grav\Common\Errors` implemented. In this file are unusued
2016-04-21 10:28:43 +02:00
73 changed files with 1094 additions and 1310 deletions

View File

@@ -7,6 +7,10 @@ git:
url: https://github.com/getgrav/grav-plugin-error
path: user/plugins/error
branch: master
markdown-notices:
url: https://github.com/getgrav/grav-plugin-markdown-notices
path: user/plugins/markdown-notices
branch: master
antimatter:
url: https://github.com/getgrav/grav-theme-antimatter
path: user/themes/antimatter
@@ -20,6 +24,10 @@ links:
src: grav-plugin-error
path: user/plugins/error
scm: github
markdown-notices:
src: grav-plugin-markdown-notices
path: user/plugins/markdown-notices
scm: github
antimatter:
src: grav-theme-antimatter
path: user/themes/antimatter

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
# Composer
.composer
vendor/
/vendor
# Sass
.sass-cache

View File

@@ -1,3 +1,81 @@
# v1.1.0-rc.1
## 06/01/2016
1. [](#new)
* Added `Utils::getDotNotation()` and `Utils::setDotNotation()` methods + tests
* Added support for `xx-XX` locale language lookups in `LanguageCodes` class [#854](https://github.com/getgrav/grav/issues/854)
* New CSS/JS Minify library that does a more reliable job [#864](https://github.com/getgrav/grav/issues/864)
1. [](#improved)
* GPM installation of plugins and themes into correct multisite folders [#841](https://github.com/getgrav/grav/issues/841)
* Use `Page::rawRoute()` in blueprints for more reliable mulit-language support
1. [](#bugfix)
* Fixes for `zlib.output_compression` as well as `mod_deflate` GZIP compression
* Fix for corner-case redirect logic causing infinite loops and out-of-memory errors
* Fix for saving fields in expert mode that have no `Validation::typeX()` methods [#626](https://github.com/getgrav/grav-plugin-admin/issues/626)
* Detect if user really meant to extend parent blueprint, not another one (fixes old page type blueprints)
* Fixed a bug in `Page::relativePagePath()` when `Page::$name` is not defined
* Fix for poor handling of params + query element in `Uri::processParams()` [#859](https://github.com/getgrav/grav/issues/859)
* Fix for double encoding in markdown links [#860](https://github.com/getgrav/grav/issues/860)
* Correctly handle language strings to determine if it's in admin or not [#627](https://github.com/getgrav/grav-plugin-admin/issues/627)
# v1.1.0-beta.5
## 05/23/2016
1. [](#improved)
* Updated jQuery from 2.2.0 to 2.2.3
* Set `Uri::ip()` to static by default so it can be used in form fields
* Improved `Session` class with flash storage
* `Page::getContentMeta()` now supports an optional key.
1. [](#bugfix)
* Fixed "Invalid slug set in YAML frontmatter" when setting `Page::slug()` with empty string [#580](https://github.com/getgrav/grav-plugin-admin/issues/580)
* Only `.gitignore` Grav's vendor folder
* Fix trying to remove Grav with `GPM uninstall` of a plugin with Grav dependency
* Fix Page Type blueprints not being able to extend their parents
* `filterFile` validation method always returns an array of files, behaving like `multiple="multiple"`
* Fixed [#835](https://github.com/getgrav/grav-plugin-admin/issues/835) check for empty image file first to prevent getimagesize() fatal error
* Avoid throwing an error when Grav's Gzip and mod_deflate are enabled at the same time on a non php-fpm setup
# v1.1.0-beta.4
## 05/09/2016
1. [](#bugfix)
* Drop dependencies calculations if plugin is installed via symlink
* Drop Grav from dependencies calculations
* Send slug name as part of installed packages
* Fix for summary entities not being properly decoded [#825](https://github.com/getgrav/grav/issues/825)
# v1.1.0-beta.3
## 05/04/2016
1. [](#improved)
* Pass the Page type when calling `onBlueprintCreated`
* Changed `Page::cachePageContent()` form **private** to **public** so a page can be recached via plugin
1. [](#bugfix)
* Fixed handling of `{'loading':'async'}` with Assets Pipeline
* Fix for new modular page modal `Page` field requiring a value [#529](https://github.com/getgrav/grav-plugin-admin/issues/529)
* Fix for broken `bin/gpm version` command
* Fix handling "grav" as a dependency
* Fix when installing multiple packages and one is the dependency of another, don't try to install it twice
* Fix using name instead of the slug to determine a package folder. Broke for packages whose name was 2+ words
# v1.1.0-beta.2
## 04/27/2016
1. [](#new)
* Added new `Plugin::getBlueprint()` and `Theme::getBlueprint()` method
* Allow **page blueprints** to be added via Plugins.
1. [](#improved)
* Moved to new `data-*@` format in blueprints
* Updated composer-based libraries
* Moved some hard-coded `CACHE_DIR` references to use locator
* Set `twig.debug: true` by default
1. [](#bugfix)
* Fixed issue with link rewrites and local assets pipeline with `absolute_urls: true`
* Allow Cyrillic slugs [#520](https://github.com/getgrav/grav-plugin-admin/issues/520)
* Fix ordering issue with accented letters [#784](https://github.com/getgrav/grav/issues/784)
* Fix issue with Assets pipeline and missing newlines causing invalid JavaScript
# v1.1.0-beta.1
## 04/20/2016

View File

@@ -17,17 +17,16 @@
"symfony/polyfill-iconv": "~1.0",
"doctrine/cache": "~1.5",
"filp/whoops": "~2.0",
"matthiasmullie/minify": "^1.3",
"monolog/monolog": "~1.0",
"gregwar/image": "~2.0",
"mrclay/minify": "~2.2",
"donatj/phpuseragentparser": "~0.3",
"pimple/pimple": "~3.0",
"rockettheme/toolbox": "dev-develop",
"maximebf/debugbar": "~1.10",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-curl": "*",
"twig/extensions": "^1.3"
"ext-curl": "*"
},
"require-dev": {
"codeception/codeception": "^2.1",

447
composer.lock generated
View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ff44cbc35ded0b6491ab74b32f62cd9f",
"content-hash": "5d8b4ff937850c8b1cd333f5855369a6",
"hash": "9c19c674a6ce22978364e1327bab1bbd",
"content-hash": "4b371a1eaef8d32d9ce9536c7c317625",
"packages": [
{
"name": "doctrine/cache",
@@ -366,17 +366,122 @@
"time": "2015-05-30 19:24:37"
},
{
"name": "maximebf/debugbar",
"version": "v1.11.1",
"name": "matthiasmullie/minify",
"version": "1.3.34",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "d9302891c1f0a0ac5a4f66725163a00537c6359f"
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "272e46113404f66ced256659552a0cc074a7810f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/d9302891c1f0a0ac5a4f66725163a00537c6359f",
"reference": "d9302891c1f0a0ac5a4f66725163a00537c6359f",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/272e46113404f66ced256659552a0cc074a7810f",
"reference": "272e46113404f66ced256659552a0cc074a7810f",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"matthiasmullie/path-converter": "~1.0",
"php": ">=5.3.0"
},
"require-dev": {
"matthiasmullie/scrapbook": "~1.0",
"phpunit/phpunit": "~4.8"
},
"bin": [
"bin/minifycss",
"bin/minifyjs"
],
"type": "library",
"autoload": {
"psr-4": {
"MatthiasMullie\\Minify\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matthias Mullie",
"email": "minify@mullie.eu",
"homepage": "http://www.mullie.eu",
"role": "Developer"
}
],
"description": "CSS & JS minifier",
"homepage": "http://www.minifier.org",
"keywords": [
"JS",
"css",
"javascript",
"minifier",
"minify"
],
"time": "2016-03-01 08:00:27"
},
{
"name": "matthiasmullie/path-converter",
"version": "1.0.8",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/path-converter.git",
"reference": "7c36e5cafa95dd20008d19b153b506cffa8c2848"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/7c36e5cafa95dd20008d19b153b506cffa8c2848",
"reference": "7c36e5cafa95dd20008d19b153b506cffa8c2848",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"type": "library",
"autoload": {
"psr-4": {
"MatthiasMullie\\PathConverter\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matthias Mullie",
"email": "pathconverter@mullie.eu",
"homepage": "http://www.mullie.eu",
"role": "Developer"
}
],
"description": "Relative path converter",
"homepage": "http://github.com/matthiasmullie/path-converter",
"keywords": [
"converter",
"path",
"paths",
"relative"
],
"time": "2016-04-27 10:38:05"
},
{
"name": "maximebf/debugbar",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "e634fbd32cd6bc3fa0e8c972b52d4bf49bab3988"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/e634fbd32cd6bc3fa0e8c972b52d4bf49bab3988",
"reference": "e634fbd32cd6bc3fa0e8c972b52d4bf49bab3988",
"shasum": ""
},
"require": {
@@ -395,7 +500,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
},
"autoload": {
@@ -424,7 +529,7 @@
"debug",
"debugbar"
],
"time": "2016-01-22 12:22:23"
"time": "2016-05-15 13:11:34"
},
{
"name": "monolog/monolog",
@@ -504,51 +609,6 @@
],
"time": "2016-04-12 18:29:35"
},
{
"name": "mrclay/minify",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/mrclay/minify.git",
"reference": "f4cb31135d288f951bb0af1f23a03d4c00ba9446"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mrclay/minify/zipball/f4cb31135d288f951bb0af1f23a03d4c00ba9446",
"reference": "f4cb31135d288f951bb0af1f23a03d4c00ba9446",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"php": ">=5.2.1"
},
"require-dev": {
"tubalmartin/cssmin": "~2.4.8"
},
"suggest": {
"tubalmartin/cssmin": "Support minify with CSSMin (YUI PHP port)"
},
"type": "library",
"autoload": {
"classmap": [
"min/lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Stephen Clay",
"email": "steve@mrclay.org",
"role": "Developer"
}
],
"description": "Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers",
"homepage": "http://code.google.com/p/minify/",
"time": "2016-03-08 11:49:57"
},
{
"name": "pimple/pimple",
"version": "v3.0.2",
@@ -639,12 +699,12 @@
"source": {
"type": "git",
"url": "https://github.com/rockettheme/toolbox.git",
"reference": "410e350ea9feb5f0848d1b48f415c998fbe4e901"
"reference": "12d9007979c816038ed7deacf67811c8b864c679"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/410e350ea9feb5f0848d1b48f415c998fbe4e901",
"reference": "410e350ea9feb5f0848d1b48f415c998fbe4e901",
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/12d9007979c816038ed7deacf67811c8b864c679",
"reference": "12d9007979c816038ed7deacf67811c8b864c679",
"shasum": ""
},
"require": {
@@ -679,20 +739,20 @@
"php",
"rockettheme"
],
"time": "2016-04-12 10:43:28"
"time": "2016-05-24 18:58:03"
},
{
"name": "symfony/console",
"version": "v2.8.4",
"version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154"
"reference": "48221d3de4dc22d2cd57c97e8b9361821da86609"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/9a5aef5fc0d4eff86853d44202b02be8d5a20154",
"reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154",
"url": "https://api.github.com/repos/symfony/console/zipball/48221d3de4dc22d2cd57c97e8b9361821da86609",
"reference": "48221d3de4dc22d2cd57c97e8b9361821da86609",
"shasum": ""
},
"require": {
@@ -739,20 +799,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2016-03-17 09:19:04"
"time": "2016-04-26 12:00:47"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.4",
"version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87"
"reference": "a158f13992a3147d466af7a23b564ac719a4ddd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87",
"reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8",
"reference": "a158f13992a3147d466af7a23b564ac719a4ddd8",
"shasum": ""
},
"require": {
@@ -799,20 +859,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2016-03-07 14:04:32"
"time": "2016-05-03 18:59:18"
},
{
"name": "symfony/polyfill-iconv",
"version": "v1.1.1",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git",
"reference": "08e3b8768d785ba7f271ef94906d50f7efe72ce8"
"reference": "b287e8554b1ffd9b5b20b5df940d906930ff4a10"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/08e3b8768d785ba7f271ef94906d50f7efe72ce8",
"reference": "08e3b8768d785ba7f271ef94906d50f7efe72ce8",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/b287e8554b1ffd9b5b20b5df940d906930ff4a10",
"reference": "b287e8554b1ffd9b5b20b5df940d906930ff4a10",
"shasum": ""
},
"require": {
@@ -824,7 +884,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "1.2-dev"
}
},
"autoload": {
@@ -858,20 +918,20 @@
"portable",
"shim"
],
"time": "2016-02-26 11:31:02"
"time": "2016-05-18 14:26:46"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.1.1",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "1289d16209491b584839022f29257ad859b8532d"
"reference": "dff51f72b0706335131b00a7f49606168c582594"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
"reference": "1289d16209491b584839022f29257ad859b8532d",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
"reference": "dff51f72b0706335131b00a7f49606168c582594",
"shasum": ""
},
"require": {
@@ -883,7 +943,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "1.2-dev"
}
},
"autoload": {
@@ -917,20 +977,20 @@
"portable",
"shim"
],
"time": "2016-01-20 09:13:37"
"time": "2016-05-18 14:26:46"
},
{
"name": "symfony/var-dumper",
"version": "v2.8.4",
"version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "1f840df081f59cbe25140742bbe94a0dfac0222a"
"reference": "7528e78e0d7c78650a41fc011ac9f152bdf4c2b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f840df081f59cbe25140742bbe94a0dfac0222a",
"reference": "1f840df081f59cbe25140742bbe94a0dfac0222a",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/7528e78e0d7c78650a41fc011ac9f152bdf4c2b3",
"reference": "7528e78e0d7c78650a41fc011ac9f152bdf4c2b3",
"shasum": ""
},
"require": {
@@ -980,20 +1040,20 @@
"debug",
"dump"
],
"time": "2016-03-07 14:04:32"
"time": "2016-04-25 11:17:03"
},
{
"name": "symfony/yaml",
"version": "v2.8.4",
"version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "584e52cb8f788a887553ba82db6caacb1d6260bb"
"reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb",
"reference": "584e52cb8f788a887553ba82db6caacb1d6260bb",
"url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
"reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940",
"shasum": ""
},
"require": {
@@ -1029,72 +1089,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-03-04 07:54:35"
},
{
"name": "twig/extensions",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig-extensions.git",
"reference": "449e3c8a9ffad7c2479c7864557275a32b037499"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/449e3c8a9ffad7c2479c7864557275a32b037499",
"reference": "449e3c8a9ffad7c2479c7864557275a32b037499",
"shasum": ""
},
"require": {
"twig/twig": "~1.20|~2.0"
},
"require-dev": {
"symfony/translation": "~2.3"
},
"suggest": {
"symfony/translation": "Allow the time_diff output to be translated"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-0": {
"Twig_Extensions_": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Common additional features for Twig that do not directly belong in core",
"homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
"keywords": [
"i18n",
"text"
],
"time": "2015-08-22 16:38:35"
"time": "2016-03-29 19:00:15"
},
{
"name": "twig/twig",
"version": "v1.24.0",
"version": "v1.24.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8"
"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
"reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512",
"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512",
"shasum": ""
},
"require": {
@@ -1142,22 +1150,22 @@
"keywords": [
"templating"
],
"time": "2016-01-25 21:22:18"
"time": "2016-05-30 09:11:59"
}
],
"packages-dev": [
{
"name": "codeception/codeception",
"version": "2.1.8",
"version": "2.1.9",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
"reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79"
"reference": "8a24ed556b8d6a9d795d052e9074e8483cb7c15f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/f3daa61f0f11c531b33eb3623ab0daa599d88a79",
"reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/8a24ed556b8d6a9d795d052e9074e8483cb7c15f",
"reference": "8a24ed556b8d6a9d795d052e9074e8483cb7c15f",
"shasum": ""
},
"require": {
@@ -1169,13 +1177,13 @@
"php": ">=5.4.0 <8.0",
"phpunit/php-code-coverage": ">=2.1.3",
"phpunit/phpunit": ">4.8.20 <6.0",
"symfony/browser-kit": ">=2.5 <3.1",
"symfony/console": ">=2.5 <3.1",
"symfony/css-selector": ">=2.5 <3.1",
"symfony/dom-crawler": ">=2.5 <3.1",
"symfony/event-dispatcher": ">=2.5 <3.1",
"symfony/finder": ">=2.5 <3.1",
"symfony/yaml": ">=2.5 <3.1"
"symfony/browser-kit": ">=2.5 <3.2",
"symfony/console": ">=2.5 <3.2",
"symfony/css-selector": ">=2.5 <3.2",
"symfony/dom-crawler": ">=2.5 <3.2",
"symfony/event-dispatcher": ">=2.5 <3.2",
"symfony/finder": ">=2.5 <3.2",
"symfony/yaml": ">=2.5 <3.2"
},
"require-dev": {
"codeception/specify": "~0.3",
@@ -1183,14 +1191,16 @@
"flow/jsonpath": "~0.2",
"monolog/monolog": "~1.8",
"pda/pheanstalk": "~2.0",
"php-amqplib/php-amqplib": "~2.4"
"php-amqplib/php-amqplib": "~2.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
"codeception/phpbuiltinserver": "Extension to start and stop PHP built-in web server for your tests",
"codeception/specify": "BDD-style code blocks",
"codeception/verify": "BDD-style assertions",
"monolog/monolog": "Log test steps",
"phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module."
"phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module.",
"symfony/phpunit-bridge": "For phpunit-bridge support"
},
"bin": [
"codecept"
@@ -1225,7 +1235,7 @@
"functional testing",
"unit testing"
],
"time": "2016-04-15 02:56:43"
"time": "2016-05-30 23:06:07"
},
{
"name": "doctrine/instantiator",
@@ -1326,33 +1336,29 @@
},
{
"name": "fzaninotto/faker",
"version": "v1.5.0",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/fzaninotto/Faker.git",
"reference": "d0190b156bcca848d401fb80f31f504f37141c8d"
"reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d0190b156bcca848d401fb80f31f504f37141c8d",
"reference": "d0190b156bcca848d401fb80f31f504f37141c8d",
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123",
"reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": "^5.3.3|^7.0"
},
"require-dev": {
"ext-intl": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~1.5"
},
"suggest": {
"ext-intl": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
"branch-alias": []
},
"autoload": {
"psr-4": {
@@ -1374,7 +1380,7 @@
"faker",
"fixtures"
],
"time": "2015-05-29 06:29:14"
"time": "2016-04-29 12:21:54"
},
{
"name": "guzzlehttp/guzzle",
@@ -1440,16 +1446,16 @@
},
{
"name": "guzzlehttp/promises",
"version": "1.1.0",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8"
"reference": "c10d860e2a9595f8883527fa0021c7da9e65f579"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8",
"reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8",
"url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579",
"reference": "c10d860e2a9595f8883527fa0021c7da9e65f579",
"shasum": ""
},
"require": {
@@ -1487,7 +1493,7 @@
"keywords": [
"promise"
],
"time": "2016-03-08 01:15:46"
"time": "2016-05-18 16:56:05"
},
{
"name": "guzzlehttp/psr7",
@@ -1810,21 +1816,24 @@
},
{
"name": "phpunit/php-timer",
"version": "1.0.7",
"version": "1.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4|~5"
},
"type": "library",
"autoload": {
"classmap": [
@@ -1847,7 +1856,7 @@
"keywords": [
"timer"
],
"time": "2015-06-21 08:01:12"
"time": "2016-05-12 18:03:57"
},
{
"name": "phpunit/php-token-stream",
@@ -1900,16 +1909,16 @@
},
{
"name": "phpunit/phpunit",
"version": "4.8.24",
"version": "4.8.26",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "a1066c562c52900a142a0e2bbf0582994671385e"
"reference": "fc1d8cd5b5de11625979125c5639347896ac2c74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e",
"reference": "a1066c562c52900a142a0e2bbf0582994671385e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74",
"reference": "fc1d8cd5b5de11625979125c5639347896ac2c74",
"shasum": ""
},
"require": {
@@ -1923,7 +1932,7 @@
"phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": ">=1.0.6",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1",
"sebastian/diff": "~1.2",
@@ -1968,7 +1977,7 @@
"testing",
"xunit"
],
"time": "2016-03-14 06:16:08"
"time": "2016-05-17 03:09:28"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -2193,16 +2202,16 @@
},
{
"name": "sebastian/environment",
"version": "1.3.5",
"version": "1.3.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
"shasum": ""
},
"require": {
@@ -2239,7 +2248,7 @@
"environment",
"hhvm"
],
"time": "2016-02-26 18:40:46"
"time": "2016-05-17 03:18:57"
},
{
"name": "sebastian/exporter",
@@ -2448,16 +2457,16 @@
},
{
"name": "symfony/browser-kit",
"version": "v3.0.4",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
"reference": "e07127ac31230b30887c2dddf3708d883d239b14"
"reference": "b645a9b23d6c0eeba5ac823fa87bf010db9aff22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07127ac31230b30887c2dddf3708d883d239b14",
"reference": "e07127ac31230b30887c2dddf3708d883d239b14",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/b645a9b23d6c0eeba5ac823fa87bf010db9aff22",
"reference": "b645a9b23d6c0eeba5ac823fa87bf010db9aff22",
"shasum": ""
},
"require": {
@@ -2474,7 +2483,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
@@ -2501,20 +2510,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
"time": "2016-03-04 07:55:57"
"time": "2016-03-04 07:56:56"
},
{
"name": "symfony/css-selector",
"version": "v3.0.4",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0"
"reference": "e17f386efef7258ac671c24e727673abd086b0cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0",
"reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/e17f386efef7258ac671c24e727673abd086b0cf",
"reference": "e17f386efef7258ac671c24e727673abd086b0cf",
"shasum": ""
},
"require": {
@@ -2523,7 +2532,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
@@ -2554,20 +2563,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2016-03-04 07:55:57"
"time": "2016-03-04 07:56:56"
},
{
"name": "symfony/dom-crawler",
"version": "v3.0.4",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f"
"reference": "12aa63fd41b060d2bee9a34623d29eda70bc8fe3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/18a06d7a9af41718c20764a674a0ebba3bc40d1f",
"reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/12aa63fd41b060d2bee9a34623d29eda70bc8fe3",
"reference": "12aa63fd41b060d2bee9a34623d29eda70bc8fe3",
"shasum": ""
},
"require": {
@@ -2583,7 +2592,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
@@ -2610,20 +2619,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2016-03-23 13:23:25"
"time": "2016-05-13 15:49:09"
},
{
"name": "symfony/finder",
"version": "v3.0.4",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "c54e407b35bc098916704e9fd090da21da4c4f52"
"reference": "40d17ed287bf51a2f884c4619ce8ff2a1c5cd219"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52",
"reference": "c54e407b35bc098916704e9fd090da21da4c4f52",
"url": "https://api.github.com/repos/symfony/finder/zipball/40d17ed287bf51a2f884c4619ce8ff2a1c5cd219",
"reference": "40d17ed287bf51a2f884c4619ce8ff2a1c5cd219",
"shasum": ""
},
"require": {
@@ -2632,7 +2641,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
@@ -2659,7 +2668,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2016-03-10 11:13:05"
"time": "2016-05-13 18:06:41"
}
],
"aliases": [

File diff suppressed because one or more lines are too long

View File

@@ -59,6 +59,7 @@ form:
summary.size:
type: text
size: x-small
append: PLUGIN_ADMIN.CHARACTERS
label: PLUGIN_ADMIN.SUMMARY_SIZE
help: PLUGIN_ADMIN.SUMMARY_SIZE_HELP
validate:

View File

@@ -56,7 +56,7 @@ form:
size: medium
classes: fancy
help: PLUGIN_ADMIN.TIMEZONE_HELP
'@data-options': '\Grav\Common\Utils::timezones'
data-options@: '\Grav\Common\Utils::timezones'
default: ''
options:
'': 'Default (Server Timezone)'
@@ -69,7 +69,7 @@ form:
label: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT
help: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT_HELP
placeholder: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT_PLACEHOLDER
'@data-options': '\Grav\Common\Utils::dateFormats'
data-options@: '\Grav\Common\Utils::dateFormats'
validate:
type: string
@@ -125,6 +125,7 @@ form:
pages.list.count:
type: text
size: x-small
append: PLUGIN_ADMIN.PAGES
label: PLUGIN_ADMIN.DEFAULT_PAGE_COUNT
help: PLUGIN_ADMIN.DEFAULT_PAGE_COUNT_HELP
validate:
@@ -356,6 +357,7 @@ form:
pages.expires:
type: text
size: small
append: NICETIME.SECOND_PLURAL
label: PLUGIN_ADMIN.EXPIRES
help: PLUGIN_ADMIN.EXPIRES_HELP
validate:
@@ -491,6 +493,7 @@ form:
cache.lifetime:
type: text
size: small
append: NICETIME.SECOND_PLURAL
label: PLUGIN_ADMIN.LIFETIME
help: PLUGIN_ADMIN.LIFETIME_HELP
validate:
@@ -529,7 +532,7 @@ form:
type: toggle
label: PLUGIN_ADMIN.TWIG_DEBUG
help: PLUGIN_ADMIN.TWIG_DEBUG_HELP
highlight: 0
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
@@ -766,6 +769,7 @@ form:
fields:
images.default_image_quality:
type: text
append: '%'
label: PLUGIN_ADMIN.DEFAULT_IMAGE_QUALITY
help: PLUGIN_ADMIN.DEFAULT_IMAGE_QUALITY_HELP
classes: x-small
@@ -809,6 +813,7 @@ form:
media.upload_limit:
type: text
append: bytes
label: PLUGIN_ADMIN.UPLOAD_LIMIT
help: PLUGIN_ADMIN.UPLOAD_LIMIT_HELP
classes: small
@@ -867,6 +872,7 @@ form:
session.timeout:
type: text
size: small
append: NICETIME.SECOND_PLURAL
label: PLUGIN_ADMIN.TIMEOUT
help: PLUGIN_ADMIN.TIMEOUT_HELP
validate:

View File

@@ -5,4 +5,4 @@ form:
type: select
label: PLUGIN_ADMIN.PAGE
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
data-options@: '\Grav\Common\Page\Pages::parents'

View File

@@ -2,7 +2,7 @@ title: PLUGIN_ADMIN.DEFAULT
rules:
slug:
pattern: "[a-z][a-z0-9_\-]+"
pattern: "[a-zа][a-zа0-9_\-]+"
min: 2
max: 80
@@ -44,7 +44,7 @@ form:
publishing:
type: section
title: Publishing
title: PLUGIN_ADMIN.PUBLISHING
underline: true
fields:
@@ -138,8 +138,8 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parentsRawRoutes'
'@data-default': '\Grav\Plugin\admin::route'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::rawRoute'
options:
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
@@ -149,7 +149,7 @@ form:
label: PLUGIN_ADMIN.PAGE_FILE
help: PLUGIN_ADMIN.PAGE_FILE_HELP
default: default
'@data-options': '\Grav\Common\Page\Pages::pageTypes'
data-options@: '\Grav\Common\Page\Pages::pageTypes'
header.body_classes:
type: text
@@ -186,7 +186,7 @@ form:
label: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT
help: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT_HELP
placeholder: PLUGIN_ADMIN.DEFAULT_DATE_FORMAT_PLACEHOLDER
'@data-options': '\Grav\Common\Utils::dateFormats'
data-options@: '\Grav\Common\Utils::dateFormats'
validate:
type: string
@@ -215,7 +215,7 @@ form:
type: checkboxes
label: PLUGIN_ADMIN.PROCESS
toggleable: true
'@config-default': system.pages.process
config-default@: system.pages.process
default:
markdown: true
twig: false
@@ -230,7 +230,7 @@ form:
label: PLUGIN_ADMIN.DEFAULT_CHILD_TYPE
default: default
placeholder: PLUGIN_ADMIN.USE_GLOBAL
'@data-options': '\Grav\Common\Page\Pages::types'
data-options@: '\Grav\Common\Page\Pages::types'
header.routable:
type: toggle

View File

@@ -18,7 +18,7 @@ form:
label: PLUGIN_ADMIN.ITEMS
default: '@self.modular'
options:
'@self.modular': Children
'@self.modular': Modular Children
header.content.order.by:
type: select

View File

@@ -29,10 +29,8 @@ form:
type: select
label: PLUGIN_ADMIN.PAGE
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::route'
options:
'': PLUGIN_ADMIN.DEFAULT_OPTION_SELECT
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::rawRoute'
validate:
required: true
@@ -42,7 +40,7 @@ form:
label: PLUGIN_ADMIN.MODULAR_TEMPLATE
help: PLUGIN_ADMIN.PAGE_FILE_HELP
default: default
'@data-options': '\Grav\Common\Page\Pages::modularTypes'
data-options@: '\Grav\Common\Page\Pages::modularTypes'
validate:
required: true

View File

@@ -78,8 +78,8 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::route'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::rawRoute'
options:
'': PLUGIN_ADMIN.DEFAULT_OPTION_SELECT
validate:
@@ -90,7 +90,7 @@ form:
classes: fancy
label: PLUGIN_ADMIN.MODULAR_TEMPLATE
default: default
'@data-options': '\Grav\Common\Page\Pages::modularTypes'
data-options@: '\Grav\Common\Page\Pages::modularTypes'
validate:
required: true

View File

@@ -11,7 +11,7 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::route'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::rawRoute'
options:
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT

View File

@@ -31,8 +31,8 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT_PAGE
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::getLastPageRoute'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::getLastPageRoute'
options:
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
validate:
@@ -43,8 +43,8 @@ form:
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::getLastPageName'
data-options@: '\Grav\Common\Page\Pages::types'
data-default@: '\Grav\Plugin\admin::getLastPageName'
validate:
required: true

View File

@@ -24,8 +24,8 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT_PAGE
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::getLastPageRoute'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::getLastPageRoute'
options:
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
validate:

View File

@@ -78,8 +78,8 @@ form:
type: select
label: PLUGIN_ADMIN.PARENT
classes: fancy
'@data-options': '\Grav\Common\Page\Pages::parents'
'@data-default': '\Grav\Plugin\admin::route'
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
data-default@: '\Grav\Plugin\admin::rawRoute'
options:
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
@@ -89,7 +89,7 @@ form:
label: PLUGIN_ADMIN.DISPLAY_TEMPLATE
help: PLUGIN_ADMIN.DISPLAY_TEMPLATE_HELP
default: default
'@data-options': '\Grav\Common\Page\Pages::types'
data-options@: '\Grav\Common\Page\Pages::types'
validate:
required: true

View File

@@ -56,7 +56,7 @@ form:
label: PLUGIN_ADMIN.LANGUAGE
size: medium
classes: fancy
'@data-options': '\Grav\Plugin\admin::adminLanguages'
data-options@: '\Grav\Plugin\admin::adminLanguages'
default: 'en'
help: PLUGIN_ADMIN.LANGUAGE_HELP
@@ -71,7 +71,7 @@ form:
type: selectize
size: large
label: PLUGIN_ADMIN.GROUPS
'@data-options': '\Grav\User\Groups::groups'
data-options@: '\Grav\User\Groups::groups'
classes: fancy
help: PLUGIN_ADMIN.GROUPS_HELP
validate:

View File

@@ -74,7 +74,7 @@ cache:
twig:
cache: true # Set to true to enable twig caching
debug: false # Enable Twig debug
debug: true # Enable Twig debug
auto_reload: true # Refresh cache on changes
autoescape: false # Autoescape Twig vars
undefined_functions: true # Allow undefined functions

View File

@@ -2,7 +2,7 @@
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.1.0-beta.1');
define('GRAV_VERSION', '1.1.0-rc.1');
define('GRAV_TESTING', true);
define('DS', '/');
define('GRAV_PHP_MIN', '5.5.9');

View File

@@ -5,7 +5,6 @@ use Closure;
use Exception;
use FilesystemIterator;
use Grav\Common\Config\Config;
use Grav\Common\Grav;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use RegexIterator;
@@ -34,7 +33,7 @@ class Assets
const JS_REGEX = '/.\.js$/i';
/** @const Regex to match CSS urls */
const CSS_URL_REGEX = '{url\([\'\"]?((?!http|//).*?)[\'\"]?\)}';
const CSS_URL_REGEX = '{url\(([\'\"]?)(.*?)\1\)}';
/** @const Regex to match CSS sourcemap comments */
const CSS_SOURCEMAP_REGEX = '{\/\*# (.*) \*\/}';
@@ -730,8 +729,9 @@ class Assets
// Concatenate files
$buffer = $this->gatherLinks($temp_css, CSS_ASSET);
if ($css_minify) {
$min = new \CSSmin();
$buffer = $min->run($buffer);
$minifier = new \MatthiasMullie\Minify\CSS();
$minifier->add($buffer);
$buffer = $minifier->minify();
}
// Write file
@@ -804,7 +804,9 @@ class Assets
// Concatenate files
$buffer = $this->gatherLinks($temp_js, JS_ASSET);
if ($this->js_minify) {
$buffer = \JSMin::minify($buffer);
$minifier = new \MatthiasMullie\Minify\JS();
$minifier->add($buffer);
$buffer = $minifier->minify();
}
// Write file
@@ -1004,6 +1006,13 @@ class Assets
*/
protected function isRemoteLink($link)
{
$base = Grav::instance()['uri']->rootUrl(true);
// sanity check for local URLs with absolute URL's enabled
if (Utils::startsWith($link, $base)) {
return false;
}
return ('http://' === substr($link, 0, 7) || 'https://' === substr($link, 0, 8) || '//' === substr($link, 0,
2));
}
@@ -1035,6 +1044,7 @@ class Assets
protected function attributes(array $attributes)
{
$html = '';
$no_key = ['loading'];
foreach ($attributes as $key => $value) {
// For numeric keys we will assume that the key and the value are the same
@@ -1047,7 +1057,12 @@ class Assets
$value = implode(' ', $value);
}
$element = $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '"';
if (in_array($key, $no_key)) {
$element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
} else {
$element = $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '"';
}
$html .= ' ' . $element;
}
@@ -1107,6 +1122,7 @@ class Assets
$file = $this->cssRewrite($file, $relative_dir);
}
$file = rtrim($file) . PHP_EOL;
$buffer .= $file;
}
@@ -1135,13 +1151,18 @@ class Assets
// Then replace the old url with the new one
$file = preg_replace_callback(self::CSS_URL_REGEX, function ($matches) use ($relative_path) {
$old_url = $matches[1];
$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)) {
return $matches[0];
}
$new_url = $this->base_url . ltrim(Utils::normalizePath($relative_path . '/' . $old_url), '/');
return str_replace($old_url, $new_url, $matches[0]);

View File

@@ -23,6 +23,21 @@ class Blueprint extends BlueprintForm
*/
protected $blueprintSchema;
/**
* Set default values for field types.
*
* @param array $types
* @return $this
*/
public function setTypes(array $types)
{
$this->initInternals();
$this->blueprintSchema->setTypes($types);
return $this;
}
/**
* Get nested structure containing default values defined in the blueprints.
*
@@ -130,35 +145,41 @@ class Blueprint extends BlueprintForm
*/
protected function getFiles($path, $context = null)
{
if (is_string($path) && !strpos($path, '://')) {
// Resolve filename.
if (isset($this->overrides[$path])) {
$path = $this->overrides[$path];
} else {
if ($context === null) {
$context = $this->context;
}
if ($context && $context[strlen($context)-1] !== '/') {
$context .= '/';
}
$path = $context . $path;
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
if (!preg_match('/\.yaml$/', $path)) {
$path .= '.yaml';
}
if (is_string($path) && !$locator->isStream($path)) {
// Find path overrides.
$paths = isset($this->overrides[$path]) ? (array) $this->overrides[$path] : [];
// Add path pointing to default context.
if ($context === null) {
$context = $this->context;
}
if ($context && $context[strlen($context)-1] !== '/') {
$context .= '/';
}
$path = $context . $path;
if (!preg_match('/\.yaml$/', $path)) {
$path .= '.yaml';
}
$paths[] = $path;
} else {
$paths = (array) $path;
}
$files = [];
foreach ($paths as $lookup) {
if (is_string($lookup) && strpos($lookup, '://')) {
$files = array_merge($files, $locator->findResources($lookup));
} else {
$files[] = $lookup;
}
}
if (is_string($path) && strpos($path, '://')) {
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
$files = $locator->findResources($path);
} else {
$files = (array) $path;
}
return $files;
return array_values(array_unique($files));
}
/**

View File

@@ -87,7 +87,9 @@ class Blueprints
$blueprint = new Blueprint($name);
if (is_array($this->search) || is_object($this->search)) {
// Page types.
$blueprint->setOverrides($this->search);
$blueprint->setContext('blueprints://pages');
} else {
$blueprint->setContext($this->search);
}

View File

@@ -49,16 +49,16 @@ class Validation
$type = (string) isset($field['validate']['type']) ? $field['validate']['type'] : $field['type'];
$method = 'type'.strtr($type, '-', '_');
if (!method_exists(__CLASS__, $method)) {
$method = 'typeText';
}
$name = ucfirst(isset($field['label']) ? $field['label'] : $field['name']);
$message = (string) isset($field['validate']['message'])
? $language->translate($field['validate']['message'])
: $language->translate('FORM.INVALID_INPUT', null, true) . ' "' . $language->translate($name) . '"';
$success = self::$method($value, $validate, $field);
if (method_exists(__CLASS__, $method)) {
$success = self::$method($value, $validate, $field);
} else {
$success = true;
}
if (!$success) {
$messages[$field['name']][] = $message;
@@ -301,15 +301,7 @@ class Validation
protected static function filterFile($value, array $params, array $field)
{
if (isset($field['multiple']) && $field['multiple'] === true) {
return (array) $value;
}
if (is_array($value)) {
return reset($value);
}
return $value;
return (array) $value;
}
/**
@@ -333,7 +325,6 @@ class Validation
* @param array $field Blueprint for the field.
* @return bool True if validation succeeded.
*/
public static function typeNumber($value, array $params, array $field)
{
if (!is_numeric($value)) {

View File

@@ -28,7 +28,8 @@ trait CompiledFile
// If nothing has been loaded, attempt to get pre-compiled version of the file first.
if ($var === null && $this->raw === null && $this->content === null) {
$key = md5($this->filename);
$file = PhpFile::instance(CACHE_DIR . "compiled/files/{$key}{$this->extension}.php");
$file = PhpFile::instance(CACHE_DIR . DS . "compiled/files/{$key}{$this->extension}.php");
$modified = $this->modified();
if (!$modified) {

View File

@@ -115,6 +115,11 @@ class GPM extends Iterator
return isset($this->installed['plugins'][$slug]);
}
public function isPluginInstalledAsSymlink($slug)
{
return $this->installed['plugins'][$slug]->symlink;
}
/**
* Return the instance of a specific Theme
* @param string $slug The slug of the Theme
@@ -204,6 +209,7 @@ class GPM extends Iterator
if (version_compare($local_version, $remote_version) < 0) {
$repository[$slug]->available = $remote_version;
$repository[$slug]->version = $local_version;
$repository[$slug]->name = $repository[$slug]->name;
$repository[$slug]->type = $repository[$slug]->release_type;
$items[$slug] = $repository[$slug];
}
@@ -620,15 +626,28 @@ class GPM extends Iterator
public function getDependencies($packages) {
$dependencies = $this->calculateMergedDependenciesOfPackages($packages);
foreach ($dependencies as $dependency_slug => $dependencyVersionWithOperator) {
if (in_array($dependency_slug, $packages)) {
unset($dependencies[$dependency_slug]);
continue;
}
//First, check for Grav dependency. If a dependency requires Grav > the current version, abort and tell.
if ($dependency_slug == 'grav') {
if (version_compare($this->calculateVersionNumberFromDependencyVersion($dependencyVersionWithOperator), GRAV_VERSION) === 1) {
//Needs a Grav update first
throw new \Exception("<red>One of the packages require Grav " . $dependencies['grav'] . ". Please update Grav to the latest release.");
} else {
unset($dependencies[$dependency_slug]);
continue;
}
}
if ($this->isPluginInstalled($dependency_slug)) {
if ($this->isPluginInstalledAsSymlink($dependency_slug)) {
unset($dependencies[$dependency_slug]);
continue;
}
$dependencyVersion = $this->calculateVersionNumberFromDependencyVersion($dependencyVersionWithOperator);
// get currently installed version

View File

@@ -2,6 +2,7 @@
namespace Grav\Common\GPM;
use Grav\Common\Filesystem\Folder;
use Grav\Common\Grav;
class Installer
{
@@ -80,7 +81,8 @@ class Installer
$zip = new \ZipArchive();
$archive = $zip->open($package);
$tmp = CACHE_DIR . 'tmp/Grav-' . uniqid();
$cache_dir = Grav::instance()['locator']->findResource('cache://', true);
$tmp = $cache_dir . DS . 'tmp/Grav-' . uniqid();
if ($archive !== true) {
self::$error = self::ZIP_OPEN_ERROR;
@@ -106,7 +108,7 @@ class Installer
$is_install = true;
$installer = self::loadInstaller($installer_file_folder, $is_install);
if (isset($options['is_update']) && $options['is_update'] == true) {
if (isset($options['is_update']) && $options['is_update'] === true) {
$method = 'preUpdate';
} else {
$method = 'preInstall';
@@ -137,7 +139,7 @@ class Installer
Folder::delete($tmp);
$zip->close();
if (isset($options['is_update']) && $options['is_update'] == true) {
if (isset($options['is_update']) && $options['is_update'] === true) {
$method = 'postUpdate';
} else {
$method = 'postInstall';

View File

@@ -19,7 +19,7 @@ class Package extends BasePackage
$this->data->set('slug', $package->slug);
$this->data->set('description_html', $html_description);
$this->data->set('description_plain', strip_tags($html_description));
$this->data->set('symlink', is_link(USER_DIR . $package_type . DS . $this->name));
$this->data->set('symlink', is_link(USER_DIR . $package_type . DS . $this->slug));
}
/**

View File

@@ -50,6 +50,11 @@ class AbstractPackageCollection extends BaseCollection
$this->fetch($refresh, $callback);
foreach (json_decode($this->raw, true) as $slug => $data) {
// Temporarily fix for using multisites
if (isset($data['install_path'])) {
$path = preg_replace('~^user/~i', 'user://', $data['install_path']);
$data['install_path'] = Grav::instance()['locator']->findResource($path, false, true);
}
$this->items[$slug] = new Package($data, $this->type);
}
}

View File

@@ -27,54 +27,54 @@ class Grav extends Container
protected static $diMap = [
'Grav\Common\Service\LoggerServiceProvider',
'Grav\Common\Service\ErrorServiceProvider',
'uri' => 'Grav\Common\Uri',
'events' => 'RocketTheme\Toolbox\Event\EventDispatcher',
'cache' => 'Grav\Common\Cache',
'session' => 'Grav\Common\Session',
'plugins' => 'Grav\Common\Plugins',
'themes' => 'Grav\Common\Themes',
'twig' => 'Grav\Common\Twig\Twig',
'taxonomy' => 'Grav\Common\Taxonomy',
'language' => 'Grav\Common\Language\Language',
'pages' => 'Grav\Common\Page\Pages',
'uri' => 'Grav\Common\Uri',
'events' => 'RocketTheme\Toolbox\Event\EventDispatcher',
'cache' => 'Grav\Common\Cache',
'session' => 'Grav\Common\Session',
'plugins' => 'Grav\Common\Plugins',
'themes' => 'Grav\Common\Themes',
'twig' => 'Grav\Common\Twig\Twig',
'taxonomy' => 'Grav\Common\Taxonomy',
'language' => 'Grav\Common\Language\Language',
'pages' => 'Grav\Common\Page\Pages',
'Grav\Common\Service\TaskServiceProvider',
'Grav\Common\Service\AssetsServiceProvider',
'Grav\Common\Service\PageServiceProvider',
'Grav\Common\Service\OutputServiceProvider',
'browser' => 'Grav\Common\Browser',
'browser' => 'Grav\Common\Browser',
'Grav\Common\Service\StreamsServiceProvider',
'Grav\Common\Service\ConfigServiceProvider',
'inflector' => 'Grav\Common\Inflector',
'siteSetupProcessor' => 'Grav\Common\Processors\SiteSetupProcessor',
'configurationProcessor' => 'Grav\Common\Processors\ConfigurationProcessor',
'errorsProcessor' => 'Grav\Common\Processors\ErrorsProcessor',
'debuggerInitProcessor' => 'Grav\Common\Processors\DebuggerInitProcessor',
'initializeProcessor' => 'Grav\Common\Processors\InitializeProcessor',
'pluginsProcessor' => 'Grav\Common\Processors\PluginsProcessor',
'themesProcessor' => 'Grav\Common\Processors\ThemesProcessor',
'tasksProcessor' => 'Grav\Common\Processors\TasksProcessor',
'assetsProcessor' => 'Grav\Common\Processors\AssetsProcessor',
'twigProcessor' => 'Grav\Common\Processors\TwigProcessor',
'pagesProcessor' => 'Grav\Common\Processors\PagesProcessor',
'inflector' => 'Grav\Common\Inflector',
'siteSetupProcessor' => 'Grav\Common\Processors\SiteSetupProcessor',
'configurationProcessor' => 'Grav\Common\Processors\ConfigurationProcessor',
'errorsProcessor' => 'Grav\Common\Processors\ErrorsProcessor',
'debuggerInitProcessor' => 'Grav\Common\Processors\DebuggerInitProcessor',
'initializeProcessor' => 'Grav\Common\Processors\InitializeProcessor',
'pluginsProcessor' => 'Grav\Common\Processors\PluginsProcessor',
'themesProcessor' => 'Grav\Common\Processors\ThemesProcessor',
'tasksProcessor' => 'Grav\Common\Processors\TasksProcessor',
'assetsProcessor' => 'Grav\Common\Processors\AssetsProcessor',
'twigProcessor' => 'Grav\Common\Processors\TwigProcessor',
'pagesProcessor' => 'Grav\Common\Processors\PagesProcessor',
'debuggerAssetsProcessor' => 'Grav\Common\Processors\DebuggerAssetsProcessor',
'renderProcessor' => 'Grav\Common\Processors\RenderProcessor',
'renderProcessor' => 'Grav\Common\Processors\RenderProcessor',
];
/** @var array All processors that are processed in $this->process() */
protected $processors = [
'siteSetupProcessor',
'configurationProcessor',
'errorsProcessor',
'debuggerInitProcessor',
'initializeProcessor',
'pluginsProcessor',
'themesProcessor',
'tasksProcessor',
'assetsProcessor',
'twigProcessor',
'pagesProcessor',
'debuggerAssetsProcessor',
'renderProcessor',
'siteSetupProcessor',
'configurationProcessor',
'errorsProcessor',
'debuggerInitProcessor',
'initializeProcessor',
'pluginsProcessor',
'themesProcessor',
'tasksProcessor',
'assetsProcessor',
'twigProcessor',
'pagesProcessor',
'debuggerAssetsProcessor',
'renderProcessor',
];
/**
@@ -118,14 +118,15 @@ class Grav extends Container
// process all processors (e.g. config, initialize, assets, ..., render)
foreach ($this->processors as $processor) {
$processor = $this[$processor];
$this->measureTime($processor->id, $processor->title, function() use ($processor) {
$processor->process();
});
$processor = $this[$processor];
$this->measureTime($processor->id, $processor->title, function () use ($processor) {
$processor->process();
});
}
// Set the header type
$this->header();
echo $this->output;
$debugger->render();
@@ -142,7 +143,7 @@ class Grav extends Container
// Initialize Locale if set and configured.
if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
$language = $this['language']->getLanguage();
setlocale(LC_ALL, count($language < 3) ? ($language . '_' . strtoupper($language)) : $language );
setlocale(LC_ALL, count($language < 3) ? ($language . '_' . strtoupper($language)) : $language);
} elseif ($this['config']->get('system.default_locale')) {
setlocale(LC_ALL, $this['config']->get('system.default_locale'));
}
@@ -322,9 +323,8 @@ class Grav extends Container
$success = function_exists('fastcgi_finish_request') ? @fastcgi_finish_request() : false;
if (!$success) {
// Unfortunately without FastCGI there is no way to close the connection. We need to ask browser to
// close the connection for us.
// Unfortunately without FastCGI there is no way to force close the connection.
// We need to ask browser to close the connection for us.
if ($this['config']->get('system.cache.gzip')) {
// Flush gzhandler buffer if gzip setting was enabled.
ob_end_flush();
@@ -335,11 +335,11 @@ class Grav extends Container
header('Content-Encoding: none');
}
// Get length and close the connection.
header('Content-Length: ' . ob_get_length());
header("Connection: close");
// Finally flush the regular buffer.
ob_end_flush();
@ob_flush();
flush();
@@ -380,14 +380,14 @@ class Grav extends Container
// closure that measures time by wrapping a function into startTimer and stopTimer
// The debugger can be passed to the closure. Should be more performant
// then to get it from the container all time.
$container->measureTime = function($timerId, $timerTitle, $callback) use ($debugger) {
$debugger->startTimer($timerId, $timerTitle);
$callback();
$debugger->stopTimer($timerId);
$container->measureTime = function ($timerId, $timerTitle, $callback) use ($debugger) {
$debugger->startTimer($timerId, $timerTitle);
$callback();
$debugger->stopTimer($timerId);
};
$container->measureTime('_services', 'Services', function() use ($container) {
$container->registerServices($container);
$container->measureTime('_services', 'Services', function () use ($container) {
$container->registerServices($container);
});
return $container;
@@ -401,39 +401,42 @@ class Grav extends Container
*
* @return void
*/
protected function registerServices() {
foreach (self::$diMap as $serviceKey => $serviceClass) {
if (is_int($serviceKey)) {
$this->registerServiceProvider($serviceClass);
} else {
$this->registerService($serviceKey, $serviceClass);
protected function registerServices()
{
foreach (self::$diMap as $serviceKey => $serviceClass) {
if (is_int($serviceKey)) {
$this->registerServiceProvider($serviceClass);
} else {
$this->registerService($serviceKey, $serviceClass);
}
}
}
}
/**
* Register a service provider with the container.
*
* @param string $serviceClass
* @param string $serviceClass
*
* @return void
*/
protected function registerServiceProvider($serviceClass) {
$this->register(new $serviceClass);
protected function registerServiceProvider($serviceClass)
{
$this->register(new $serviceClass);
}
/**
* Register a service with the container.
*
* @param string $serviceKey
* @param string $serviceClass
* @param string $serviceKey
* @param string $serviceClass
*
* @return void
*/
protected function registerService($serviceKey, $serviceClass) {
$this[$serviceKey] = function ($c) use ($serviceClass) {
return new $serviceClass($c);
};
protected function registerService($serviceKey, $serviceClass)
{
$this[$serviceKey] = function ($c) use ($serviceClass) {
return new $serviceClass($c);
};
}
/**

View File

@@ -9,12 +9,17 @@ namespace Grav\Common;
*/
trait GravTrait
{
protected static $grav;
/**
* @return Grav
*/
public static function getGrav()
{
return Grav::instance();
if (!self::$grav) {
self::$grav = Grav::instance();
}
return self::$grav;
}
}

View File

@@ -7,734 +7,136 @@ namespace Grav\Common\Language;
class LanguageCodes
{
protected static $codes = [
"ab" => [
"name" => "Abkhaz",
"nativeName" => "аҧсуа"
],
"aa" => [
"name" => "Afar",
"nativeName" => "Afaraf"
],
"af" => [
"name" => "Afrikaans",
"nativeName" => "Afrikaans"
],
"ak" => [
"name" => "Akan",
"nativeName" => "Akan"
],
"sq" => [
"name" => "Albanian",
"nativeName" => "Shqip"
],
"am" => [
"name" => "Amharic",
"nativeName" => "አማርኛ"
],
"ar" => [
"name" => "Arabic",
"nativeName" => "العربية"
],
"an" => [
"name" => "Aragonese",
"nativeName" => "Aragonés"
],
"hy" => [
"name" => "Armenian",
"nativeName" => "Հայերեն"
],
"as" => [
"name" => "Assamese",
"nativeName" => "অসমীয়া"
],
"av" => [
"name" => "Avaric",
"nativeName" => "авар мацӀ"
],
"ae" => [
"name" => "Avestan",
"nativeName" => "avesta"
],
"ay" => [
"name" => "Aymara",
"nativeName" => "aymar aru"
],
"az" => [
"name" => "Azerbaijani",
"nativeName" => "azərbaycan dili"
],
"bm" => [
"name" => "Bambara",
"nativeName" => "bamanankan"
],
"ba" => [
"name" => "Bashkir",
"nativeName" => "башҡорт теле"
],
"eu" => [
"name" => "Basque",
"nativeName" => "euskara"
],
"be" => [
"name" => "Belarusian",
"nativeName" => "Беларуская"
],
"bn" => [
"name" => "Bengali",
"nativeName" => "বাংলা"
],
"bh" => [
"name" => "Bihari",
"nativeName" => "भोजपुरी"
],
"bi" => [
"name" => "Bislama",
"nativeName" => "Bislama"
],
"bs" => [
"name" => "Bosnian",
"nativeName" => "bosanski jezik"
],
"br" => [
"name" => "Breton",
"nativeName" => "brezhoneg"
],
"bg" => [
"name" => "Bulgarian",
"nativeName" => "български език"
],
"my" => [
"name" => "Burmese",
"nativeName" => "ဗမာစာ"
],
"ca" => [
"name" => "Catalan",
"nativeName" => "Català"
],
"ch" => [
"name" => "Chamorro",
"nativeName" => "Chamoru"
],
"ce" => [
"name" => "Chechen",
"nativeName" => "нохчийн мотт"
],
"ny" => [
"name" => "Chichewa",
"nativeName" => "chiCheŵa"
],
"zh" => [
"name" => "Chinese",
"nativeName" => "中文"
],
"cv" => [
"name" => "Chuvash",
"nativeName" => "чӑваш чӗлхи"
],
"kw" => [
"name" => "Cornish",
"nativeName" => "Kernewek"
],
"co" => [
"name" => "Corsican",
"nativeName" => "corsu"
],
"cr" => [
"name" => "Cree",
"nativeName" => "ᓀᐦᐃᔭᐍᐏᐣ"
],
"hr" => [
"name" => "Croatian",
"nativeName" => "hrvatski"
],
"cs" => [
"name" => "Czech",
"nativeName" => "česky"
],
"da" => [
"name" => "Danish",
"nativeName" => "dansk"
],
"dv" => [
"name" => "Divehi",
"nativeName" => "ދިވެހި"
],
"nl" => [
"name" => "Dutch",
"nativeName" => "Nederlands"
],
"en" => [
"name" => "English",
"nativeName" => "English"
],
"eo" => [
"name" => "Esperanto",
"nativeName" => "Esperanto"
],
"et" => [
"name" => "Estonian",
"nativeName" => "eesti"
],
"ee" => [
"name" => "Ewe",
"nativeName" => "Eʋegbe"
],
"fo" => [
"name" => "Faroese",
"nativeName" => "føroyskt"
],
"fj" => [
"name" => "Fijian",
"nativeName" => "vosa Vakaviti"
],
"fi" => [
"name" => "Finnish",
"nativeName" => "suomi"
],
"fr" => [
"name" => "French",
"nativeName" => "Français"
],
"ff" => [
"name" => "Fula",
"nativeName" => "Fulfulde"
],
"gl" => [
"name" => "Galician",
"nativeName" => "Galego"
],
"ka" => [
"name" => "Georgian",
"nativeName" => "ქართული"
],
"de" => [
"name" => "German",
"nativeName" => "Deutsch"
],
"el" => [
"name" => "Greek",
"nativeName" => "Ελληνικά"
],
"gn" => [
"name" => "Guaraní",
"nativeName" => "Avañeẽ"
],
"gu" => [
"name" => "Gujarati",
"nativeName" => "ગુજરાતી"
],
"ht" => [
"name" => "Haitian",
"nativeName" => "Kreyòl ayisyen"
],
"ha" => [
"name" => "Hausa",
"nativeName" => "هَوُسَ"
],
"he" => [
"name" => "Hebrew",
"nativeName" => "עברית"
],
"hz" => [
"name" => "Herero",
"nativeName" => "Otjiherero"
],
"hi" => [
"name" => "Hindi",
"nativeName" => "हिन्दी"
],
"ho" => [
"name" => "Hiri Motu",
"nativeName" => "Hiri Motu"
],
"hu" => [
"name" => "Hungarian",
"nativeName" => "Magyar"
],
"ia" => [
"name" => "Interlingua",
"nativeName" => "Interlingua"
],
"id" => [
"name" => "Indonesian",
"nativeName" => "Bahasa Indonesia"
],
"ie" => [
"name" => "Interlingue",
"nativeName" => "Interlingue"
],
"ga" => [
"name" => "Irish",
"nativeName" => "Gaeilge"
],
"ig" => [
"name" => "Igbo",
"nativeName" => "Asụsụ Igbo"
],
"ik" => [
"name" => "Inupiaq",
"nativeName" => "Iñupiaq"
],
"io" => [
"name" => "Ido",
"nativeName" => "Ido"
],
"is" => [
"name" => "Icelandic",
"nativeName" => "Íslenska"
],
"it" => [
"name" => "Italian",
"nativeName" => "Italiano"
],
"iu" => [
"name" => "Inuktitut",
"nativeName" => "ᐃᓄᒃᑎᑐᑦ"
],
"ja" => [
"name" => "Japanese",
"nativeName" => "日本語"
],
"jv" => [
"name" => "Javanese",
"nativeName" => "basa Jawa"
],
"kl" => [
"name" => "Kalaallisut",
"nativeName" => "kalaallisut"
],
"kn" => [
"name" => "Kannada",
"nativeName" => "ಕನ್ನಡ"
],
"kr" => [
"name" => "Kanuri",
"nativeName" => "Kanuri"
],
"ks" => [
"name" => "Kashmiri",
"nativeName" => "कश्मीरी"
],
"kk" => [
"name" => "Kazakh",
"nativeName" => "Қазақ тілі"
],
"km" => [
"name" => "Khmer",
"nativeName" => "ភាសាខ្មែរ"
],
"ki" => [
"name" => "Kikuyu",
"nativeName" => "Gĩkũyũ"
],
"rw" => [
"name" => "Kinyarwanda",
"nativeName" => "Ikinyarwanda"
],
"ky" => [
"name" => "Kirghiz",
"nativeName" => "кыргыз тили"
],
"kv" => [
"name" => "Komi",
"nativeName" => "коми кыв"
],
"kg" => [
"name" => "Kongo",
"nativeName" => "KiKongo"
],
"ko" => [
"name" => "Korean",
"nativeName" => "한국어"
],
"ku" => [
"name" => "Kurdish",
"nativeName" => "كوردی‎"
],
"kj" => [
"name" => "Kwanyama",
"nativeName" => "Kuanyama"
],
"la" => [
"name" => "Latin",
"nativeName" => "latine"
],
"lb" => [
"name" => "Luxembourgish",
"nativeName" => "Lëtzebuergesch"
],
"lg" => [
"name" => "Luganda",
"nativeName" => "Luganda"
],
"li" => [
"name" => "Limburgish",
"nativeName" => "Limburgs"
],
"ln" => [
"name" => "Lingala",
"nativeName" => "Lingála"
],
"lo" => [
"name" => "Lao",
"nativeName" => "ພາສາລາວ"
],
"lt" => [
"name" => "Lithuanian",
"nativeName" => "lietuvių kalba"
],
"lu" => [
"name" => "Luba-Katanga",
"nativeName" => "Luba-Katanga"
],
"lv" => [
"name" => "Latvian",
"nativeName" => "latviešu valoda"
],
"gv" => [
"name" => "Manx",
"nativeName" => "Gaelg"
],
"mk" => [
"name" => "Macedonian",
"nativeName" => "македонски јазик"
],
"mg" => [
"name" => "Malagasy",
"nativeName" => "Malagasy fiteny"
],
"ms" => [
"name" => "Malay",
"nativeName" => "بهاس ملايو‎"
],
"ml" => [
"name" => "Malayalam",
"nativeName" => "മലയാളം"
],
"mt" => [
"name" => "Maltese",
"nativeName" => "Malti"
],
"mi" => [
"name" => "Māori",
"nativeName" => "te reo Māori"
],
"mr" => [
"name" => "Marathi",
"nativeName" => "मराठी"
],
"mh" => [
"name" => "Marshallese",
"nativeName" => "Kajin M̧ajeļ"
],
"mn" => [
"name" => "Mongolian",
"nativeName" => "монгол"
],
"na" => [
"name" => "Nauru",
"nativeName" => "Ekakairũ Naoero"
],
"nv" => [
"name" => "Navajo",
"nativeName" => "Diné bizaad"
],
"nb" => [
"name" => "Norwegian Bokmål",
"nativeName" => "Norsk bokmål"
],
"nd" => [
"name" => "North Ndebele",
"nativeName" => "isiNdebele"
],
"ne" => [
"name" => "Nepali",
"nativeName" => "नेपाली"
],
"ng" => [
"name" => "Ndonga",
"nativeName" => "Owambo"
],
"nn" => [
"name" => "Norwegian Nynorsk",
"nativeName" => "Norsk nynorsk"
],
"no" => [
"name" => "Norwegian",
"nativeName" => "Norsk"
],
"ii" => [
"name" => "Nuosu",
"nativeName" => "ꆈꌠ꒿ Nuosuhxop"
],
"nr" => [
"name" => "South Ndebele",
"nativeName" => "isiNdebele"
],
"oc" => [
"name" => "Occitan",
"nativeName" => "Occitan"
],
"oj" => [
"name" => "Ojibwe, Ojibwa",
"nativeName" => "ᐊᓂᔑᓈᐯᒧᐎᓐ"
],
"cu" => [
"name" => "Church Slavic",
"nativeName" => "ѩзыкъ словѣньскъ"
],
"om" => [
"name" => "Oromo",
"nativeName" => "Afaan Oromoo"
],
"or" => [
"name" => "Oriya",
"nativeName" => "ଓଡ଼ିଆ"
],
"os" => [
"name" => "Ossetian",
"nativeName" => "ирон æвзаг"
],
"pa" => [
"name" => "Panjabi",
"nativeName" => "ਪੰਜਾਬੀ"
],
"pi" => [
"name" => "Pāli",
"nativeName" => "पाऴि"
],
"fa" => [
"name" => "Persian",
"nativeName" => "فارسی"
],
"pl" => [
"name" => "Polish",
"nativeName" => "polski"
],
"ps" => [
"name" => "Pashto",
"nativeName" => "پښتو"
],
"pt" => [
"name" => "Portuguese",
"nativeName" => "Português"
],
"qu" => [
"name" => "Quechua",
"nativeName" => "Runa Simi"
],
"rm" => [
"name" => "Romansh",
"nativeName" => "rumantsch grischun"
],
"rn" => [
"name" => "Kirundi",
"nativeName" => "kiRundi"
],
"ro" => [
"name" => "Romanian",
"nativeName" => "română"
],
"ru" => [
"name" => "Russian",
"nativeName" => "Русский"
],
"sa" => [
"name" => "Sanskrit",
"nativeName" => "संस्कृतम्"
],
"sc" => [
"name" => "Sardinian",
"nativeName" => "sardu"
],
"sd" => [
"name" => "Sindhi",
"nativeName" => "सिन्धी"
],
"se" => [
"name" => "Northern Sami",
"nativeName" => "Davvisámegiella"
],
"sm" => [
"name" => "Samoan",
"nativeName" => "gagana faa Samoa"
],
"sg" => [
"name" => "Sango",
"nativeName" => "yângâ tî sängö"
],
"sr" => [
"name" => "Serbian",
"nativeName" => "српски језик"
],
"gd" => [
"name" => "Scottish Gaelic",
"nativeName" => "Gàidhlig"
],
"sn" => [
"name" => "Shona",
"nativeName" => "chiShona"
],
"si" => [
"name" => "Sinhala",
"nativeName" => "සිංහල"
],
"sk" => [
"name" => "Slovak",
"nativeName" => "slovenčina"
],
"sl" => [
"name" => "Slovene",
"nativeName" => "slovenščina"
],
"so" => [
"name" => "Somali",
"nativeName" => "Soomaaliga"
],
"st" => [
"name" => "Southern Sotho",
"nativeName" => "Sesotho"
],
"es" => [
"name" => "Spanish",
"nativeName" => "Español"
],
"su" => [
"name" => "Sundanese",
"nativeName" => "Basa Sunda"
],
"sw" => [
"name" => "Swahili",
"nativeName" => "Kiswahili"
],
"ss" => [
"name" => "Swati",
"nativeName" => "SiSwati"
],
"sv" => [
"name" => "Swedish",
"nativeName" => "svenska"
],
"ta" => [
"name" => "Tamil",
"nativeName" => "தமிழ்"
],
"te" => [
"name" => "Telugu",
"nativeName" => "తెలుగు"
],
"tg" => [
"name" => "Tajik",
"nativeName" => "тоҷикӣ"
],
"th" => [
"name" => "Thai",
"nativeName" => "ไทย"
],
"ti" => [
"name" => "Tigrinya",
"nativeName" => "ትግርኛ"
],
"bo" => [
"name" => "Tibetan",
"nativeName" => "བོད་ཡིག"
],
"tk" => [
"name" => "Turkmen",
"nativeName" => "Türkmen"
],
"tl" => [
"name" => "Tagalog",
"nativeName" => "Wikang Tagalog"
],
"tn" => [
"name" => "Tswana",
"nativeName" => "Setswana"
],
"to" => [
"name" => "Tonga",
"nativeName" => "faka Tonga"
],
"tr" => [
"name" => "Turkish",
"nativeName" => "Türkçe"
],
"ts" => [
"name" => "Tsonga",
"nativeName" => "Xitsonga"
],
"tt" => [
"name" => "Tatar",
"nativeName" => "татарча"
],
"tw" => [
"name" => "Twi",
"nativeName" => "Twi"
],
"ty" => [
"name" => "Tahitian",
"nativeName" => "Reo Tahiti"
],
"ug" => [
"name" => "Uighur",
"nativeName" => "Uyƣurqə"
],
"uk" => [
"name" => "Ukrainian",
"nativeName" => "українська"
],
"ur" => [
"name" => "Urdu",
"nativeName" => "اردو"
],
"uz" => [
"name" => "Uzbek",
"nativeName" => "zbek"
],
"ve" => [
"name" => "Venda",
"nativeName" => "Tshivenḓa"
],
"vi" => [
"name" => "Vietnamese",
"nativeName" => "Tiếng Việt"
],
"vo" => [
"name" => "Volapük",
"nativeName" => "Volapük"
],
"wa" => [
"name" => "Walloon",
"nativeName" => "Walon"
],
"cy" => [
"name" => "Welsh",
"nativeName" => "Cymraeg"
],
"wo" => [
"name" => "Wolof",
"nativeName" => "Wollof"
],
"fy" => [
"name" => "Western Frisian",
"nativeName" => "Frysk"
],
"xh" => [
"name" => "Xhosa",
"nativeName" => "isiXhosa"
],
"yi" => [
"name" => "Yiddish",
"nativeName" => "ייִדיש"
],
"yo" => [
"name" => "Yoruba",
"nativeName" => "Yorùbá"
],
"za" => [
"name" => "Zhuang",
"nativeName" => "Saɯ cueŋƅ"
]
'af' => [ 'name' => 'Afrikaans', 'nativeName' => 'Afrikaans' ],
'ak' => [ 'name' => 'Akan', 'nativeName' => 'Akan' ], // unverified native name
'ast' => [ 'name' => 'Asturian', 'nativeName' => 'Asturianu' ],
'ar' => [ 'name' => 'Arabic', 'nativeName' => 'عربي' ],
'as' => [ 'name' => 'Assamese', 'nativeName' => 'অসমীয়া' ],
'be' => [ 'name' => 'Belarusian', 'nativeName' => 'Беларуская' ],
'bg' => [ 'name' => 'Bulgarian', 'nativeName' => 'Български' ],
'bn' => [ 'name' => 'Bengali', 'nativeName' => 'বাংলা' ],
'bn-BD' => [ 'name' => 'Bengali (Bangladesh)', 'nativeName' => 'বাংলা (বাংলাদেশ)' ],
'bn-IN' => [ 'name' => 'Bengali (India)', 'nativeName' => 'বাংলা (ভারত)' ],
'br' => [ 'name' => 'Breton', 'nativeName' => 'Brezhoneg' ],
'ca' => [ 'name' => 'Catalan', 'nativeName' => 'català' ],
'ca-valencia'=> [ 'name' => 'Catalan (Valencian)', 'nativeName' => 'català (valencià)' ], // not iso-639-1. a=l10n-drivers
'cs' => [ 'name' => 'Czech', 'nativeName' => 'Čeština' ],
'cy' => [ 'name' => 'Welsh', 'nativeName' => 'Cymraeg' ],
'da' => [ 'name' => 'Danish', 'nativeName' => 'Dansk' ],
'de' => [ 'name' => 'German', 'nativeName' => 'Deutsch' ],
'de-AT' => [ 'name' => 'German (Austria)', 'nativeName' => 'Deutsch (Österreich)' ],
'de-CH' => [ 'name' => 'German (Switzerland)', 'nativeName' => 'Deutsch (Schweiz)' ],
'de-DE' => [ 'name' => 'German (Germany)', 'nativeName' => 'Deutsch (Deutschland)' ],
'dsb' => [ 'name' => 'Lower Sorbian', 'nativeName' => 'Dolnoserbšćina' ], // iso-639-2
'el' => [ 'name' => 'Greek', 'nativeName' => 'Ελληνικά' ],
'en' => [ 'name' => 'English', 'nativeName' => 'English' ],
'en-AU' => [ 'name' => 'English (Australian)', 'nativeName' => 'English (Australian)' ],
'en-CA' => [ 'name' => 'English (Canadian)', 'nativeName' => 'English (Canadian)' ],
'en-GB' => [ 'name' => 'English (British)', 'nativeName' => 'English (British)' ],
'en-NZ' => [ 'name' => 'English (New Zealand)', 'nativeName' => 'English (New Zealand)' ],
'en-US' => [ 'name' => 'English (US)', 'nativeName' => 'English (US)' ],
'en-ZA' => [ 'name' => 'English (South African)', 'nativeName' => 'English (South African)' ],
'eo' => [ 'name' => 'Esperanto', 'nativeName' => 'Esperanto' ],
'es' => [ 'name' => 'Spanish', 'nativeName' => 'Español' ],
'es-AR' => [ 'name' => 'Spanish (Argentina)', 'nativeName' => 'Español (de Argentina)' ],
'es-CL' => [ 'name' => 'Spanish (Chile)', 'nativeName' => 'Español (de Chile)' ],
'es-ES' => [ 'name' => 'Spanish (Spain)', 'nativeName' => 'Español (de España)' ],
'es-MX' => [ 'name' => 'Spanish (Mexico)', 'nativeName' => 'Español (de México)' ],
'et' => [ 'name' => 'Estonian', 'nativeName' => 'Eesti keel' ],
'eu' => [ 'name' => 'Basque', 'nativeName' => 'Euskara' ],
'fa' => [ 'name' => 'Persian', 'nativeName' => 'فارسی' ],
'fi' => [ 'name' => 'Finnish', 'nativeName' => 'suomi' ],
'fj-FJ' => [ 'name' => 'Fijian', 'nativeName' => 'Vosa vaka-Viti' ],
'fr' => [ 'name' => 'French', 'nativeName' => 'Français' ],
'fur' => [ 'name' => 'Friulian', 'nativeName' => 'Furlan' ],
'fur-IT' => [ 'name' => 'Friulian', 'nativeName' => 'Furlan' ],
'fy' => [ 'name' => 'Frisian', 'nativeName' => 'Frysk' ],
'fy-NL' => [ 'name' => 'Frisian', 'nativeName' => 'Frysk' ],
'ga' => [ 'name' => 'Irish', 'nativeName' => 'Gaeilge' ],
'ga-IE' => [ 'name' => 'Irish (Ireland)', 'nativeName' => 'Gaeilge (Éire)' ],
'gd' => [ 'name' => 'Gaelic (Scotland)', 'nativeName' => 'Gàidhlig' ],
'gl' => [ 'name' => 'Galician', 'nativeName' => 'Galego' ],
'gu' => [ 'name' => 'Gujarati', 'nativeName' => 'ગુજરાતી' ],
'gu-IN' => [ 'name' => 'Gujarati', 'nativeName' => 'ગુજરાતી' ],
'he' => [ 'name' => 'Hebrew', 'nativeName' => 'עברית' ],
'hi' => [ 'name' => 'Hindi', 'nativeName' => 'हिन्दी' ],
'hi-IN' => [ 'name' => 'Hindi (India)', 'nativeName' => 'हिन्दी (भारत)' ],
'hr' => [ 'name' => 'Croatian', 'nativeName' => 'Hrvatski' ],
'hsb' => [ 'name' => 'Upper Sorbian', 'nativeName' => 'Hornjoserbsce' ],
'hu' => [ 'name' => 'Hungarian', 'nativeName' => 'Magyar' ],
'hy' => [ 'name' => 'Armenian', 'nativeName' => 'Հայերեն' ],
'hy-AM' => [ 'name' => 'Armenian', 'nativeName' => 'Հայերեն' ],
'id' => [ 'name' => 'Indonesian', 'nativeName' => 'Bahasa Indonesia' ],
'is' => [ 'name' => 'Icelandic', 'nativeName' => 'íslenska' ],
'it' => [ 'name' => 'Italian', 'nativeName' => 'Italiano' ],
'ja' => [ 'name' => 'Japanese', 'nativeName' => '日本語' ],
'ja-JP' => [ 'name' => 'Japanese', 'nativeName' => '日本語' ], // not iso-639-1
'ka' => [ 'name' => 'Georgian', 'nativeName' => 'ქართული' ],
'kk' => [ 'name' => 'Kazakh', 'nativeName' => 'Қазақ' ],
'kn' => [ 'name' => 'Kannada', 'nativeName' => 'ಕನ್ನಡ' ],
'ko' => [ 'name' => 'Korean', 'nativeName' => '한국어' ],
'ku' => [ 'name' => 'Kurdish', 'nativeName' => 'Kurdî' ],
'la' => [ 'name' => 'Latin', 'nativeName' => 'Latina' ],
'lg' => [ 'name' => 'Luganda', 'nativeName' => 'Luganda' ],
'lt' => [ 'name' => 'Lithuanian', 'nativeName' => 'lietuvių kalba' ],
'lv' => [ 'name' => 'Latvian', 'nativeName' => 'Latviešu' ],
'mai' => [ 'name' => 'Maithili', 'nativeName' => 'मैथिली মৈথিলী' ],
'mg' => [ 'name' => 'Malagasy', 'nativeName' => 'Malagasy' ],
'mi' => [ 'name' => 'Maori (Aotearoa)', 'nativeName' => 'Māori (Aotearoa)' ],
'mk' => [ 'name' => 'Macedonian', 'nativeName' => 'Македонски' ],
'ml' => [ 'name' => 'Malayalam', 'nativeName' => 'മലയാളം' ],
'mn' => [ 'name' => 'Mongolian', 'nativeName' => 'Монгол' ],
'mr' => [ 'name' => 'Marathi', 'nativeName' => 'मराठी' ],
'nb' => [ 'name' => 'Norwegian', 'nativeName' => 'Norsk' ],
'nb-NO' => [ 'name' => 'Norwegian (Bokmål)', 'nativeName' => 'Norsk bokmål' ],
'ne-NP' => [ 'name' => 'Nepali', 'nativeName' => 'नेपाली' ],
'nn-NO' => [ 'name' => 'Norwegian (Nynorsk)', 'nativeName' => 'Norsk nynorsk' ],
'nl' => [ 'name' => 'Dutch', 'nativeName' => 'Nederlands' ],
'nr' => [ 'name' => 'Ndebele, South', 'nativeName' => 'isiNdebele' ],
'nso' => [ 'name' => 'Northern Sotho', 'nativeName' => 'Sepedi' ],
'oc' => [ 'name' => 'Occitan (Lengadocian)', 'nativeName' => 'occitan (lengadocian)' ],
'or' => [ 'name' => 'Oriya', 'nativeName' => 'ଓଡ଼ିଆ' ],
'pa' => [ 'name' => 'Punjabi', 'nativeName' => 'ਪੰਜਾਬੀ' ],
'pa-IN' => [ 'name' => 'Punjabi', 'nativeName' => 'ਪੰਜਾਬੀ' ],
'pl' => [ 'name' => 'Polish', 'nativeName' => 'Polski' ],
'pt' => [ 'name' => 'Portuguese', 'nativeName' => 'Português' ],
'pt-BR' => [ 'name' => 'Portuguese (Brazilian)', 'nativeName' => 'Português (do Brasil)' ],
'pt-PT' => [ 'name' => 'Portuguese (Portugal)', 'nativeName' => 'Português (Europeu)' ],
'ro' => [ 'name' => 'Romanian', 'nativeName' => 'română' ],
'rm' => [ 'name' => 'Romansh', 'nativeName' => 'rumantsch' ],
'ru' => [ 'name' => 'Russian', 'nativeName' => 'Русский' ],
'rw' => [ 'name' => 'Kinyarwanda', 'nativeName' => 'Ikinyarwanda' ],
'si' => [ 'name' => 'Sinhala', 'nativeName' => 'සිංහල' ],
'sk' => [ 'name' => 'Slovak', 'nativeName' => 'slovenčina' ],
'sl' => [ 'name' => 'Slovenian', 'nativeName' => 'slovensko' ],
'son' => [ 'name' => 'Songhai', 'nativeName' => 'Soŋay' ],
'sq' => [ 'name' => 'Albanian', 'nativeName' => 'Shqip' ],
'sr' => [ 'name' => 'Serbian', 'nativeName' => 'Српски' ],
'sr-Latn' => [ 'name' => 'Serbian', 'nativeName' => 'Srpski' ], // follows RFC 4646
'ss' => [ 'name' => 'Siswati', 'nativeName' => 'siSwati' ],
'st' => [ 'name' => 'Southern Sotho', 'nativeName' => 'Sesotho' ],
'sv' => [ 'name' => 'Swedish', 'nativeName' => 'Svenska' ],
'sv-SE' => [ 'name' => 'Swedish', 'nativeName' => 'Svenska' ],
'ta' => [ 'name' => 'Tamil', 'nativeName' => 'தமிழ்' ],
'ta-IN' => [ 'name' => 'Tamil (India)', 'nativeName' => 'தமிழ் (இந்தியா)' ],
'ta-LK' => [ 'name' => 'Tamil (Sri Lanka)', 'nativeName' => 'தமிழ் (இலங்கை)' ],
'te' => [ 'name' => 'Telugu', 'nativeName' => 'తెలుగు' ],
'th' => [ 'name' => 'Thai', 'nativeName' => 'ไทย' ],
'tn' => [ 'name' => 'Tswana', 'nativeName' => 'Setswana' ],
'tr' => [ 'name' => 'Turkish', 'nativeName' => 'Türkçe' ],
'ts' => [ 'name' => 'Tsonga', 'nativeName' => 'Xitsonga' ],
'tt' => [ 'name' => 'Tatar', 'nativeName' => 'Tatarça' ],
'tt-RU' => [ 'name' => 'Tatar', 'nativeName' => 'Tatarça' ],
'uk' => [ 'name' => 'Ukrainian', 'nativeName' => 'Українська' ],
'ur' => [ 'name' => 'Urdu', 'nativeName' => 'اُردو' ],
've' => [ 'name' => 'Venda', 'nativeName' => 'Tshivenḓa' ],
'vi' => [ 'name' => 'Vietnamese', 'nativeName' => 'Tiếng Việt' ],
'wo' => [ 'name' => 'Wolof', 'nativeName' => 'Wolof' ],
'xh' => [ 'name' => 'Xhosa', 'nativeName' => 'isiXhosa' ],
'zh' => [ 'name' => 'Chinese (Simplified)', 'nativeName' => '中文 (简体)' ],
'zh-CN' => [ 'name' => 'Chinese (Simplified)', 'nativeName' => '中文 (简体)' ],
'zh-TW' => [ 'name' => 'Chinese (Traditional)', 'nativeName' => '正體中文 (繁體)' ],
'zu' => [ 'name' => 'Zulu', 'nativeName' => 'isiZulu' ]
];
public static function getName($code)
@@ -744,10 +146,15 @@ class LanguageCodes
public static function getNativeName($code)
{
if (strlen($code) == 2) {
if (isset(static::$codes[$code])) {
return static::get($code, 'nativeName');
} else {
return static::get(substr($code, 0, 2), 'nativeName') . ' (' . substr($code, -2) . ')';
if (preg_match('/[a-zA-Z]{2}-[a-zA-Z]{2}/', $code)) {
return static::get(substr($code, 0, 2), 'nativeName') . ' (' . substr($code, -2) . ')';
} else {
return $code;
}
}
}

View File

@@ -300,7 +300,7 @@ trait ParsedownGravTrait
if (isset($url['query'])) {
$actions = array_reduce(explode('&', $url['query']), function ($carry, $item) {
$parts = explode('=', $item, 2);
$value = isset($parts[1]) ? $parts[1] : true;
$value = isset($parts[1]) ? rawurldecode($parts[1]) : true;
$carry[$parts[0]] = $value;
return $carry;

View File

@@ -247,7 +247,7 @@ class Collection extends Iterator
*
* @param string $path the path the item
*
* @return Page Item in the array the the current position.
* @return Integer the index of the current page.
*/
public function currentPosition($path)
{

View File

@@ -84,6 +84,10 @@ class ImageMedium extends Medium
$config = Grav::instance()['config'];
if (filesize($this->get('filepath')) === 0) {
return;
}
$image_info = getimagesize($this->get('filepath'));
$this->def('width', $image_info[0]);
$this->def('height', $image_info[1]);

View File

@@ -500,7 +500,7 @@ class Page
$size = 300;
}
return Utils::truncateHTML($content, $size);
return html_entity_decode(Utils::truncateHTML($content, $size));
}
/**
@@ -639,10 +639,19 @@ class Page
/**
* Return the whole contentMeta array as it currently stands
*
* @param null $name
* @return mixed
*/
public function getContentMeta()
public function getContentMeta($name = null)
{
if ($name) {
if(isset($this->content_meta[$name])) {
return $this->content_meta[$name];
} else {
return null;
}
}
return $this->content_meta;
}
@@ -698,7 +707,7 @@ class Page
/**
* Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page
*/
private function cachePageContent()
public function cachePageContent()
{
$cache = Grav::instance()['cache'];
$cache_id = md5('page' . $this->id());
@@ -1344,20 +1353,20 @@ class Page
if (is_array($value)) {
foreach ($value as $property => $prop_value) {
$prop_key = $key . ":" . $property;
$this->metadata[$prop_key] = ['name' => $prop_key, 'property' => $prop_key, 'content' => htmlspecialchars($prop_value, ENT_QUOTES)];
$this->metadata[$prop_key] = ['name' => $prop_key, 'property' => $prop_key, 'content' => htmlspecialchars($prop_value, ENT_QUOTES, 'UTF-8')];
}
} else {
// If it this is a standard meta data type
if ($value) {
if (in_array($key, $header_tag_http_equivs)) {
$this->metadata[$key] = ['http_equiv' => $key, 'content' => htmlspecialchars($value, ENT_QUOTES)];
$this->metadata[$key] = ['http_equiv' => $key, 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')];
} elseif ($key == 'charset') {
$this->metadata[$key] = ['charset' => htmlspecialchars($value, ENT_QUOTES)];
$this->metadata[$key] = ['charset' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')];
} else {
// if it's a social metadata with separator, render as property
$separator = strpos($key, ':');
$hasSeparator = $separator && $separator < strlen($key) - 1;
$entry = ['name' => $key, 'content' => htmlspecialchars($value, ENT_QUOTES)];
$entry = ['name' => $key, 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')];
if ($hasSeparator) {
$entry['property'] = $key;
@@ -1383,7 +1392,7 @@ class Page
*/
public function slug($var = null)
{
if ($var !== null) {
if ($var !== null && $var !== "") {
$this->slug = $var;
if(!preg_match('/^[a-z0-9][-a-z0-9]*$/', $this->slug)){
Grav::instance()['log']->notice("Invalid slug set in YAML frontmatter: " . $this->rawRoute() . " => ". $this->slug);
@@ -1733,7 +1742,7 @@ class Page
*/
public function relativePagePath()
{
$path = str_replace('/' . $this->name, '', $this->filePathClean());
$path = str_replace('/' . $this->name(), '', $this->filePathClean());
return $path;
}

View File

@@ -323,49 +323,52 @@ class Pages
$not_admin = !isset($this->grav['admin']);
// If the page cannot be reached, look into site wide redirects, routes + wildcards
if (!$all && $not_admin && (!$page || ($page && !$page->routable()) || ($page && $page->redirect()))) {
if (!$all && $not_admin) {
// If the page is a simple redirect, just do it.
if ($redirect && $page && $page->redirect()) {
$this->grav->redirectLangSafe($page->redirect());
}
/** @var Config $config */
$config = $this->grav['config'];
// fall back and check site based redirects
if (!$page || ($page && !$page->routable())) {
/** @var Config $config */
$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);
} else {
// Try Regex style redirects
$site_redirects = $config->get("site.redirects");
if (is_array($site_redirects)) {
foreach ((array)$site_redirects as $pattern => $replace) {
$pattern = '#' . $pattern . '#';
try {
$found = preg_replace($pattern, $replace, $url);
if ($found != $url) {
$this->grav->redirectLangSafe($found);
// See if route matches one in the site configuration
$route = $config->get("site.routes.{$url}");
if ($route) {
$page = $this->dispatch($route, $all);
} else {
// Try Regex style redirects
$site_redirects = $config->get("site.redirects");
if (is_array($site_redirects)) {
foreach ((array)$site_redirects as $pattern => $replace) {
$pattern = '#' . $pattern . '#';
try {
$found = preg_replace($pattern, $replace, $url);
if ($found != $url) {
$this->grav->redirectLangSafe($found);
}
} catch (ErrorException $e) {
$this->grav['log']->error('site.redirects: ' . $pattern . '-> ' . $e->getMessage());
}
} catch (ErrorException $e) {
$this->grav['log']->error('site.redirects: ' . $pattern . '-> ' . $e->getMessage());
}
}
}
// Try Regex style routes
$site_routes = $config->get("site.routes");
if (is_array($site_routes)) {
foreach ((array)$site_routes as $pattern => $replace) {
$pattern = '#' . $pattern . '#';
try {
$found = preg_replace($pattern, $replace, $url);
if ($found != $url) {
$page = $this->dispatch($found, $all);
// Try Regex style routes
$site_routes = $config->get("site.routes");
if (is_array($site_routes)) {
foreach ((array)$site_routes as $pattern => $replace) {
$pattern = '#' . $pattern . '#';
try {
$found = preg_replace($pattern, $replace, $url);
if ($found != $url) {
$page = $this->dispatch($found, $all);
}
} catch (ErrorException $e) {
$this->grav['log']->error('site.routes: ' . $pattern . '-> ' . $e->getMessage());
}
} catch (ErrorException $e) {
$this->grav['log']->error('site.routes: ' . $pattern . '-> ' . $e->getMessage());
}
}
}
@@ -407,7 +410,7 @@ class Pages
}
if (empty($blueprint->initialized)) {
$this->grav->fireEvent('onBlueprintCreated', new Event(['blueprint' => $blueprint]));
$this->grav->fireEvent('onBlueprintCreated', new Event(['blueprint' => $blueprint, 'type' => $type]));
$blueprint->initialized = true;
}
@@ -486,13 +489,44 @@ class Pages
public static function getTypes()
{
if (!self::$types) {
self::$types = new Types();
self::$types->scanBlueprints('theme://blueprints/');
self::$types->scanTemplates('theme://templates/');
$event = new Event();
$event->types = self::$types;
Grav::instance()->fireEvent('onGetPageTemplates', $event);
$grav = Grav::instance();
$scanBlueprintsAndTemplates = function () use ($grav) {
// Scan blueprints
$event = new Event();
$event->types = self::$types;
$grav->fireEvent('onGetPageBlueprints', $event);
self::$types->scanBlueprints('theme://blueprints/');
// Scan templates
$event = new Event();
$event->types = self::$types;
$grav->fireEvent('onGetPageTemplates', $event);
self::$types->scanTemplates('theme://templates/');
};
if ($grav['config']->get('system.cache.enabled')) {
/** @var Cache $cache */
$cache = $grav['cache'];
// Use cached types if possible.
$types_cache_id = md5('types');
self::$types = $cache->fetch($types_cache_id);
if (!self::$types) {
self::$types = new Types();
$scanBlueprintsAndTemplates();
$cache->save($types_cache_id, self::$types);
}
} else {
self::$types = new Types();
$scanBlueprintsAndTemplates();
}
}
return self::$types;
@@ -1029,7 +1063,12 @@ class Pages
$list = $this->arrayShuffle($list);
} else {
// else just sort the list according to specified key
asort($list, $sort_flags);
if (extension_loaded('intl')) {
$col = new \Collator(setlocale(LC_COLLATE, 0)); //`setlocale` with a 0 param returns the current locale set
$col->asort($list, $sort_flags);
} else {
asort($list, $sort_flags);
}
}

View File

@@ -2,11 +2,13 @@
namespace Grav\Common\Page;
use Grav\Common\Filesystem\Folder;
use Grav\Common\Grav;
use RocketTheme\Toolbox\ArrayTraits\ArrayAccess;
use RocketTheme\Toolbox\ArrayTraits\Constructor;
use RocketTheme\Toolbox\ArrayTraits\Countable;
use RocketTheme\Toolbox\ArrayTraits\Export;
use RocketTheme\Toolbox\ArrayTraits\Iterator;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
class Types implements \ArrayAccess, \Iterator, \Countable
{
@@ -17,14 +19,18 @@ class Types implements \ArrayAccess, \Iterator, \Countable
public function register($type, $blueprint = null)
{
if (!$blueprint && $this->systemBlueprints && isset($this->systemBlueprints[$type])) {
$useBlueprint = $this->systemBlueprints[$type];
} else {
$useBlueprint = $blueprint;
if (!isset($this->items[$type])) {
$this->items[$type] = [];
} elseif (!$blueprint) {
return;
}
if ($blueprint || empty($this->items[$type])) {
$this->items[$type] = $useBlueprint;
if (!$blueprint && $this->systemBlueprints) {
$blueprint = isset($this->systemBlueprints[$type]) ? $this->systemBlueprints[$type] : $this->systemBlueprints['default'];
}
if ($blueprint) {
array_unshift($this->items[$type], $blueprint);
}
}
@@ -34,7 +40,16 @@ class Types implements \ArrayAccess, \Iterator, \Countable
throw new \InvalidArgumentException('First parameter must be URI');
}
$this->items = $this->findBlueprints($uri) + $this->items;
if (!$this->systemBlueprints) {
$this->systemBlueprints = $this->findBlueprints('blueprints://pages');
// Register default by default.
$this->register('default');
}
foreach ($this->findBlueprints($uri) as $type => $blueprint) {
$this->register($type, $blueprint);
}
}
public function scanTemplates($uri)
@@ -53,13 +68,6 @@ class Types implements \ArrayAccess, \Iterator, \Countable
'recursive' => false
];
if (!$this->systemBlueprints) {
$this->systemBlueprints = $this->findBlueprints('blueprints://pages');
}
// register default by default
$this->register('default');
foreach (Folder::all($uri, $options) as $type) {
$this->register($type);
}
@@ -108,6 +116,12 @@ class Types implements \ArrayAccess, \Iterator, \Countable
'value' => 'PathName',
];
/** @var UniformResourceLocator $locator */
$locator = Grav::instance()['locator'];
if ($locator->isStream($uri)) {
$options['value'] = 'Url';
}
$list = Folder::all($uri, $options);
return $list;

View File

@@ -294,6 +294,19 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
return true;
}
/**
* Simpler getter for the plugin blueprint
*
* @return mixed
*/
public function getBlueprint()
{
if (!$this->blueprint) {
$this->loadBlueprint();
}
return $this->blueprint;
}
/**
* Load blueprints.
*/

View File

@@ -7,8 +7,8 @@ class AssetsProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Assets';
public function process() {
$this->container['assets']->init();
$this->container->fireEvent('onAssetsInitialized');
$this->container['assets']->init();
$this->container->fireEvent('onAssetsInitialized');
}
}

View File

@@ -7,8 +7,8 @@ class ConfigurationProcessor extends ProcessorBase implements ProcessorInterface
public $title = 'Configuration';
public function process() {
$this->container['config']->init();
return $this->container['plugins']->setup();
$this->container['config']->init();
return $this->container['plugins']->setup();
}
}

View File

@@ -7,7 +7,7 @@ class DebuggerAssetsProcessor extends ProcessorBase implements ProcessorInterfac
public $title = 'Debugger Assets';
public function process() {
$this->container['debugger']->addAssets();
$this->container['debugger']->addAssets();
}
}

View File

@@ -7,7 +7,7 @@ class DebuggerInitProcessor extends ProcessorBase implements ProcessorInterface
public $title = 'Init Debugger';
public function process() {
$this->container['debugger']->init();
$this->container['debugger']->init();
}
}

View File

@@ -7,7 +7,7 @@ class ErrorsProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Error Handlers Reset';
public function process() {
$this->container['errors']->resetHandlers();
$this->container['errors']->resetHandlers();
}
}

View File

@@ -7,27 +7,27 @@ class InitializeProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Initialize';
public function process() {
$this->container['config']->debug();
$this->container['config']->debug();
// Use output buffering to prevent headers from being sent too early.
ob_start();
if ($this->container['config']->get('system.cache.gzip')) {
// Enable zip/deflate with a fallback in case of if browser does not support compressing.
if (!ob_start("ob_gzhandler")) {
ob_start();
}
}
// Use output buffering to prevent headers from being sent too early.
ob_start();
if ($this->container['config']->get('system.cache.gzip')) {
// Enable zip/deflate with a fallback in case of if browser does not support compressing.
if (!@ob_start("ob_gzhandler")) {
ob_start();
}
}
// Initialize the timezone.
if ($this->container['config']->get('system.timezone')) {
date_default_timezone_set($this->container['config']->get('system.timezone'));
}
// Initialize the timezone.
if ($this->container['config']->get('system.timezone')) {
date_default_timezone_set($this->container['config']->get('system.timezone'));
}
// Initialize uri, session.
$this->container['uri']->init();
$this->container['session']->init();
// Initialize uri, session.
$this->container['session']->init();
$this->container['uri']->init();
$this->container->setLocale();
$this->container->setLocale();
}
}

View File

@@ -7,9 +7,9 @@ class PagesProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Pages';
public function process() {
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized');
$this->container->fireEvent('onPageInitialized');
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized');
$this->container->fireEvent('onPageInitialized');
}
}

View File

@@ -7,8 +7,8 @@ class PluginsProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Plugins';
public function process() {
$this->container['plugins']->init();
$this->container->fireEvent('onPluginsInitialized');
$this->container['plugins']->init();
$this->container->fireEvent('onPluginsInitialized');
}
}

View File

@@ -3,8 +3,8 @@ namespace Grav\Common\Processors;
class ProcessorBase {
public function __construct($container) {
$this->container = $container;
}
public function __construct($container) {
$this->container = $container;
}
}

View File

@@ -2,5 +2,5 @@
namespace Grav\Common\Processors;
interface ProcessorInterface {
public function process();
public function process();
}

View File

@@ -7,8 +7,8 @@ class RenderProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Render';
public function process() {
$this->container->output = $this->container['output'];
$this->container->fireEvent('onOutputGenerated');
$this->container->output = $this->container['output'];
$this->container->fireEvent('onOutputGenerated');
}
}

View File

@@ -7,8 +7,8 @@ class SiteSetupProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Site Setup';
public function process() {
$this->container['setup']->init();
$this->container['streams'];
$this->container['setup']->init();
$this->container['streams'];
}
}

View File

@@ -7,10 +7,10 @@ class TasksProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Tasks';
public function process() {
$task = $this->container['task'];
if ($task) {
$this->container->fireEvent('onTask.' . $task);
}
$task = $this->container['task'];
if ($task) {
$this->container->fireEvent('onTask.' . $task);
}
}
}

View File

@@ -7,7 +7,7 @@ class ThemesProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Themes';
public function process() {
$this->container['themes']->init();
$this->container['themes']->init();
}
}

View File

@@ -7,7 +7,7 @@ class TwigProcessor extends ProcessorBase implements ProcessorInterface {
public $title = 'Twig';
public function process() {
$this->container['twig']->init();
$this->container['twig']->init();
}
}

View File

@@ -4,9 +4,6 @@ namespace Grav\Common\Service;
use Grav\Common\Errors\Errors;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Handler\PlainTextHandler;
class ErrorServiceProvider implements ServiceProviderInterface
{

View File

@@ -26,18 +26,35 @@ class PageServiceProvider implements ServiceProviderInterface
// Redirection tests
if ($page) {
$url = $page->route();
if ($uri->params()) {
if ($url == '/') { //Avoid double slash
$url = $uri->params();
} else {
$url .= $uri->params();
}
}
if ($uri->query()) {
$url .= '?' . $uri->query();
}
if ($uri->fragment()) {
$url .= '#' . $uri->fragment();
}
// Language-specific redirection scenarios
if ($language->enabled()) {
if ($language->isLanguageInUrl() && !$language->isIncludeDefaultLanguage()) {
$c->redirect($page->route());
$c->redirect($url);
}
if (!$language->isLanguageInUrl() && $language->isIncludeDefaultLanguage()) {
$c->redirectLangSafe($page->route());
$c->redirectLangSafe($url);
}
}
// Default route test and redirect
if ($c['config']->get('system.pages.redirect_default_route') && $page->route() != $path) {
$c->redirectLangSafe($page->route());
$c->redirectLangSafe($url);
}
}

View File

@@ -31,15 +31,21 @@ class Session extends BaseSession
$config = $this->grav['config'];
$is_admin = false;
$base_url = $uri->rootUrl(false);
$session_timeout = $config->get('system.session.timeout', 1800);
$session_path = $config->get('system.session.path', '/' . ltrim($uri->rootUrl(false), '/'));
$session_path = $config->get('system.session.path', '/' . ltrim($base_url, '/'));
// Activate admin if we're inside the admin path.
if ($config->get('plugins.admin.enabled')) {
$route = $config->get('plugins.admin.route');
// Uri::route() is not processed yet, let's quickly get what we need
$current_route = str_replace($base_url, '', parse_url($uri->url(true), PHP_URL_PATH));
$base = '/' . trim($route, '/');
if (substr($uri->route(), 0, strlen($base)) == $base) {
if (substr($current_route, 0, strlen($base)) == $base || //handle no language specified
substr($current_route, 3, strlen($base)) == $base || //handle language (en)
substr($current_route, 6, strlen($base)) == $base) { //handle region specific language prefix (en-US)
$session_timeout = $config->get('plugins.admin.session.timeout', 1800);
$is_admin = true;
}
@@ -50,7 +56,7 @@ class Session extends BaseSession
parent::__construct($session_timeout, $session_path);
$domain = $uri->host();
if ($domain == 'localhost') {
if ($domain === 'localhost') {
$domain = '';
}
$secure = $config->get('system.session.secure', false);
@@ -62,4 +68,20 @@ class Session extends BaseSession
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
}
}
// Store something in session temporarily
public function setFlashObject($name, $object)
{
$this->$name = serialize($object);
}
// Return object and remove it from session
public function getFlashObject($name)
{
$object = unserialize($this->$name);
$this->$name = null;
return $object;
}
}

View File

@@ -56,6 +56,19 @@ class Theme extends Plugin
return true;
}
/**
* Simpler getter for the theme blueprint
*
* @return mixed
*/
public function getBlueprint()
{
if (!$this->blueprint) {
$this->loadBlueprint();
}
return $this->blueprint;
}
/**
* Load blueprints.
*/

View File

@@ -151,13 +151,6 @@ class Twig
}
$this->twig->addExtension(new TwigExtension());
// enable the Intl Twig extension if translations are enabled
if (count($config->get('system.languages.supported', [])) > 0) {
if (class_exists('\Twig_Extensions_Extension_Intl')) {
$this->twig->addExtension(new \Twig_Extensions_Extension_Intl());
}
}
$this->grav->fireEvent('onTwigExtensions');
// Set some standard variables for twig

View File

@@ -297,8 +297,11 @@ class TwigExtension extends \Twig_Extension
*
* @return array
*/
public function ksortFilter(array $array)
public function ksortFilter($array)
{
if (is_null($array)) {
$array = [];
}
ksort($array);
return $array;
@@ -322,7 +325,6 @@ class TwigExtension extends \Twig_Extension
*
* @param $date
* @param $long_strings
* @param String
*
* @return boolean
*/

View File

@@ -12,6 +12,7 @@ use Grav\Common\Page\Page;
class Uri
{
const HOSTNAME_REGEX = '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/';
const PARAMS_REGEX = '/\/([^\:\#\/\?]*:[^\:\#\/\?]*)/';
public $url;
@@ -105,7 +106,7 @@ class Uri
{
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
return $uri;
return rawurldecode($uri);
}
private function buildScheme()
@@ -349,22 +350,17 @@ class Uri
private function processParams($uri, $delimiter = ':')
{
if (strpos($uri, $delimiter) !== false) {
$bits = explode('/', $uri);
$path = [];
foreach ($bits as $bit) {
if (strpos($bit, $delimiter) !== false) {
$param = explode($delimiter, $bit);
if (count($param) == 2) {
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
$this->params[$param[0]] = $plain_var;
}
} else {
$path[] = $bit;
preg_match_all(Uri::PARAMS_REGEX, $uri, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$param = explode($delimiter, $match[1]);
if (count($param) == 2) {
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
$this->params[$param[0]] = $plain_var;
$uri = str_replace($match[0], '', $uri);
}
}
$uri = '/' . ltrim(implode('/', $path), '/');
}
return $uri;
}
@@ -687,7 +683,7 @@ class Uri
*
* @return string ip address
*/
public function ip()
public static function ip()
{
if (getenv('HTTP_CLIENT_IP'))
$ipaddress = getenv('HTTP_CLIENT_IP');
@@ -941,20 +937,16 @@ class Uri
$params = [];
if (strpos($uri, $delimiter) !== false) {
$bits = explode('/', $uri);
$path = [];
foreach ($bits as $bit) {
if (strpos($bit, $delimiter) !== false) {
$param = explode($delimiter, $bit);
if (count($param) == 2) {
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
$params[$param[0]] = $plain_var;
}
} else {
$path[] = $bit;
preg_match_all(Uri::PARAMS_REGEX, $uri, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$param = explode($delimiter, $match[1]);
if (count($param) == 2) {
$plain_var = filter_var(rawurldecode($param[1]), FILTER_SANITIZE_STRING);
$params[$param[0]] = $plain_var;
$uri = str_replace($match[0], '', $uri);
}
}
$uri = '/' . ltrim(implode('/', $path), '/');
}
return [$uri, $params];

View File

@@ -88,7 +88,7 @@ class Group extends Data
}
if ($field['type'] == 'array') {
$value = $field['name'];
$arrayValues = Utils::resolve($this->items, $field['name']);
$arrayValues = Utils::getDotNotation($this->items, $field['name']);
if ($arrayValues) {
foreach ($arrayValues as $arrayIndex => $arrayValue) {

View File

@@ -171,7 +171,7 @@ class User extends Data
//Check user access level
if ($this->get('access')) {
if (Utils::resolve($this->get('access'), $action) !== null) {
if (Utils::getDotNotation($this->get('access'), $action) !== null) {
$permission = $this->get("access.{$action}");
$return = Utils::isPositive($permission);
}

View File

@@ -380,7 +380,7 @@ abstract class Utils
$pretty_offset = "UTC${offset_prefix}${offset_formatted}";
$timezone_list[$timezone] = "(${pretty_offset}) $timezone";
$timezone_list[$timezone] = "(${pretty_offset}) ".str_replace('_', ' ', $timezone);
}
return $timezone_list;
@@ -462,28 +462,12 @@ abstract class Utils
}
/**
* Get value of an array element using dot notation
* @deprecated Use getDotNotation() method instead
*
* @param array $array the Array to check
* @param string $path the dot notation path to check
* @param mixed $default a value to be returned if $path is not found in $array
*
* @return mixed the value found
*/
public static function resolve(array $array, $path, $default = null)
{
$current = $array;
$p = strtok($path, '.');
while ($p !== false) {
if (!isset($current[$p])) {
return $default;
}
$current = $current[$p];
$p = strtok('.');
}
return $current;
return static::getDotNotation($array, $path, $default);
}
/**
@@ -652,4 +636,64 @@ abstract class Utils
return false;
}
/**
* Get a portion of an array (passed by reference) with dot-notation key
*
* @param $array
* @param $key
* @param null $default
* @return mixed
*/
public static function getDotNotation($array, $key, $default = null)
{
if (is_null($key)) return $array;
if (isset($array[$key])) return $array[$key];
foreach (explode('.', $key) as $segment)
{
if ( ! is_array($array) ||
! array_key_exists($segment, $array))
{
return $default;
}
$array = $array[$segment];
}
return $array;
}
/**
* Set portion of array (passed by reference) for a dot-notation key
* and set the value
*
* @param $array
* @param $key
* @param $value
* @return mixed
*/
public static function setDotNotation(&$array, $key, $value)
{
if (is_null($key)) return $array = $value;
$keys = explode('.', $key);
while (count($keys) > 1)
{
$key = array_shift($keys);
if ( ! isset($array[$key]) || ! is_array($array[$key]))
{
$array[$key] = array();
}
$array =& $array[$key];
}
$array[array_shift($keys)] = $value;
return $array;
}
}

View File

@@ -91,6 +91,10 @@ class CleanCommand extends Command
'vendor/ircmaxell/password-compat/version-test.php',
'vendor/ircmaxell/password-compat/.travis.yml',
'vendor/ircmaxell/password-compat/test',
'vendor/matthiasmullie/minify/bin',
'vendor/matthiasmullie/minify/composer.json',
'vendor/matthiasmullie/minify/CONTRIBUTING.md',
'vendor/matthiasmullie/path-converter/composer.json',
'vendor/maximebf/debugbar/bower.json',
'vendor/maximebf/debugbar/composer.json',
'vendor/maximebf/debugbar/.bowerrc',
@@ -103,21 +107,6 @@ class CleanCommand extends Command
'vendor/monolog/monolog/doc',
'vendor/monolog/monolog/phpunit.xml.dist',
'vendor/monolog/monolog/tests',
'vendor/mrclay/minify/.editorconfig',
'vendor/mrclay/minify/.git',
'vendor/mrclay/minify/.gitignore',
'vendor/mrclay/minify/composer.json',
'vendor/mrclay/minify/min_extras',
'vendor/mrclay/minify/min_unit_tests',
'vendor/mrclay/minify/min/.htaccess',
'vendor/mrclay/minify/min/builder',
'vendor/mrclay/minify/min/config-test.php',
'vendor/mrclay/minify/min/config.php',
'vendor/mrclay/minify/min/groupsConfig.php',
'vendor/mrclay/minify/min/index.php',
'vendor/mrclay/minify/min/quick-test.css',
'vendor/mrclay/minify/min/quick-test.js',
'vendor/mrclay/minify/min/utils.php',
'vendor/pimple/pimple/.gitignore',
'vendor/pimple/pimple/.travis.yml',
'vendor/pimple/pimple/composer.json',

View File

@@ -6,6 +6,7 @@ use Grav\Common\GPM\GPM;
use Grav\Common\GPM\Installer;
use Grav\Common\GPM\Response;
use Grav\Common\GPM\Remote\Package as Package;
use Grav\Common\Grav;
use Grav\Common\Utils;
use Grav\Console\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -530,7 +531,8 @@ class InstallCommand extends ConsoleCommand
*/
private function downloadPackage($package)
{
$this->tmp = CACHE_DIR . DS . 'tmp/Grav-' . uniqid();
$cache_dir = Grav::instance()['locator']->findResource('cache://', true);
$this->tmp = $cache_dir . DS . 'tmp/Grav-' . uniqid();
$filename = $package->slug . basename($package->zipball_url);
$output = Response::get($package->zipball_url, [], [$this, 'progress']);

View File

@@ -5,6 +5,7 @@ use Grav\Common\Filesystem\Folder;
use Grav\Common\GPM\Installer;
use Grav\Common\GPM\Response;
use Grav\Common\GPM\Upgrader;
use Grav\Common\Grav;
use Grav\Console\ConsoleCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputOption;
@@ -173,7 +174,8 @@ class SelfupgradeCommand extends ConsoleCommand
*/
private function download($package)
{
$this->tmp = CACHE_DIR . DS . 'tmp/Grav-' . uniqid();
$cache_dir = Grav::instance()['locator']->findResource('cache://', true);
$this->tmp = $cache_dir . DS . 'tmp/Grav-' . uniqid();
$output = Response::get($package['download'], [], [$this, 'progress']);
Folder::mkdir($this->tmp);

View File

@@ -186,6 +186,9 @@ class UninstallCommand extends ConsoleCommand
if (is_array($dependency)) {
$dependency = $dependency['name'];
}
if ($dependency === 'grav') {
continue;
}
$dependencyPackage = $this->gpm->findPackage($dependency);
$question = new ConfirmationQuestion(" | '- Delete dependency <cyan>" . $dependency . "</cyan> too? [y|N] ", false);

View File

@@ -82,9 +82,9 @@ class VersionCommand extends ConsoleCommand
}
$package_yaml = Yaml::parse(file_get_contents($blueprints_path));
$currentlyInstalledVersion = $package_yaml['version'];
$version = $package_yaml['version'];
if (!$currentlyInstalledVersion) {
if (!$version) {
continue;
}
@@ -101,7 +101,7 @@ class VersionCommand extends ConsoleCommand
$updatable = $updatable ?: '';
if ($installed || $package == 'grav') {
$this->output->writeln('You are running <white>' . $name . '</white> v<cyan>' . $currentlyInstalledVersion . '</cyan>' . $updatable);
$this->output->writeln('You are running <white>' . $name . '</white> v<cyan>' . $version . '</cyan>' . $updatable);
} else {
$this->output->writeln('Package <red>' . $package . '</red> not found');
}

View File

@@ -289,6 +289,8 @@ class ParsedownTest extends \Codeception\TestCase\Test
$this->parsedown->text('[cnn.com](http://www.cnn.com)'));
$this->assertSame('<p><a href="https://www.google.com">google.com</a></p>',
$this->parsedown->text('[google.com](https://www.google.com)'));
$this->assertSame('<p><a href="https://github.com/getgrav/grav/issues/new?title=%5Badd-resource%5D%20New%20Plugin%2FTheme&body=Hello%20%2A%2AThere%2A%2A">complex url</a></p>',
$this->parsedown->text('[complex url](https://github.com/getgrav/grav/issues/new?title=[add-resource]%20New%20Plugin/Theme&body=Hello%20**There**)'));
}
public function testExternalLinksSubDir()

View File

@@ -148,6 +148,18 @@ class UriTest extends \Codeception\TestCase\Test
$this->assertSame('/ueper:xxx/test:yyy', $this->uri->params());
$this->assertSame('/ueper:xxx', $this->uri->params('ueper'));
$this->assertSame('/test:yyy', $this->uri->params('test'));
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx++/test:yyy')->init();
$this->assertSame('/ueper:xxx++/test:yyy', $this->uri->params());
$this->assertSame('/ueper:xxx++', $this->uri->params('ueper'));
$this->assertSame('/test:yyy', $this->uri->params('test'));
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx++/test:yyy#something')->init();
$this->assertSame('/ueper:xxx++/test:yyy', $this->uri->params());
$this->assertSame('/ueper:xxx++', $this->uri->params('ueper'));
$this->assertSame('/test:yyy', $this->uri->params('test'));
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx++/test:yyy?foo=bar')->init();
$this->assertSame('/ueper:xxx++/test:yyy', $this->uri->params());
$this->assertSame('/ueper:xxx++', $this->uri->params('ueper'));
$this->assertSame('/test:yyy', $this->uri->params('test'));
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x')->init();
$this->assertSame(null, $this->uri->params());
$this->assertSame(null, $this->uri->params('ueper'));
@@ -175,6 +187,10 @@ class UriTest extends \Codeception\TestCase\Test
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx/test:yyy')->init();
$this->assertSame('xxx', $this->uri->param('ueper'));
$this->assertSame('yyy', $this->uri->param('test'));
$this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx++/test:yy%20y/foo:bar_baz-bank')->init();
$this->assertSame('xxx++', $this->uri->param('ueper'));
$this->assertSame('yy y', $this->uri->param('test'));
$this->assertSame('bar_baz-bank', $this->uri->param('foo'));
}
public function testFragment()

View File

@@ -235,6 +235,41 @@ class UtilsTest extends \Codeception\TestCase\Test
$this->assertEquals('test2Value', Utils::resolve($array, 'test.test2'));
}
public function testGetDotNotation()
{
$array = [
'test' => [
'test2' => 'test2Value',
'test3' => [
'test4' => 'test4Value'
]
]
];
$this->assertEquals('test2Value', Utils::getDotNotation($array, 'test.test2'));
$this->assertEquals('test4Value', Utils::getDotNotation($array, 'test.test3.test4'));
$this->assertEquals('defaultValue', Utils::getDotNotation($array, 'test.non_existent', 'defaultValue'));
}
public function testSetDotNotation()
{
$array = [
'test' => [
'test2' => 'test2Value',
'test3' => [
'test4' => 'test4Value'
]
]
];
$new = [
'test1' => 'test1Value'
];
Utils::setDotNotation($array, 'test.test3.test4' , $new);
$this->assertEquals('test1Value', $array['test']['test3']['test4']['test1']);
}
public function testIsPositive()
{
$this->assertTrue(Utils::isPositive(true));
@@ -265,4 +300,4 @@ class UtilsTest extends \Codeception\TestCase\Test
{
$this->assertTrue(Utils::verifyNonce(Utils::getNonce('test-action'), 'test-action'));
}
}
}

View File

@@ -7,7 +7,7 @@ title: Home
Congratulations! You have installed the **Base Grav Package** that provides a **simple page** and the default **antimatter** theme to get you started.
>>>>> If you want a more **full-featured** base install, you should check out [**Skeleton** packages available in the downloads](http://getgrav.org/downloads).
!!! If you want a more **full-featured** base install, you should check out [**Skeleton** packages available in the downloads](http://getgrav.org/downloads).
### Find out all about Grav
@@ -36,4 +36,4 @@ Creating a new page is a simple affair in **Grav**. Simply follow these simple
3. Save this file in the `user/pages/02.mypage/` folder as `default.md`. This will tell **Grav** to render the page using the **default** template.
4. That is it! Reload your browser to see your new page in the menu.
>>> NOTE: The page will automatically show up in the Menu after the "Home" menu item. If you wish to change the name that shows up in the Menu, simple add: `menu: My Page` between the dashes in the page content. This is called the YAML front matter, and it is where you configure page-specific options.
! NOTE: The page will automatically show up in the Menu after the "Home" menu item. If you wish to change the name that shows up in the Menu, simple add: `menu: My Page` between the dashes in the page content. This is called the YAML front matter, and it is where you configure page-specific options.