mirror of
https://github.com/getgrav/grav.git
synced 2025-12-05 15:29:57 +01:00
Compare commits
166 Commits
1.1.0-beta
...
1.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1232ecacf7 | ||
|
|
060b55bc6e | ||
|
|
deda94a779 | ||
|
|
f99f42a979 | ||
|
|
b3f35fb16e | ||
|
|
1c462e8784 | ||
|
|
07d95d189c | ||
|
|
d8688975a2 | ||
|
|
74f6890ce8 | ||
|
|
ab17fb2fdd | ||
|
|
2bb6d1d4db | ||
|
|
07beafc679 | ||
|
|
a40c61a8fa | ||
|
|
e13ded1a5d | ||
|
|
98534bc836 | ||
|
|
9b673591db | ||
|
|
496be79aa1 | ||
|
|
c0fcac3393 | ||
|
|
4d43812c77 | ||
|
|
5a65269ef3 | ||
|
|
1a1b29116d | ||
|
|
6e6ff7c0b4 | ||
|
|
5871d1a823 | ||
|
|
cdb575c1bc | ||
|
|
8b6c77b8dd | ||
|
|
704521960e | ||
|
|
231bc816f0 | ||
|
|
95537f3a32 | ||
|
|
82f453ea2f | ||
|
|
b0db8c89dd | ||
|
|
3594e000b2 | ||
|
|
f8adf87544 | ||
|
|
b193fcd2ed | ||
|
|
6dfa1542fb | ||
|
|
2282d2c69c | ||
|
|
5a1d1a7622 | ||
|
|
6c042b4804 | ||
|
|
9b7b953684 | ||
|
|
0d8c69b615 | ||
|
|
29f6da675d | ||
|
|
8e7cc01e75 | ||
|
|
1fb2d7333c | ||
|
|
3529d19c8f | ||
|
|
a6eef19297 | ||
|
|
6a169bf5f4 | ||
|
|
05da8e90bf | ||
|
|
c5b5423d5c | ||
|
|
10212a310f | ||
|
|
943d2c9892 | ||
|
|
ce499c795b | ||
|
|
3d53166651 | ||
|
|
1bf4428752 | ||
|
|
d1cb75b6a2 | ||
|
|
ac67fb7337 | ||
|
|
59bbaa5f33 | ||
|
|
f845943c47 | ||
|
|
f8964ab908 | ||
|
|
fedf7f0903 | ||
|
|
6e516e8971 | ||
|
|
d42786484f | ||
|
|
dbb9725567 | ||
|
|
b5cfca1ba1 | ||
|
|
5931857416 | ||
|
|
18d320f72e | ||
|
|
0e0ed38168 | ||
|
|
2ba1875cc1 | ||
|
|
baacfa794a | ||
|
|
ef456888f8 | ||
|
|
858fbbe41c | ||
|
|
ee567fc1dc | ||
|
|
cd30e6a331 | ||
|
|
35c7698139 | ||
|
|
471cf7fe31 | ||
|
|
88fad44dca | ||
|
|
cb28112d94 | ||
|
|
822a111919 | ||
|
|
d6a47af84a | ||
|
|
a24b7faef5 | ||
|
|
395e640e39 | ||
|
|
db082e4e62 | ||
|
|
4de9c94bd5 | ||
|
|
7fc2f20f1b | ||
|
|
1c12bb5fc1 | ||
|
|
a485644c38 | ||
|
|
32cf73e865 | ||
|
|
e4a3d6a3b9 | ||
|
|
4fbf4329fd | ||
|
|
43c0ac275f | ||
|
|
a381e5bb66 | ||
|
|
971c5d326d | ||
|
|
4c687ee368 | ||
|
|
7b56041dad | ||
|
|
d7f286f601 | ||
|
|
581bbaf19c | ||
|
|
6c9037e125 | ||
|
|
da0f9cd4d9 | ||
|
|
6ed1f767b9 | ||
|
|
13c5035386 | ||
|
|
5acfdee876 | ||
|
|
7a3ae9186b | ||
|
|
02f863ad2c | ||
|
|
d048057249 | ||
|
|
5fb6b634e9 | ||
|
|
c7fe13aa6a | ||
|
|
36661a88d0 | ||
|
|
e8f3a43ded | ||
|
|
78891add6a | ||
|
|
892fb83a32 | ||
|
|
841d4727ef | ||
|
|
a3e31c786e | ||
|
|
24bc4b2644 | ||
|
|
0b81fda01c | ||
|
|
a3ec59d678 | ||
|
|
2ce137eb3e | ||
|
|
d18aa3e11e | ||
|
|
f549b27dfc | ||
|
|
83bbc497a8 | ||
|
|
10d301a179 | ||
|
|
18a8483522 | ||
|
|
daebf05f9b | ||
|
|
7e4dad1cb1 | ||
|
|
b3755b371f | ||
|
|
4cba419d6d | ||
|
|
57544f6fe3 | ||
|
|
f449c560c4 | ||
|
|
77d03b6a46 | ||
|
|
d9ebf3580a | ||
|
|
16527218b9 | ||
|
|
f4b7e36763 | ||
|
|
6bd7641862 | ||
|
|
97ffb87d69 | ||
|
|
504f3df857 | ||
|
|
cfe1734d50 | ||
|
|
a4bc30d725 | ||
|
|
7d6ffe01a9 | ||
|
|
0e08f97f46 | ||
|
|
b3db9876e0 | ||
|
|
b25eeb9586 | ||
|
|
966308b14a | ||
|
|
6959012a0f | ||
|
|
09f766bcf5 | ||
|
|
62f794e6cd | ||
|
|
ad74446a89 | ||
|
|
eacdea5377 | ||
|
|
896808c824 | ||
|
|
7b6cadbeeb | ||
|
|
652c5cd4bd | ||
|
|
b48449d782 | ||
|
|
8ca14c7c65 | ||
|
|
4549574908 | ||
|
|
f0145aa659 | ||
|
|
08cbd9553f | ||
|
|
747daa46f1 | ||
|
|
4a5a400b89 | ||
|
|
fcdd0bc0e9 | ||
|
|
f7696b61d3 | ||
|
|
2bb23efa7c | ||
|
|
e4e0c06ea8 | ||
|
|
dba7347c1e | ||
|
|
50c6e81c09 | ||
|
|
e62ff07726 | ||
|
|
695793b752 | ||
|
|
8de55a745d | ||
|
|
8bba0fd332 | ||
|
|
a7a5625a8b | ||
|
|
f65633043a |
@@ -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
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
||||
# Composer
|
||||
.composer
|
||||
vendor/
|
||||
/vendor
|
||||
|
||||
# Sass
|
||||
.sass-cache
|
||||
|
||||
105
CHANGELOG.md
105
CHANGELOG.md
@@ -1,3 +1,106 @@
|
||||
# v1.1.2
|
||||
## 08/10/2016
|
||||
|
||||
1. [](#new)
|
||||
* Allow forcing SSL by setting `system.force_ssl` (Force SSL in the Admin System Config) [#899](https://github.com/getgrav/grav/pull/899)
|
||||
1. [](#improved)
|
||||
* Improved `authorize` Twig extension to accept a nested array of authorizations [#948](https://github.com/getgrav/grav/issues/948)
|
||||
* Don't add timestamps on remote assets as it can cause conflicts
|
||||
* Grav now looks at types from `media.yaml` when retrieving page mime types [#966](https://github.com/getgrav/grav/issues/966)
|
||||
* Added support for dumping exceptions in the Debugger
|
||||
1. [](#bugfix)
|
||||
* Fixed `Folder::delete` method to recursively remove files and folders and causing Upgrade to fail.
|
||||
* Fix [#952](https://github.com/getgrav/grav/issues/952) hyphenize the session name.
|
||||
* If no parent is set and siblings collection is called, return a new and empty collection [grav-plugin-sitemap/issues/22](https://github.com/getgrav/grav-plugin-sitemap/issues/22)
|
||||
* Prevent exception being thrown when calling the Collator constructor failed in a Windows environment with the Intl PHP Extension enabled [#961](https://github.com/getgrav/grav/issues/961)
|
||||
* Fix for markdown images not properly rendering `id` attribute [#956](https://github.com/getgrav/grav/issues/956)
|
||||
|
||||
# v1.1.1
|
||||
## 07/16/2016
|
||||
|
||||
1. [](#improved)
|
||||
* Made `paramsRegex()` static to allow it to be called statically
|
||||
1. [](#bugfix)
|
||||
* Fixed backup when using very long site titles with invalid characters [grav-plugin-admin#701](https://github.com/getgrav/grav-plugin-admin/issues/701)
|
||||
* Fixed a typo in the `webserver-configs/nginx.conf` example
|
||||
|
||||
# v1.1.0
|
||||
## 07/14/2016
|
||||
|
||||
1. [](#improved)
|
||||
* Added support for validation of multiple email in the `type: email` field [grav-plugin-email#31](https://github.com/getgrav/grav-plugin-email/issues/31)
|
||||
* Unified PHP code header styling
|
||||
* Added 6 more languages and updated language codes
|
||||
* set default "releases" option to `stable`
|
||||
1. [](#bugfix)
|
||||
* Fix backend validation for file fields marked as required [grav-plugin-form#78](https://github.com/getgrav/grav-plugin-form/issues/78)
|
||||
|
||||
# v1.1.0-rc.3
|
||||
## 06/21/2016
|
||||
|
||||
1. [](#new)
|
||||
* Add a onPageFallBackUrl event when starting the fallbackUrl() method to allow the Login plugin to protect the page media
|
||||
* Conveniently allow ability to retrieve user information via config object [#913](https://github.com/getgrav/grav/pull/913) - @Vivalldi
|
||||
* Grav served images can now use header caching [#905](https://github.com/getgrav/grav/pull/905)
|
||||
1. [](#improved)
|
||||
* Take asset modification timestamp into consideration in pipelining [#917](https://github.com/getgrav/grav/pull/917) - @Sommerregen
|
||||
1. [](#bugfix)
|
||||
* Respect `enable_asset_timestamp` settings for pipelined Assets [#906](https://github.com/getgrav/grav/issues/906)
|
||||
* Fixed collections end dates for 32-bit systems [#902](https://github.com/getgrav/grav/issues/902)
|
||||
* Fixed a recent regression (1.1.0-rc1) with parameter separator different than `:`
|
||||
|
||||
# v1.1.0-rc.2
|
||||
## 06/14/2016
|
||||
|
||||
1. [](#new)
|
||||
* Added getters and setters for Assets to allow manipulation of CSS/JS/Collection based assets via plugins [#876](https://github.com/getgrav/grav/issues/876)
|
||||
1. [](#improved)
|
||||
* Pass the exception to the `onFatalException()` event
|
||||
* Updated to latest jQuery 2.2.4 release
|
||||
* Moved list items in `system/config/media.yaml` config into a `types:` key which allows you delete default items.
|
||||
* Updated `webserver-configs/nginx.conf` with `try_files` fix from @mrhein and @rondlite [#743](https://github.com/getgrav/grav/pull/743)
|
||||
* Updated cache references to include `memecache` and `redis` [#887](https://github.com/getgrav/grav/issues/887)
|
||||
* Updated composer libraries
|
||||
1. [](#bugfix)
|
||||
* Fixed `Utils::normalizePath()` that was truncating 0's [#882](https://github.com/getgrav/grav/issues/882)
|
||||
|
||||
# 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
|
||||
|
||||
@@ -731,7 +834,7 @@
|
||||
* Improved query string handling
|
||||
* Optimization to image handling supporting URL encoded filenames
|
||||
* Use global `composer` when available rather than Grv provided one
|
||||
* Use `PHP_BINARY` contant rather than `php` executable
|
||||
* Use `PHP_BINARY` constant rather than `php` executable
|
||||
* Updated Doctrine Cache library
|
||||
* Updated Symfony libraries
|
||||
* Moved `convertUrl()` method to Uri object
|
||||
|
||||
@@ -55,6 +55,8 @@ Guidelines for bug reports:
|
||||
6. **Isolate the problem** — create a [reduced test
|
||||
case](http://css-tricks.com/reduced-test-cases/) and provide a step-by-step instruction set on how to recreate the problem. Include code samples, page snippets or yaml configurations if needed.
|
||||
|
||||
7. **Check the problem on Grav 1.1** — if you're using Grav 1.0, latest stable release, please also check if you can replicate the issue on Grav 1.1 RC as many bugs are already solved in the next Grav release.
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more
|
||||
information. Please try to be as detailed as possible in your report.
|
||||
|
||||
@@ -119,4 +121,4 @@ accurate comments, etc.) and any other requirements.
|
||||
See [Using Pull Request](https://help.github.com/articles/using-pull-requests/) and [Fork a Repo](https://help.github.com/articles/fork-a-repo/) if you're not familiar with Pull Requests.
|
||||
|
||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
|
||||
license your work under the same license as that used by the project.
|
||||
license your work under the same license as that used by the project.
|
||||
|
||||
@@ -10,7 +10,7 @@ The underlying architecture of Grav is designed to use well-established and _bes
|
||||
* [Markdown](http://en.wikipedia.org/wiki/Markdown): for easy content creation
|
||||
* [YAML](http://yaml.org): for simple configuration
|
||||
* [Parsedown](http://parsedown.org/): for fast Markdown and Markdown Extra support
|
||||
* [Doctrine Cache](http://docs.doctrine-project.org/en/2.0.x/reference/caching.html): layer for performance
|
||||
* [Doctrine Cache](http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/caching.html): layer for performance
|
||||
* [Pimple Dependency Injection Container](http://pimple.sensiolabs.org/): for extensibility and maintainability
|
||||
* [Symfony Event Dispatcher](http://symfony.com/doc/current/components/event_dispatcher/introduction.html): for plugin event handling
|
||||
* [Symfony Console](http://symfony.com/doc/current/components/console/introduction.html): for CLI interface
|
||||
|
||||
@@ -17,16 +17,17 @@
|
||||
"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": "*"
|
||||
"ext-curl": "*",
|
||||
"ext-zip": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^2.1",
|
||||
|
||||
752
composer.lock
generated
752
composer.lock
generated
File diff suppressed because it is too large
Load Diff
10
index.php
10
index.php
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Core
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav;
|
||||
|
||||
// Ensure vendor libraries exist
|
||||
@@ -8,6 +15,7 @@ if (!is_file($autoload)) {
|
||||
}
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use RocketTheme\Toolbox\Event\Event;
|
||||
|
||||
// Register the auto-loader.
|
||||
$loader = require_once $autoload;
|
||||
@@ -36,6 +44,6 @@ $grav = Grav::instance(
|
||||
try {
|
||||
$grav->process();
|
||||
} catch (\Exception $e) {
|
||||
$grav->fireEvent('onFatalException');
|
||||
$grav->fireEvent('onFatalException', new Event(['exception' => $e]));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
8
system/assets/jquery/jquery-2.x.min.js
vendored
8
system/assets/jquery/jquery-2.x.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -479,9 +479,54 @@ form:
|
||||
auto: Auto detect
|
||||
file: File
|
||||
apc: APC
|
||||
xcache: XCache
|
||||
memcache: MemCache
|
||||
apcu: APCu
|
||||
xcache: Xcache
|
||||
memcache: Memcache
|
||||
memcached: Memcached
|
||||
wincache: WinCache
|
||||
redis: Redis
|
||||
|
||||
cache.memcache.server:
|
||||
type: text
|
||||
size: medium
|
||||
label: PLUGIN_ADMIN.MEMCACHE_SERVER
|
||||
help: PLUGIN_ADMIN.MEMCACHE_SERVER_HELP
|
||||
placeholder: "localhost"
|
||||
|
||||
cache.memcache.port:
|
||||
type: text
|
||||
size: small
|
||||
label: PLUGIN_ADMIN.MEMCACHE_PORT
|
||||
help: PLUGIN_ADMIN.MEMCACHE_PORT_HELP
|
||||
placeholder: "11211"
|
||||
|
||||
cache.memcached.server:
|
||||
type: text
|
||||
size: medium
|
||||
label: PLUGIN_ADMIN.MEMCACHED_SERVER
|
||||
help: PLUGIN_ADMIN.MEMCACHED_SERVER_HELP
|
||||
placeholder: "localhost"
|
||||
|
||||
cache.memcached.port:
|
||||
type: text
|
||||
size: small
|
||||
label: PLUGIN_ADMIN.MEMCACHED_PORT
|
||||
help: PLUGIN_ADMIN.MEMCACHED_PORT_HELP
|
||||
placeholder: "11211"
|
||||
|
||||
cache.redis.server:
|
||||
type: text
|
||||
size: medium
|
||||
label: PLUGIN_ADMIN.REDIS_SERVER
|
||||
help: PLUGIN_ADMIN.REDIS_SERVER_HELP
|
||||
placeholder: "localhost"
|
||||
|
||||
cache.redis.port:
|
||||
type: text
|
||||
size: small
|
||||
label: PLUGIN_ADMIN.REDIS_PORT
|
||||
help: PLUGIN_ADMIN.REDIS_PORT_HELP
|
||||
placeholder: "6379"
|
||||
|
||||
cache.prefix:
|
||||
type: text
|
||||
@@ -510,7 +555,6 @@ form:
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
|
||||
twig:
|
||||
type: section
|
||||
title: PLUGIN_ADMIN.TWIG_TEMPLATING
|
||||
@@ -974,3 +1018,14 @@ form:
|
||||
options:
|
||||
':': ': (default)'
|
||||
';': '; (for Apache running on Windows)'
|
||||
|
||||
force_ssl:
|
||||
type: toggle
|
||||
label: PLUGIN_ADMIN.FORCE_SSL
|
||||
highlight: 0
|
||||
help: PLUGIN_ADMIN.FORCE_SSL_HELP
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
@@ -139,7 +139,7 @@ form:
|
||||
label: PLUGIN_ADMIN.PARENT
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\admin::route'
|
||||
data-default@: '\Grav\Plugin\admin::rawRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,8 +29,8 @@ form:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PAGE
|
||||
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'
|
||||
validate:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,7 +31,7 @@ form:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parents'
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\admin::getLastPageRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
|
||||
@@ -24,7 +24,7 @@ form:
|
||||
type: select
|
||||
label: PLUGIN_ADMIN.PARENT_PAGE
|
||||
classes: fancy
|
||||
data-options@: '\Grav\Common\Page\Pages::parents'
|
||||
data-options@: '\Grav\Common\Page\Pages::parentsRawRoutes'
|
||||
data-default@: '\Grav\Plugin\admin::getLastPageRoute'
|
||||
options:
|
||||
'/': PLUGIN_ADMIN.DEFAULT_OPTION_ROOT
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,202 +1,203 @@
|
||||
defaults:
|
||||
type: file
|
||||
thumb: media/thumb.png
|
||||
mime: application/octet-stream
|
||||
image:
|
||||
filters:
|
||||
default:
|
||||
- enableProgressive
|
||||
types:
|
||||
defaults:
|
||||
type: file
|
||||
thumb: media/thumb.png
|
||||
mime: application/octet-stream
|
||||
image:
|
||||
filters:
|
||||
default:
|
||||
- enableProgressive
|
||||
|
||||
jpg:
|
||||
type: image
|
||||
thumb: media/thumb-jpg.png
|
||||
mime: image/jpeg
|
||||
jpe:
|
||||
type: image
|
||||
thumb: media/thumb-jpg.png
|
||||
mime: image/jpeg
|
||||
jpeg:
|
||||
type: image
|
||||
thumb: media/thumb-jpeg.png
|
||||
mime: image/jpeg
|
||||
png:
|
||||
type: image
|
||||
thumb: media/thumb-png.png
|
||||
mime: image/png
|
||||
gif:
|
||||
type: animated
|
||||
thumb: media/thumb-gif.png
|
||||
mime: image/gif
|
||||
jpg:
|
||||
type: image
|
||||
thumb: media/thumb-jpg.png
|
||||
mime: image/jpeg
|
||||
jpe:
|
||||
type: image
|
||||
thumb: media/thumb-jpg.png
|
||||
mime: image/jpeg
|
||||
jpeg:
|
||||
type: image
|
||||
thumb: media/thumb-jpeg.png
|
||||
mime: image/jpeg
|
||||
png:
|
||||
type: image
|
||||
thumb: media/thumb-png.png
|
||||
mime: image/png
|
||||
gif:
|
||||
type: animated
|
||||
thumb: media/thumb-gif.png
|
||||
mime: image/gif
|
||||
|
||||
svg:
|
||||
type: vector
|
||||
thumb: media/thumb.png
|
||||
mime: image/svg+xml
|
||||
svg:
|
||||
type: vector
|
||||
thumb: media/thumb.png
|
||||
mime: image/svg+xml
|
||||
|
||||
mp4:
|
||||
type: video
|
||||
thumb: media/thumb-mp4.png
|
||||
mime: video/mp4
|
||||
mov:
|
||||
type: video
|
||||
thumb: media/thumb-mov.png
|
||||
mime: video/quicktime
|
||||
m4v:
|
||||
type: video
|
||||
thumb: media/thumb-m4v.png
|
||||
mime: video/x-m4v
|
||||
swf:
|
||||
type: video
|
||||
thumb: media/thumb-swf.png
|
||||
mime: video/x-flv
|
||||
flv:
|
||||
type: video
|
||||
thumb: media/thumb-flv.png
|
||||
mime: video/x-flv
|
||||
webm:
|
||||
type: video
|
||||
thumb: media/thumb.png
|
||||
mime: video/webm
|
||||
ogv:
|
||||
type: video
|
||||
thumb: media/thumb-ogg.png
|
||||
mime: video/ogg
|
||||
mp4:
|
||||
type: video
|
||||
thumb: media/thumb-mp4.png
|
||||
mime: video/mp4
|
||||
mov:
|
||||
type: video
|
||||
thumb: media/thumb-mov.png
|
||||
mime: video/quicktime
|
||||
m4v:
|
||||
type: video
|
||||
thumb: media/thumb-m4v.png
|
||||
mime: video/x-m4v
|
||||
swf:
|
||||
type: video
|
||||
thumb: media/thumb-swf.png
|
||||
mime: video/x-flv
|
||||
flv:
|
||||
type: video
|
||||
thumb: media/thumb-flv.png
|
||||
mime: video/x-flv
|
||||
webm:
|
||||
type: video
|
||||
thumb: media/thumb.png
|
||||
mime: video/webm
|
||||
ogv:
|
||||
type: video
|
||||
thumb: media/thumb-ogg.png
|
||||
mime: video/ogg
|
||||
|
||||
mp3:
|
||||
type: audio
|
||||
thumb: media/thumb-mp3.png
|
||||
mime: audio/mp3
|
||||
ogg:
|
||||
type: audio
|
||||
thumb: media/thumb-ogg.png
|
||||
mime: audio/ogg
|
||||
wma:
|
||||
type: audio
|
||||
thumb: media/thumb-wma.png
|
||||
mime: audio/wma
|
||||
m4a:
|
||||
type: audio
|
||||
thumb: media/thumb-m4a.png
|
||||
mime: audio/m4a
|
||||
wav:
|
||||
type: audio
|
||||
thumb: media/thumb-wav.png
|
||||
mime: audio/wav
|
||||
aiff:
|
||||
type: audio
|
||||
mime: audio/aiff
|
||||
aif:
|
||||
type: audio
|
||||
mime: audio/aif
|
||||
mp3:
|
||||
type: audio
|
||||
thumb: media/thumb-mp3.png
|
||||
mime: audio/mp3
|
||||
ogg:
|
||||
type: audio
|
||||
thumb: media/thumb-ogg.png
|
||||
mime: audio/ogg
|
||||
wma:
|
||||
type: audio
|
||||
thumb: media/thumb-wma.png
|
||||
mime: audio/wma
|
||||
m4a:
|
||||
type: audio
|
||||
thumb: media/thumb-m4a.png
|
||||
mime: audio/m4a
|
||||
wav:
|
||||
type: audio
|
||||
thumb: media/thumb-wav.png
|
||||
mime: audio/wav
|
||||
aiff:
|
||||
type: audio
|
||||
mime: audio/aiff
|
||||
aif:
|
||||
type: audio
|
||||
mime: audio/aif
|
||||
|
||||
txt:
|
||||
type: file
|
||||
thumb: media/thumb-txt.png
|
||||
mime: text/plain
|
||||
xml:
|
||||
type: file
|
||||
thumb: media/thumb-xml.png
|
||||
mime: application/xml
|
||||
doc:
|
||||
type: file
|
||||
thumb: media/thumb-doc.png
|
||||
mime: application/msword
|
||||
docx:
|
||||
type: file
|
||||
mime: application/msword
|
||||
xls:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlt:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlm:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xld:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xla:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlc:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlw:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xll:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
ppt:
|
||||
type: file
|
||||
mime: application/vnd.ms-powerpoint
|
||||
pps:
|
||||
type: file
|
||||
mime: application/vnd.ms-powerpoint
|
||||
rtf:
|
||||
type: file
|
||||
mime: application/rtf
|
||||
txt:
|
||||
type: file
|
||||
thumb: media/thumb-txt.png
|
||||
mime: text/plain
|
||||
xml:
|
||||
type: file
|
||||
thumb: media/thumb-xml.png
|
||||
mime: application/xml
|
||||
doc:
|
||||
type: file
|
||||
thumb: media/thumb-doc.png
|
||||
mime: application/msword
|
||||
docx:
|
||||
type: file
|
||||
mime: application/msword
|
||||
xls:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlt:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlm:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xld:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xla:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlc:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xlw:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
xll:
|
||||
type: file
|
||||
mime: application/vnd.ms-excel
|
||||
ppt:
|
||||
type: file
|
||||
mime: application/vnd.ms-powerpoint
|
||||
pps:
|
||||
type: file
|
||||
mime: application/vnd.ms-powerpoint
|
||||
rtf:
|
||||
type: file
|
||||
mime: application/rtf
|
||||
|
||||
bmp:
|
||||
type: file
|
||||
mime: image/bmp
|
||||
tiff:
|
||||
type: file
|
||||
mime: image/tiff
|
||||
mpeg:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
mpg:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
mpe:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
avi:
|
||||
type: file
|
||||
mime: video/msvideo
|
||||
wmv:
|
||||
type: file
|
||||
mime: video/x-ms-wmv
|
||||
bmp:
|
||||
type: file
|
||||
mime: image/bmp
|
||||
tiff:
|
||||
type: file
|
||||
mime: image/tiff
|
||||
mpeg:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
mpg:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
mpe:
|
||||
type: file
|
||||
mime: video/mpeg
|
||||
avi:
|
||||
type: file
|
||||
mime: video/msvideo
|
||||
wmv:
|
||||
type: file
|
||||
mime: video/x-ms-wmv
|
||||
|
||||
html:
|
||||
type: file
|
||||
thumb: media/thumb-html.png
|
||||
mime: text/html
|
||||
htm:
|
||||
type: file
|
||||
thumb: media/thumb-html.png
|
||||
mime: text/html
|
||||
pdf:
|
||||
type: file
|
||||
thumb: media/thumb-pdf.png
|
||||
mime: application/pdf
|
||||
zip:
|
||||
type: file
|
||||
thumb: media/thumb-zip.png
|
||||
mime: application/zip
|
||||
7z:
|
||||
type: file
|
||||
thumb: media/thumb-7zip.png
|
||||
mime: application/x-7z-compressed
|
||||
gz:
|
||||
type: file
|
||||
thumb: media/thumb-gz.png
|
||||
mime: application/gzip
|
||||
tar:
|
||||
type: file
|
||||
mime: application/x-tar
|
||||
css:
|
||||
type: file
|
||||
thumb: media/thumb-css.png
|
||||
mime: text/css
|
||||
js:
|
||||
type: file
|
||||
thumb: media/thumb-js.png
|
||||
mime: application/javascript
|
||||
json:
|
||||
type: file
|
||||
thumb: media/thumb-json.png
|
||||
mime: application/json
|
||||
html:
|
||||
type: file
|
||||
thumb: media/thumb-html.png
|
||||
mime: text/html
|
||||
htm:
|
||||
type: file
|
||||
thumb: media/thumb-html.png
|
||||
mime: text/html
|
||||
pdf:
|
||||
type: file
|
||||
thumb: media/thumb-pdf.png
|
||||
mime: application/pdf
|
||||
zip:
|
||||
type: file
|
||||
thumb: media/thumb-zip.png
|
||||
mime: application/zip
|
||||
7z:
|
||||
type: file
|
||||
thumb: media/thumb-7zip.png
|
||||
mime: application/x-7z-compressed
|
||||
gz:
|
||||
type: file
|
||||
thumb: media/thumb-gz.png
|
||||
mime: application/gzip
|
||||
tar:
|
||||
type: file
|
||||
mime: application/x-tar
|
||||
css:
|
||||
type: file
|
||||
thumb: media/thumb-css.png
|
||||
mime: text/css
|
||||
js:
|
||||
type: file
|
||||
thumb: media/thumb-js.png
|
||||
mime: application/javascript
|
||||
json:
|
||||
type: file
|
||||
thumb: media/thumb-json.png
|
||||
mime: application/json
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ summary:
|
||||
delimiter: === # The summary delimiter
|
||||
|
||||
redirects:
|
||||
# /redirect-test: / # Redirect test goes to home page
|
||||
# /old/(.*): /new/$1 # Would redirect /old/my-page to /new/my-page
|
||||
# '/redirect-test': '/' # Redirect test goes to home page
|
||||
# '/old/(.*)': '/new/$1' # Would redirect /old/my-page to /new/my-page
|
||||
|
||||
routes:
|
||||
# /something/else: '/blog/sample-3' # Alias for /blog/sample-3
|
||||
# /new/(.*): '/blog/$1' # Regex any /new/my-page URL to /blog/my-page Route
|
||||
# '/something/else': '/blog/sample-3' # Alias for /blog/sample-3
|
||||
# '/new/(.*)': '/blog/$1' # Regex any /new/my-page URL to /blog/my-page Route
|
||||
|
||||
blog:
|
||||
route: '/blog' # Custom value added (accessible via system.blog.route)
|
||||
|
||||
@@ -4,7 +4,7 @@ default_locale: # Default locale (defaults to system
|
||||
param_sep: ':' # Parameter separator, use ';' for Apache on windows
|
||||
wrapped_site: false # For themes/plugins to know if Grav is wrapped by another platform
|
||||
reverse_proxy_setup: false # Running in a reverse proxy scenario with different webserver ports than proxy
|
||||
|
||||
force_ssl: false # If enabled, Grav forces to be accessed via HTTPS
|
||||
|
||||
languages:
|
||||
supported: [] # List of languages supported. eg: [en, fr, de]
|
||||
@@ -125,5 +125,5 @@ session:
|
||||
httponly: true # Set session HTTP only. If true, indicates that cookies should be used only over HTTP, and JavaScript modification is not allowed.
|
||||
|
||||
gpm:
|
||||
releases: testing # Set to either 'stable' or 'testing'
|
||||
proxy_url: # Configure a manual proxy URL for GPM (eg 127.0.0.1:3128)
|
||||
releases: stable # Set to either 'stable' or 'testing'
|
||||
proxy_url: # Configure a manual proxy URL for GPM (eg 127.0.0.1:3128)
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Core
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.1.0-beta.4');
|
||||
define('GRAV_TESTING', true);
|
||||
define('GRAV_VERSION', '1.1.2');
|
||||
define('GRAV_TESTING', false);
|
||||
define('DS', '/');
|
||||
define('GRAV_PHP_MIN', '5.5.9');
|
||||
|
||||
|
||||
75
system/languages/ar.yaml
Normal file
75
system/languages/ar.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
العنوان: %1$s
|
||||
---
|
||||
# خطأ: مادة أمامية غير صحيحة
|
||||
|
||||
مسار: '%2$s'
|
||||
|
||||
**%3$s**
|
||||
|
||||
, , ,
|
||||
|
||||
%4$s
|
||||
, , ,
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: لم يتم تقديم التاريخ
|
||||
BAD_DATE: تاريخ خاطئ
|
||||
AGO: من قبل
|
||||
FROM_NOW: من الآن
|
||||
SECOND: ثانية
|
||||
MINUTE: دقيقة
|
||||
HOUR: ساعة
|
||||
DAY: يوم
|
||||
WEEK: أسبوع
|
||||
MONTH: شهر
|
||||
YEAR: سنة
|
||||
DECADE: عقد
|
||||
SEC: ثانية
|
||||
MIN: دقيقة
|
||||
HR: ساعة
|
||||
WK: أسبوع
|
||||
MO: شهر
|
||||
YR: سنة
|
||||
DEC: عقد
|
||||
SECOND_PLURAL: ثواني
|
||||
MINUTE_PLURAL: دقائق
|
||||
HOUR_PLURAL: ساعات
|
||||
DAY_PLURAL: أيام
|
||||
WEEK_PLURAL: أسابيع
|
||||
MONTH_PLURAL: أشهر
|
||||
YEAR_PLURAL: سنوات
|
||||
DECADE_PLURAL: عقود
|
||||
SEC_PLURAL: ثواني
|
||||
MIN_PLURAL: دقائق
|
||||
HR_PLURAL: ساعات
|
||||
WK_PLURAL: أسابيع
|
||||
MO_PLURAL: أشهر
|
||||
YR_PLURAL: سنوات
|
||||
DEC_PLURAL: عقود
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>فشل التحقق من صحة:</b>'
|
||||
INVALID_INPUT: إدخال غير صحيح في
|
||||
MISSING_REQUIRED_FIELD: 'حقل مطلوب مفقود:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- كانون الثاني
|
||||
- شباط
|
||||
- آذار/ مارس
|
||||
- نيسان
|
||||
- أيار
|
||||
- حزيران
|
||||
- تموز
|
||||
- آب
|
||||
- أيلول
|
||||
- تشرين الأول
|
||||
- تشرين الثاني
|
||||
- كانون الأول
|
||||
DAYS_OF_THE_WEEK:
|
||||
- الاثنين
|
||||
- الثلاثاء
|
||||
- الأربعاء
|
||||
- الخميس
|
||||
- الجمعة
|
||||
- السبت
|
||||
- الأحد
|
||||
75
system/languages/ca.yaml
Normal file
75
system/languages/ca.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
# S'ha produït un error: Frontmatter invàlid
|
||||
|
||||
Ruta: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: "No s'ha proporcionat data"
|
||||
BAD_DATE: Data invàlida
|
||||
AGO: abans
|
||||
FROM_NOW: "des d'ara"
|
||||
SECOND: segon
|
||||
MINUTE: minut
|
||||
HOUR: hora
|
||||
DAY: dia
|
||||
WEEK: setmana
|
||||
MONTH: mes
|
||||
YEAR: any
|
||||
DECADE: dècada
|
||||
SEC: s
|
||||
MIN: min
|
||||
HR: h
|
||||
WK: setm.
|
||||
MO: m.
|
||||
YR: a.
|
||||
DEC: dèc.
|
||||
SECOND_PLURAL: segons
|
||||
MINUTE_PLURAL: minuts
|
||||
HOUR_PLURAL: hores
|
||||
DAY_PLURAL: dies
|
||||
WEEK_PLURAL: setmanes
|
||||
MONTH_PLURAL: mesos
|
||||
YEAR_PLURAL: anys
|
||||
DECADE_PLURAL: dècades
|
||||
SEC_PLURAL: s
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: h
|
||||
WK_PLURAL: setm.
|
||||
MO_PLURAL: mesos
|
||||
YR_PLURAL: anys
|
||||
DEC_PLURAL: dèc.
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Ha fallat la validació:</b>'
|
||||
INVALID_INPUT: Entrada no vàlida a
|
||||
MISSING_REQUIRED_FIELD: 'Falta camp obligatori:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Gener
|
||||
- Febrer
|
||||
- Març
|
||||
- Abril
|
||||
- Maig
|
||||
- Juny
|
||||
- Juliol
|
||||
- Agost
|
||||
- Setembre
|
||||
- Octubre
|
||||
- Novembre
|
||||
- Desembre
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Dilluns
|
||||
- Dimarts
|
||||
- Dimecres
|
||||
- Dijous
|
||||
- Divendres
|
||||
- Dissabte
|
||||
- Diumenge
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
- vybavení
|
||||
- informace
|
||||
@@ -55,6 +56,7 @@ NICETIME:
|
||||
DEC_PLURAL: dek
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Ověření se nezdařilo:</b>'
|
||||
INVALID_INPUT: Neplatný vstup v
|
||||
MISSING_REQUIRED_FIELD: 'Chybí požadované pole:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- ledna
|
||||
|
||||
75
system/languages/da.yaml
Normal file
75
system/languages/da.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
Titel: %1$s
|
||||
---
|
||||
|
||||
# Fejl: Ugyldigt frontmatter
|
||||
|
||||
Sti: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Ingen dato angivet
|
||||
BAD_DATE: Ugyldig dato
|
||||
AGO: siden
|
||||
FROM_NOW: fra nu
|
||||
SECOND: sekund
|
||||
MINUTE: minut
|
||||
HOUR: time
|
||||
DAY: dag
|
||||
WEEK: uge
|
||||
MONTH: måned
|
||||
YEAR: år
|
||||
DECADE: årti
|
||||
SEC: sek
|
||||
MIN: min
|
||||
HR: t
|
||||
WK: u
|
||||
MO: md
|
||||
YR: år
|
||||
DEC: årti
|
||||
SECOND_PLURAL: sekunder
|
||||
MINUTE_PLURAL: minutter
|
||||
HOUR_PLURAL: timer
|
||||
DAY_PLURAL: dage
|
||||
WEEK_PLURAL: uger
|
||||
MONTH_PLURAL: måneder
|
||||
YEAR_PLURAL: år
|
||||
DECADE_PLURAL: årtier
|
||||
SEC_PLURAL: sek
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: timer
|
||||
WK_PLURAL: uger
|
||||
MO_PLURAL: mdr
|
||||
YR_PLURAL: år
|
||||
DEC_PLURAL: årtier
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validering mislykkedes:</b>'
|
||||
INVALID_INPUT: Ugyldigt input i
|
||||
MISSING_REQUIRED_FIELD: 'Mangler obligatorisk felt:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Januar
|
||||
- Februar
|
||||
- Marts
|
||||
- April
|
||||
- Maj
|
||||
- Juni
|
||||
- Juli
|
||||
- August
|
||||
- September
|
||||
- Oktober
|
||||
- November
|
||||
- December
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Mandag
|
||||
- Tirsdag
|
||||
- Onsdag
|
||||
- Torsdag
|
||||
- Fredag
|
||||
- Lørdag
|
||||
- Søndag
|
||||
@@ -1,13 +1,14 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
# Fehler: Frontmatter enthält Fehler
|
||||
|
||||
|
||||
Pfad: `%2$s`
|
||||
|
||||
**%3$s **
|
||||
|
||||
|
||||
**%3$s **
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
@@ -21,8 +22,13 @@ INFLECTOR_IRREGULAR:
|
||||
child: Kinder
|
||||
sex: Geschlecht
|
||||
move: Züge
|
||||
INFLECTOR_ORDINALS:
|
||||
default: '.'
|
||||
first: '.'
|
||||
second: '.'
|
||||
third: '.'
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Keine Daten vorhanden
|
||||
NO_DATE_PROVIDED: Kein Datum angegeben
|
||||
BAD_DATE: Falsches Datum
|
||||
AGO: her
|
||||
FROM_NOW: ab jetzt
|
||||
@@ -33,13 +39,14 @@ NICETIME:
|
||||
WEEK: Woche
|
||||
MONTH: Monat
|
||||
YEAR: Jahr
|
||||
DECADE: Dekade
|
||||
SEC: sek
|
||||
MIN: Min
|
||||
HR: std
|
||||
WK: wo
|
||||
YR: yh
|
||||
DEC: Jz
|
||||
DECADE: Jahrzehnt
|
||||
SEC: Sek.
|
||||
MIN: Min.
|
||||
HR: Std.
|
||||
WK: Wo.
|
||||
MO: Mo.
|
||||
YR: J.
|
||||
DEC: Dek.
|
||||
SECOND_PLURAL: Sekunden
|
||||
MINUTE_PLURAL: Minuten
|
||||
HOUR_PLURAL: Stunden
|
||||
@@ -47,14 +54,14 @@ NICETIME:
|
||||
WEEK_PLURAL: Wochen
|
||||
MONTH_PLURAL: Monate
|
||||
YEAR_PLURAL: Jahre
|
||||
DECADE_PLURAL: Dekaden
|
||||
DECADE_PLURAL: Jahrzehnte
|
||||
SEC_PLURAL: Sekunden
|
||||
MIN_PLURAL: Minuten
|
||||
HR_PLURAL: Stunden
|
||||
WK_PLURAL: Wochen
|
||||
MO_PLURAL: Monate
|
||||
YR_PLURAL: Jahre
|
||||
DEC_PLURAL: Dekaden
|
||||
DEC_PLURAL: Jahrzehnten
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Überprüfung fehlgeschlagen:</b>'
|
||||
INVALID_INPUT: Ungültige Eingabe in
|
||||
@@ -68,7 +75,7 @@ MONTHS_OF_THE_YEAR:
|
||||
- Juni
|
||||
- Juli
|
||||
- August
|
||||
- Semptember
|
||||
- September
|
||||
- Oktober
|
||||
- November
|
||||
- Dezember
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Ιανουάριος
|
||||
- Φεβρουάριος
|
||||
@@ -13,9 +14,9 @@ MONTHS_OF_THE_YEAR:
|
||||
- Δεκέμβριος
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Δευτέρα
|
||||
- Τρλιτη
|
||||
- Τρίτη
|
||||
- Τετάρτη
|
||||
- Πέμπτη
|
||||
- Παρασκευή
|
||||
- Σαββάτο
|
||||
- Σάββατο
|
||||
- Κυριακή
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
# Error: Frontmatter Inválido
|
||||
|
||||
Ruta: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
0: equipo
|
||||
1: información
|
||||
|
||||
60
system/languages/fi.yaml
Normal file
60
system/languages/fi.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Päivämäärää ei annettu
|
||||
BAD_DATE: Virheellinen päivämäärä
|
||||
AGO: sitten
|
||||
FROM_NOW: tästä lähtien
|
||||
SECOND: sekunti
|
||||
MINUTE: minuutti
|
||||
HOUR: tunti
|
||||
DAY: päivä
|
||||
WEEK: viikko
|
||||
MONTH: kuukausi
|
||||
YEAR: vuosi
|
||||
DECADE: vuosikymmen
|
||||
SEC: sek
|
||||
MIN: min
|
||||
HR: h
|
||||
WK: vk
|
||||
MO: kk
|
||||
YR: v
|
||||
DEC: vuosikymmen
|
||||
SECOND_PLURAL: sekuntia
|
||||
MINUTE_PLURAL: minuuttia
|
||||
HOUR_PLURAL: tuntia
|
||||
DAY_PLURAL: päivää
|
||||
WEEK_PLURAL: viikkoa
|
||||
MONTH_PLURAL: kuukautta
|
||||
YEAR_PLURAL: vuotta
|
||||
DECADE_PLURAL: vuosikymmentä
|
||||
SEC_PLURAL: sek
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: h
|
||||
WK_PLURAL: v
|
||||
MO_PLURAL: kk
|
||||
YR_PLURAL: v
|
||||
DEC_PLURAL: vuosikymmentä
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Vahvistus epäonnistui:</b>'
|
||||
MISSING_REQUIRED_FIELD: 'Puuttuva pakollinen kenttä:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Tammikuu
|
||||
- Helmikuu
|
||||
- Maaliskuu
|
||||
- Huhtikuu
|
||||
- Toukokuu
|
||||
- Kesäkuuta
|
||||
- Heinäkuu
|
||||
- Elokuu
|
||||
- Syyskuu
|
||||
- Lokakuu
|
||||
- Marraskuu
|
||||
- Joulukuu
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Maanantai
|
||||
- Tiistai
|
||||
- Keskiviikko
|
||||
- Torstai
|
||||
- Perjantai
|
||||
- Lauantai
|
||||
- Sunnuntai
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
|
||||
# Erreur : Frontmatter invalide
|
||||
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
|
||||
**%3$s**
|
||||
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
- oprema
|
||||
- informacije
|
||||
|
||||
@@ -1,17 +1,70 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
cím: %1$s
|
||||
---
|
||||
|
||||
|
||||
# Hiba: Érvénytelen Frontmatter
|
||||
|
||||
|
||||
Elérési út: `%2$s`
|
||||
|
||||
|
||||
**%3$s**
|
||||
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
INFLECTOR_PLURALS:
|
||||
/(quiz)$/i: '\1zes'
|
||||
/^(ox)$/i: '\1en'
|
||||
"/([m|l])ouse$/i": '\1ice'
|
||||
/(matr|vert|ind)ix|ex$/i: '\1ices'
|
||||
/(x|ch|ss|sh)$/i: '\1es'
|
||||
"/([^aeiouy]|qu)ies$/i": '\1y'
|
||||
"/([^aeiouy]|qu)y$/i": '\1ies'
|
||||
/(hive)$/i: '\1s'
|
||||
"/(?:([^f])fe|([lr])f)$/i": '\1\2ves'
|
||||
/sis$/i: ses
|
||||
"/([ti])um$/i": '\1a'
|
||||
/(buffal|tomat)o$/i: '\1oes'
|
||||
/(bu)s$/i: '\1ses'
|
||||
/(alias|status)/i: '\1es'
|
||||
/(octop|vir)us$/i: '\1i'
|
||||
/(ax|test)is$/i: '\1es'
|
||||
/s$/i: s
|
||||
/$/: s
|
||||
INFLECTOR_SINGULAR:
|
||||
/(quiz)zes$/i: '\1'
|
||||
/(matr)ices$/i: '\1ix'
|
||||
/(vert|ind)ices$/i: '\1ex'
|
||||
/^(ox)en/i: '\1'
|
||||
/(alias|status)es$/i: '\1'
|
||||
"/([octop|vir])i$/i": '\1us'
|
||||
/(cris|ax|test)es$/i: '\1is'
|
||||
/(shoe)s$/i: '\1'
|
||||
/(o)es$/i: '\1'
|
||||
/(bus)es$/i: '\1'
|
||||
"/([m|l])ice$/i": '\1ouse'
|
||||
/(x|ch|ss|sh)es$/i: '\1'
|
||||
/(m)ovies$/i: '\1ovie'
|
||||
/(s)eries$/i: '\1eries'
|
||||
"/([^aeiouy]|qu)ies$/i": '\1y'
|
||||
"/([lr])ves$/i": '\1f'
|
||||
/(tive)s$/i: '\1'
|
||||
/(hive)s$/i: '\1'
|
||||
"/([^f])ves$/i": '\1fe'
|
||||
/(^analy)ses$/i: '\1sis'
|
||||
/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i: '\1\2sis'
|
||||
"/([ti])a$/i": '\1um'
|
||||
/(n)ews$/i: '\1ews'
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
- felszerelés
|
||||
- információ
|
||||
- rizs
|
||||
- pénz
|
||||
- fajok
|
||||
- sorozat
|
||||
- hal
|
||||
- juh
|
||||
INFLECTOR_IRREGULAR:
|
||||
person: személyek
|
||||
man: férfiak
|
||||
@@ -62,3 +115,24 @@ FORM:
|
||||
VALIDATION_FAIL: '<b>A validáció hibát talált:</b>'
|
||||
INVALID_INPUT: 'Az itt megadott érték érvénytelen:'
|
||||
MISSING_REQUIRED_FIELD: 'Ez a kötelező mező nincs kitöltve:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- január
|
||||
- február
|
||||
- március
|
||||
- április
|
||||
- május
|
||||
- június
|
||||
- július
|
||||
- augusztus
|
||||
- szeptember
|
||||
- október
|
||||
- november
|
||||
- december
|
||||
DAYS_OF_THE_WEEK:
|
||||
- hétfő
|
||||
- kedd
|
||||
- szerda
|
||||
- csütörtök
|
||||
- péntek
|
||||
- szombat
|
||||
- vasárnap
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: "---Titolo: %1$s---# Errore: Frontmatter non valido: '%2$s' * *%3$s * * ' '%4$s ' '"
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Nessuna data fornita
|
||||
BAD_DATE: Data errata
|
||||
BAD_DATE: Data non valida
|
||||
AGO: fa
|
||||
FROM_NOW: da adesso
|
||||
SECOND: secondo
|
||||
@@ -10,6 +12,14 @@ NICETIME:
|
||||
WEEK: settimana
|
||||
MONTH: mese
|
||||
YEAR: anno
|
||||
DECADE: decennio
|
||||
SEC: sec
|
||||
MIN: min
|
||||
HR: ora
|
||||
WK: settimana
|
||||
MO: mese
|
||||
YR: anno
|
||||
DEC: decennio
|
||||
SECOND_PLURAL: secondi
|
||||
MINUTE_PLURAL: minuti
|
||||
HOUR_PLURAL: ore
|
||||
@@ -18,9 +28,16 @@ NICETIME:
|
||||
MONTH_PLURAL: mesi
|
||||
YEAR_PLURAL: anni
|
||||
DECADE_PLURAL: decadi
|
||||
SEC_PLURAL: secondi
|
||||
MIN_PLURAL: minuti
|
||||
HR_PLURAL: ore
|
||||
WK_PLURAL: settimane
|
||||
MO_PLURAL: mesi
|
||||
YR_PLURAL: anni
|
||||
DEC_PLURAL: decenni
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validazione fallita:</b>'
|
||||
INVALID_INPUT: Input invalido in
|
||||
INVALID_INPUT: Input non valido in
|
||||
MISSING_REQUIRED_FIELD: 'Campo richiesto mancante:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Gennaio
|
||||
@@ -36,10 +53,10 @@ MONTHS_OF_THE_YEAR:
|
||||
- Novembre
|
||||
- Dicembre
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Lunedi
|
||||
- Martedi
|
||||
- Mercoledi
|
||||
- Giovedi
|
||||
- Venerdi
|
||||
- Lunedì
|
||||
- Martedì
|
||||
- Mercoledì
|
||||
- Giovedì
|
||||
- Venerdì
|
||||
- Sabato
|
||||
- Domenica
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
2: ryžiai
|
||||
3: pinigai
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
INFLECTOR_IRREGULAR:
|
||||
person: personen
|
||||
man: mensen
|
||||
@@ -13,10 +14,15 @@ NICETIME:
|
||||
MINUTE: minuut
|
||||
HOUR: uur
|
||||
DAY: dag
|
||||
WEEK: week
|
||||
MONTH: maand
|
||||
YEAR: jaar
|
||||
DECADE: decenium
|
||||
SEC: s
|
||||
MIN: min
|
||||
HR: u
|
||||
MO: ma
|
||||
YR: j
|
||||
SECOND_PLURAL: seconden
|
||||
MINUTE_PLURAL: minuten
|
||||
HOUR_PLURAL: uren
|
||||
@@ -31,15 +37,23 @@ NICETIME:
|
||||
WK_PLURAL: weken
|
||||
MO_PLURAL: maanden
|
||||
YR_PLURAL: jaren
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validatie mislukt:</b>'
|
||||
INVALID_INPUT: Ongeldige invoer in
|
||||
MISSING_REQUIRED_FIELD: 'Verplicht veld ontbreekt:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
0: Januari
|
||||
1: Februari
|
||||
2: Maart
|
||||
4: Mei
|
||||
5: Juni
|
||||
6: Juli
|
||||
7: Augustus
|
||||
9: Oktober
|
||||
- Januari
|
||||
- Februari
|
||||
- Maart
|
||||
- april
|
||||
- Mei
|
||||
- Juni
|
||||
- Juli
|
||||
- Augustus
|
||||
- september
|
||||
- Oktober
|
||||
- november
|
||||
- december
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Maandag
|
||||
- Dinsdag
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
Tittel: %1$s
|
||||
---
|
||||
|
||||
|
||||
# Feilmelding: Ugyldig Frontmatter
|
||||
|
||||
|
||||
Pane: '%2$s'
|
||||
|
||||
|
||||
**%3$s **
|
||||
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
@@ -62,7 +63,9 @@ NICETIME:
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: timer
|
||||
WK_PLURAL: uker
|
||||
MO_PLURAL: mdr
|
||||
YR_PLURAL: år
|
||||
DEC_PLURAL: årtier
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validering mislyktes:</b>'
|
||||
INVALID_INPUT: Ugyldig innhold i
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
|
||||
# Error: Nieprawidłowy Frontmatter
|
||||
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
|
||||
**%3$s**
|
||||
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
@@ -28,8 +29,8 @@ NICETIME:
|
||||
SEC: sek
|
||||
MIN: min
|
||||
HR: godz
|
||||
WK: tydź
|
||||
MO: mieś
|
||||
WK: tydz
|
||||
MO: m-c
|
||||
YR: rok
|
||||
DEC: dekada
|
||||
SECOND_PLURAL: sekund
|
||||
@@ -40,16 +41,16 @@ NICETIME:
|
||||
MONTH_PLURAL: miesięcy
|
||||
YEAR_PLURAL: lat
|
||||
DECADE_PLURAL: dekad
|
||||
SEC_PLURAL: sekund
|
||||
MIN_PLURAL: minut
|
||||
SEC_PLURAL: sek
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: godz
|
||||
WK_PLURAL: tyg
|
||||
MO_PLURAL: mieś
|
||||
MO_PLURAL: m-ce
|
||||
YR_PLURAL: lat
|
||||
DEC_PLURAL: dekad
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Weryfikacja nie powiodła się:</b>'
|
||||
INVALID_INPUT: Nieprawidłowe dane w
|
||||
INVALID_INPUT: Nieprawidłowe dane wejściowe
|
||||
MISSING_REQUIRED_FIELD: 'Opuszczono wymagane pole:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Styczeń
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
título: %1$s
|
||||
---
|
||||
|
||||
# Erro: Frontmatter inválida
|
||||
|
||||
Caminho: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
1: informação
|
||||
2: arroz
|
||||
@@ -6,6 +21,10 @@ INFLECTOR_IRREGULAR:
|
||||
man: homens
|
||||
sex: sexos
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Não foi fornecida data
|
||||
BAD_DATE: Data inválida
|
||||
AGO: atrás
|
||||
FROM_NOW: a partir de agora
|
||||
SECOND: segundo
|
||||
MINUTE: minuto
|
||||
HOUR: hora
|
||||
@@ -16,8 +35,11 @@ NICETIME:
|
||||
DECADE: década
|
||||
SEC: seg
|
||||
MIN: mín
|
||||
MO: mês
|
||||
YR: ano
|
||||
HR: h
|
||||
WK: sem
|
||||
MO: m
|
||||
YR: a
|
||||
DEC: dec
|
||||
SECOND_PLURAL: segundos
|
||||
MINUTE_PLURAL: minutos
|
||||
HOUR_PLURAL: horas
|
||||
@@ -29,9 +51,11 @@ NICETIME:
|
||||
SEC_PLURAL: seg
|
||||
MIN_PLURAL: mins
|
||||
HR_PLURAL: hrs
|
||||
WK_PLURAL: sems
|
||||
YR_PLURAL: anos
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validação falhada: </b>'
|
||||
MISSING_REQUIRED_FIELD: 'Campo obrigatório ausente:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Janeiro
|
||||
- Fevereiro
|
||||
|
||||
@@ -1,18 +1,99 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
Titlu: %1$s
|
||||
---
|
||||
# Eroare: Frontmatter este invalid
|
||||
|
||||
Calea: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
INFLECTOR_PLURALS:
|
||||
/(quiz)$/i: '\1zes'
|
||||
/^(ox)$/i: '\1en'
|
||||
"/([m|l])ouse$/i": '\1ice'
|
||||
/(matr|vert|ind)ix|ex$/i: '\1ices'
|
||||
/(x|ch|ss|sh)$/i: '\1es'
|
||||
"/([^aeiouy]|qu)ies$/i": '\1y'
|
||||
"/([^aeiouy]|qu)y$/i": '\1ies'
|
||||
/(hive)$/i: '\1s'
|
||||
"/(?:([^f])fe|([lr])f)$/i": '\1\2ves'
|
||||
/sis$/i: ses
|
||||
"/([ti])um$/i": '\1a'
|
||||
/(buffal|tomat)o$/i: '\1oes'
|
||||
INFLECTOR_UNCOUNTABLE:
|
||||
- echipament
|
||||
- informaţie
|
||||
- orez
|
||||
- bani
|
||||
- specii
|
||||
- serii
|
||||
- peşte
|
||||
- oaie
|
||||
INFLECTOR_IRREGULAR:
|
||||
person: persoane
|
||||
man: bărbați
|
||||
child: copii
|
||||
sex: sexe
|
||||
move: mutări
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Nu există o dată prevăzută
|
||||
BAD_DATE: Dată incorectă
|
||||
AGO: în urmă
|
||||
FROM_NOW: de acum
|
||||
SECOND: secundă
|
||||
MINUTE: minut
|
||||
HOUR: oră
|
||||
DAY: zi
|
||||
WEEK: săptămână
|
||||
MONTH: lună
|
||||
YEAR: an
|
||||
DECADE: decadă
|
||||
SEC: sec
|
||||
MIN: min
|
||||
HR: oră
|
||||
WK: săpt
|
||||
MO: lună
|
||||
YR: an
|
||||
DEC: decadă
|
||||
SECOND_PLURAL: secunde
|
||||
MINUTE_PLURAL: minute
|
||||
HOUR_PLURAL: ore
|
||||
DAY_PLURAL: zile
|
||||
WEEK_PLURAL: săptămâni
|
||||
MONTH_PLURAL: luni
|
||||
YEAR_PLURAL: ani
|
||||
DECADE_PLURAL: decade
|
||||
SEC_PLURAL: sec
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: ore
|
||||
WK_PLURAL: săpt
|
||||
MO_PLURAL: luni
|
||||
YR_PLURAL: ani
|
||||
DEC_PLURAL: decenii
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Validare nereușită</b>'
|
||||
INVALID_INPUT: Date incorecte în
|
||||
MISSING_REQUIRED_FIELD: 'Câmp obligatoriu lipsă:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
0: Ianuarie
|
||||
1: Februarie
|
||||
2: Martie
|
||||
3: Aprilue
|
||||
4: Mai
|
||||
5: Iunie
|
||||
6: Iulie
|
||||
8: Septembrie
|
||||
9: Octombrie
|
||||
10: Noiembrie
|
||||
11: Decembrie
|
||||
- Ianuarie
|
||||
- Februarie
|
||||
- Martie
|
||||
- Aprilie
|
||||
- Mai
|
||||
- Iunie
|
||||
- Iulie
|
||||
- August
|
||||
- Septembrie
|
||||
- Octombrie
|
||||
- Noiembrie
|
||||
- Decembrie
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Luni
|
||||
- Marti
|
||||
- Marți
|
||||
- Miercuri
|
||||
- Joi
|
||||
- Vineri
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
# Ошибка: Недопустимое содержимое
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
INFLECTOR_IRREGULAR:
|
||||
person: люди
|
||||
man: человек
|
||||
@@ -20,8 +35,8 @@ NICETIME:
|
||||
SEC: с
|
||||
MIN: мин
|
||||
HR: ч
|
||||
WK: нед
|
||||
MO: мес
|
||||
WK: нед.
|
||||
MO: мес.
|
||||
YR: г.
|
||||
DEC: гг.
|
||||
SECOND_PLURAL: секунды
|
||||
|
||||
42
system/languages/sk.yaml
Normal file
42
system/languages/sk.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Neposkytnutý žiaden dátum
|
||||
BAD_DATE: Nesprávny dátum
|
||||
AGO: pred
|
||||
FROM_NOW: odteraz
|
||||
SECOND: sekunda
|
||||
MINUTE: minúta
|
||||
HOUR: hodina
|
||||
DAY: deň
|
||||
WEEK: týždeň
|
||||
MONTH: mesiac
|
||||
YEAR: rok
|
||||
DECADE: desaťročie
|
||||
SEC: sek
|
||||
MIN: min
|
||||
HR: hod
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Overenie zlyhalo:</b>'
|
||||
INVALID_INPUT: Neplatný vstup v
|
||||
MISSING_REQUIRED_FIELD: 'Chýba vyžadované pole:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Január
|
||||
- Február
|
||||
- Marec
|
||||
- Apríl
|
||||
- Máj
|
||||
- Jún
|
||||
- Júl
|
||||
- August
|
||||
- September
|
||||
- Október
|
||||
- November
|
||||
- December
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Pondelok
|
||||
- Utorok
|
||||
- Streda
|
||||
- Štvrtok
|
||||
- Piatok
|
||||
- Sobota
|
||||
- Nedeľa
|
||||
@@ -1,2 +1,62 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: '--- titel: %1$s --- # Fel: Ogiltig Frontmatter-sökväg: `%2$s` **%3$s** ``` %4$s ```'
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Inget datum har angivits
|
||||
BAD_DATE: Ogiltigt datum
|
||||
AGO: sedan
|
||||
FROM_NOW: från nu
|
||||
SECOND: sekund
|
||||
MINUTE: minut
|
||||
HOUR: timme
|
||||
DAY: dag
|
||||
WEEK: vecka
|
||||
MONTH: månad
|
||||
YEAR: år
|
||||
DECADE: årtionde
|
||||
SEC: sek
|
||||
MIN: min
|
||||
HR: t
|
||||
WK: v
|
||||
MO: m
|
||||
YR: år
|
||||
DEC: dec
|
||||
SECOND_PLURAL: sekunder
|
||||
MINUTE_PLURAL: minuter
|
||||
HOUR_PLURAL: timmar
|
||||
DAY_PLURAL: dagar
|
||||
WEEK_PLURAL: veckor
|
||||
MONTH_PLURAL: månader
|
||||
YEAR_PLURAL: år
|
||||
DECADE_PLURAL: årtionden
|
||||
SEC_PLURAL: sek
|
||||
MIN_PLURAL: min
|
||||
HR_PLURAL: t
|
||||
WK_PLURAL: v
|
||||
MO_PLURAL: må
|
||||
YR_PLURAL: år
|
||||
DEC_PLURAL: dec
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Kontrollen misslyckades:</b>'
|
||||
INVALID_INPUT: Ogiltig indata i
|
||||
MISSING_REQUIRED_FIELD: 'Obligatoriskt fält måste fyllas i:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Januari
|
||||
- Februrari
|
||||
- Mars
|
||||
- April
|
||||
- Maj
|
||||
- Juni
|
||||
- Juli
|
||||
- Augusti
|
||||
- September
|
||||
- Oktober
|
||||
- November
|
||||
- December
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Måndag
|
||||
- Tisdag
|
||||
- Onsdag
|
||||
- Torsdag
|
||||
- Fredag
|
||||
- Lördag
|
||||
- Söndag
|
||||
|
||||
75
system/languages/th.yaml
Normal file
75
system/languages/th.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
ชื่อเรื่อง: %1$s
|
||||
---
|
||||
|
||||
# ข้อผิดพลาด: Invalid Frontmatter
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: ไม่มีวันที่ให้
|
||||
BAD_DATE: รูปแบบวันที่ผิด
|
||||
AGO: ที่ผ่านมา
|
||||
FROM_NOW: จากตอนนี้
|
||||
SECOND: วินาที
|
||||
MINUTE: นาที
|
||||
HOUR: ชั่วโมง
|
||||
DAY: วัน
|
||||
WEEK: สัปดาห์
|
||||
MONTH: เดือน
|
||||
YEAR: ปี
|
||||
DECADE: ทศวรรษที่ผ่านมา
|
||||
SEC: วิ
|
||||
MIN: นาที
|
||||
HR: ชม.
|
||||
WK: wk
|
||||
MO: mo
|
||||
YR: yr
|
||||
DEC: dec
|
||||
SECOND_PLURAL: วินาที
|
||||
MINUTE_PLURAL: นาที
|
||||
HOUR_PLURAL: ชั่วโมง
|
||||
DAY_PLURAL: วัน
|
||||
WEEK_PLURAL: สัปดาห์
|
||||
MONTH_PLURAL: เดือน
|
||||
YEAR_PLURAL: ปี
|
||||
DECADE_PLURAL: ทศวรรษที่ผ่านมา
|
||||
SEC_PLURAL: วินาที
|
||||
MIN_PLURAL: นาที
|
||||
HR_PLURAL: ชั่วโมง
|
||||
WK_PLURAL: wks
|
||||
MO_PLURAL: mos
|
||||
YR_PLURAL: ปี
|
||||
DEC_PLURAL: decs
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>ตรวจสอบล้มเหลว: </b>'
|
||||
INVALID_INPUT: ป้อนข้อมูลไม่ถูกต้องใน
|
||||
MISSING_REQUIRED_FIELD: 'ขาดข้อมูลที่จำเป็น:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- มกราคม
|
||||
- กุมภาพันธ์
|
||||
- มีนาคม
|
||||
- เมษายน
|
||||
- พฤษภาคม
|
||||
- มิถุนายน
|
||||
- กรกฏาคม
|
||||
- สิงหาคม
|
||||
- กันยายน
|
||||
- ตุลาคม
|
||||
- พฤศจิกายน
|
||||
- ธันวาคม
|
||||
DAYS_OF_THE_WEEK:
|
||||
- จันทร์
|
||||
- อังคาร
|
||||
- พุธ
|
||||
- พฤหัสบดี
|
||||
- ศุกร์
|
||||
- เสาร์
|
||||
- อาทิตย์
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Tarih yok
|
||||
BAD_DATE: Yanlış tarih
|
||||
@@ -33,3 +34,26 @@ NICETIME:
|
||||
MO_PLURAL: ay
|
||||
YR_PLURAL: yl
|
||||
DEC_PLURAL: onyl
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Doğrulama başarısız:</b>'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Ocak
|
||||
- Şubat
|
||||
- Mart
|
||||
- Nisan
|
||||
- Mayıs
|
||||
- Haziran
|
||||
- Temmuz
|
||||
- Ağustos
|
||||
- Eylül
|
||||
- Ekim
|
||||
- Kasım
|
||||
- Aralık
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Pazartesi
|
||||
- Salı
|
||||
- Çarşamba
|
||||
- Perşembe
|
||||
- Cuma
|
||||
- Cumartesi
|
||||
- Pazar
|
||||
|
||||
75
system/languages/uk.yaml
Normal file
75
system/languages/uk.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
# Помилка: Недопустимий вміст
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Не вказана дата
|
||||
BAD_DATE: Невірна дата
|
||||
AGO: назад
|
||||
FROM_NOW: відтепер
|
||||
SECOND: секунда
|
||||
MINUTE: хвилина
|
||||
HOUR: година
|
||||
DAY: день
|
||||
WEEK: тиждень
|
||||
MONTH: місяць
|
||||
YEAR: рік
|
||||
DECADE: десятиріччя
|
||||
SEC: с
|
||||
MIN: хв
|
||||
HR: год
|
||||
WK: тиж.
|
||||
MO: міс.
|
||||
YR: р.
|
||||
DEC: рр.
|
||||
SECOND_PLURAL: секунди
|
||||
MINUTE_PLURAL: хвилини
|
||||
HOUR_PLURAL: години
|
||||
DAY_PLURAL: дні
|
||||
WEEK_PLURAL: тижні
|
||||
MONTH_PLURAL: місяці
|
||||
YEAR_PLURAL: роки
|
||||
DECADE_PLURAL: десятиріччя
|
||||
SEC_PLURAL: с
|
||||
MIN_PLURAL: хв
|
||||
HR_PLURAL: год
|
||||
WK_PLURAL: тиж.
|
||||
MO_PLURAL: міс.
|
||||
YR_PLURAL: рр.
|
||||
DEC_PLURAL: рр.
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Перевірка не вдалася:</b>'
|
||||
INVALID_INPUT: Невірне введення в
|
||||
MISSING_REQUIRED_FIELD: 'Відсутнє необхідне поле:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Січень
|
||||
- Лютий
|
||||
- Березень
|
||||
- Квітень
|
||||
- Травень
|
||||
- Червень
|
||||
- Липень
|
||||
- Серпень
|
||||
- Вересень
|
||||
- Жовтень
|
||||
- Листопад
|
||||
- Грудень
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Понеділок
|
||||
- Вівторок
|
||||
- Середа
|
||||
- Четвер
|
||||
- "П'ятниця"
|
||||
- Субота
|
||||
- Неділя
|
||||
75
system/languages/vi.yaml
Normal file
75
system/languages/vi.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
FRONTMATTER_ERROR_PAGE: |
|
||||
---
|
||||
title: %1$s
|
||||
---
|
||||
|
||||
# Error: Invalid Frontmatter
|
||||
|
||||
Path: `%2$s`
|
||||
|
||||
**%3$s**
|
||||
|
||||
```
|
||||
%4$s
|
||||
```
|
||||
NICETIME:
|
||||
NO_DATE_PROVIDED: Không có ngày được cung cấp
|
||||
BAD_DATE: Ngày không hợp lệ
|
||||
AGO: cách đây
|
||||
FROM_NOW: từ bây giờ
|
||||
SECOND: giây
|
||||
MINUTE: phút
|
||||
HOUR: giờ
|
||||
DAY: ngày
|
||||
WEEK: tuần
|
||||
MONTH: tháng
|
||||
YEAR: năm
|
||||
DECADE: thập kỷ
|
||||
SEC: giây
|
||||
MIN: phút
|
||||
HR: giờ
|
||||
WK: tuần
|
||||
MO: tháng
|
||||
YR: năm
|
||||
DEC: thập kỷ
|
||||
SECOND_PLURAL: giây
|
||||
MINUTE_PLURAL: phút
|
||||
HOUR_PLURAL: giờ
|
||||
DAY_PLURAL: ngày
|
||||
WEEK_PLURAL: tuần
|
||||
MONTH_PLURAL: tháng
|
||||
YEAR_PLURAL: năm
|
||||
DECADE_PLURAL: thập kỷ
|
||||
SEC_PLURAL: giây
|
||||
MIN_PLURAL: phút
|
||||
HR_PLURAL: giờ
|
||||
WK_PLURAL: tuần
|
||||
MO_PLURAL: tháng
|
||||
YR_PLURAL: năm
|
||||
DEC_PLURAL: thập kỷ
|
||||
FORM:
|
||||
VALIDATION_FAIL: '<b>Xác nhận thất bại:</b>'
|
||||
INVALID_INPUT: Dữ liệu nhập không hợp lệ cho
|
||||
MISSING_REQUIRED_FIELD: 'Thiếu trường bắt buộc:'
|
||||
MONTHS_OF_THE_YEAR:
|
||||
- Tháng 1
|
||||
- Tháng 2
|
||||
- Tháng 3
|
||||
- Tháng 4
|
||||
- Tháng 5
|
||||
- Tháng 6
|
||||
- Tháng 7
|
||||
- Tháng 8
|
||||
- Tháng 9
|
||||
- Tháng 10
|
||||
- Tháng Mười 11
|
||||
- Tháng 12
|
||||
DAYS_OF_THE_WEEK:
|
||||
- Thứ 2
|
||||
- Thứ 3
|
||||
- Thứ 4
|
||||
- Thứ 5
|
||||
- Thứ 6
|
||||
- Thứ 7
|
||||
- Chủ Nhật
|
||||
@@ -1,11 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use FilesystemIterator;
|
||||
use Grav\Common\Config\Config;
|
||||
use Grav\Common\Grav;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use RegexIterator;
|
||||
@@ -14,14 +20,6 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
define('CSS_ASSET', true);
|
||||
define('JS_ASSET', false);
|
||||
|
||||
/**
|
||||
* Handles Asset management (CSS & JS) and also pipelining (combining into a single file for each asset)
|
||||
*
|
||||
* Based on stolz/assets (https://github.com/Stolz/Assets) package modified for use with Grav
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Assets
|
||||
{
|
||||
/** @const Regex to match CSS and JavaScript files */
|
||||
@@ -34,7 +32,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 = '{\/\*# (.*) \*\/}';
|
||||
@@ -283,7 +281,10 @@ class Assets
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (!$this->isRemoteLink($asset)) {
|
||||
$modified = false;
|
||||
$remote = $this->isRemoteLink($asset);
|
||||
if (!$remote) {
|
||||
$modified = $this->getLastModificationTime($asset);
|
||||
$asset = $this->buildLocalLink($asset);
|
||||
}
|
||||
|
||||
@@ -294,10 +295,12 @@ class Assets
|
||||
|
||||
$data = [
|
||||
'asset' => $asset,
|
||||
'remote' => $remote,
|
||||
'priority' => intval($priority ?: 10),
|
||||
'order' => count($this->css),
|
||||
'pipeline' => (bool)$pipeline,
|
||||
'group' => $group ?: 'head'
|
||||
'pipeline' => (bool) $pipeline,
|
||||
'group' => $group ?: 'head',
|
||||
'modified' => $modified
|
||||
];
|
||||
|
||||
// check for dynamic array and merge with defaults
|
||||
@@ -344,7 +347,10 @@ class Assets
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (!$this->isRemoteLink($asset)) {
|
||||
$modified = false;
|
||||
$remote = $this->isRemoteLink($asset);
|
||||
if (!$remote) {
|
||||
$modified = $this->getLastModificationTime($asset);
|
||||
$asset = $this->buildLocalLink($asset);
|
||||
}
|
||||
|
||||
@@ -355,11 +361,13 @@ class Assets
|
||||
|
||||
$data = [
|
||||
'asset' => $asset,
|
||||
'remote' => $remote ,
|
||||
'priority' => intval($priority ?: 10),
|
||||
'order' => count($this->js),
|
||||
'pipeline' => (bool)$pipeline,
|
||||
'pipeline' => (bool) $pipeline,
|
||||
'loading' => $loading ?: '',
|
||||
'group' => $group ?: 'head'
|
||||
'group' => $group ?: 'head',
|
||||
'modified' => $modified
|
||||
];
|
||||
|
||||
// check for dynamic array and merge with defaults
|
||||
@@ -554,7 +562,7 @@ class Assets
|
||||
foreach ($this->css_no_pipeline as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->timestamp . '"' . $attributes . $media . ' />' . "\n";
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
}
|
||||
}
|
||||
if (!$this->css_pipeline_before_excludes && $pipeline_result) {
|
||||
@@ -564,7 +572,7 @@ class Assets
|
||||
foreach ($this->css as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
|
||||
$output .= '<link href="' . $file['asset'] . $this->timestamp . '"' . $attributes . $media . ' />' . "\n";
|
||||
$output .= '<link href="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . $media . ' />' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -632,7 +640,7 @@ class Assets
|
||||
}
|
||||
foreach ($this->js_no_pipeline as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$output .= '<script src="' . $file['asset'] . $this->timestamp . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
}
|
||||
}
|
||||
if (!$this->js_pipeline_before_excludes && $pipeline_result) {
|
||||
@@ -641,7 +649,7 @@ class Assets
|
||||
} else {
|
||||
foreach ($this->js as $file) {
|
||||
if ($group && $file['group'] == $group) {
|
||||
$output .= '<script src="' . $file['asset'] . $this->timestamp . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
$output .= '<script src="' . $file['asset'] . $this->getTimestamp($file) . '"' . $attributes . ' ' . $file['loading'] . '></script>' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -669,16 +677,13 @@ class Assets
|
||||
*/
|
||||
protected function pipelineCss($group = 'head')
|
||||
{
|
||||
/** @var Cache $cache */
|
||||
$cache = Grav::instance()['cache'];
|
||||
$key = '?' . $cache->getKey();
|
||||
|
||||
// temporary list of assets to pipeline
|
||||
$temp_css = [];
|
||||
|
||||
// clear no-pipeline assets lists
|
||||
$this->css_no_pipeline = [];
|
||||
|
||||
// Compute uid based on assets and timestamp
|
||||
$uid = md5(json_encode($this->css) . $this->css_minify . $this->css_rewrite . $group);
|
||||
$file = $uid . '.css';
|
||||
$inline_file = $uid . '-inline.css';
|
||||
@@ -692,14 +697,14 @@ class Assets
|
||||
|
||||
// If pipeline exist return it
|
||||
if (file_exists($this->assets_dir . $file)) {
|
||||
return $relative_path . $key;
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
|
||||
// Remove any non-pipeline files
|
||||
foreach ($this->css as $id => $asset) {
|
||||
if ($asset['group'] == $group) {
|
||||
if (!$asset['pipeline'] ||
|
||||
($this->isRemoteLink($asset['asset']) && $this->css_pipeline_include_externals === false)) {
|
||||
($asset['remote'] && $this->css_pipeline_include_externals === false)) {
|
||||
$this->css_no_pipeline[$id] = $asset;
|
||||
} else {
|
||||
$temp_css[$id] = $asset;
|
||||
@@ -730,15 +735,16 @@ 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
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
file_put_contents($this->assets_dir . $file, $buffer);
|
||||
|
||||
return $relative_path . $key;
|
||||
return $relative_path . $this->getTimestamp();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -753,16 +759,13 @@ class Assets
|
||||
*/
|
||||
protected function pipelineJs($group = 'head')
|
||||
{
|
||||
/** @var Cache $cache */
|
||||
$cache = Grav::instance()['cache'];
|
||||
$key = '?' . $cache->getKey();
|
||||
|
||||
// temporary list of assets to pipeline
|
||||
$temp_js = [];
|
||||
|
||||
// clear no-pipeline assets lists
|
||||
$this->js_no_pipeline = [];
|
||||
|
||||
// Compute uid based on assets and timestamp
|
||||
$uid = md5(json_encode($this->js) . $this->js_minify . $group);
|
||||
$file = $uid . '.js';
|
||||
$inline_file = $uid . '-inline.js';
|
||||
@@ -776,14 +779,14 @@ class Assets
|
||||
|
||||
// If pipeline exist return it
|
||||
if (file_exists($this->assets_dir . $file)) {
|
||||
return $relative_path . $key;
|
||||
return $relative_path . $this->getTimestamp();
|
||||
}
|
||||
|
||||
// Remove any non-pipeline files
|
||||
foreach ($this->js as $id => $asset) {
|
||||
if ($asset['group'] == $group) {
|
||||
if (!$asset['pipeline'] ||
|
||||
($this->isRemoteLink($asset['asset']) && $this->js_pipeline_include_externals === false)) {
|
||||
($asset['remote'] && $this->js_pipeline_include_externals === false)) {
|
||||
$this->js_no_pipeline[] = $asset;
|
||||
} else {
|
||||
$temp_js[$id] = $asset;
|
||||
@@ -804,14 +807,16 @@ 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
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
file_put_contents($this->assets_dir . $file, $buffer);
|
||||
|
||||
return $relative_path . $key;
|
||||
return $relative_path . $this->getTimestamp();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -819,24 +824,94 @@ class Assets
|
||||
|
||||
/**
|
||||
* Return the array of all the registered CSS assets
|
||||
* If a $key is provided, it will try to return only that asset
|
||||
* else it will return null
|
||||
*
|
||||
* @param null|string $key the asset key
|
||||
* @return array
|
||||
*/
|
||||
public function getCss()
|
||||
public function getCss($key = null)
|
||||
{
|
||||
if (!empty($key)) {
|
||||
$asset_key = md5($key);
|
||||
if (isset($this->css[$asset_key])) {
|
||||
return $this->css[$asset_key];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the array of all the registered JS assets
|
||||
* If a $key is provided, it will try to return only that asset
|
||||
* else it will return null
|
||||
*
|
||||
* @param null|string $key the asset key
|
||||
* @return array
|
||||
*/
|
||||
public function getJs()
|
||||
public function getJs($key = null)
|
||||
{
|
||||
if (!empty($key)) {
|
||||
$asset_key = md5($key);
|
||||
if (isset($this->js[$asset_key])) {
|
||||
return $this->js[$asset_key];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the whole array of CSS assets
|
||||
*
|
||||
* @param $css
|
||||
*/
|
||||
public function setCss($css)
|
||||
{
|
||||
$this->css = $css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the whole array of JS assets
|
||||
*
|
||||
* @param $js
|
||||
*/
|
||||
public function setJs($js)
|
||||
{
|
||||
$this->js = $js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an item from the CSS array if set
|
||||
*
|
||||
* @param $key the asset key
|
||||
*/
|
||||
public function removeCss($key)
|
||||
{
|
||||
$asset_key = md5($key);
|
||||
if (isset($this->css[$asset_key])) {
|
||||
unset($this->css[$asset_key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an item from the JS array if set
|
||||
*
|
||||
* @param $key the asset key
|
||||
*/
|
||||
public function removeJs($key)
|
||||
{
|
||||
$asset_key = md5($key);
|
||||
if (isset($this->js[$asset_key])) {
|
||||
unset($this->js[$asset_key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the array of all the registered collections
|
||||
*
|
||||
@@ -847,6 +922,16 @@ class Assets
|
||||
return $this->collections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the array of collections explicitly
|
||||
*
|
||||
* @param $collections
|
||||
*/
|
||||
public function setCollection($collections)
|
||||
{
|
||||
$this->collections = $collections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if an asset exists as a collection, CSS or JS reference
|
||||
*
|
||||
@@ -1018,18 +1103,37 @@ class Assets
|
||||
/**
|
||||
* Build local links including grav asset shortcodes
|
||||
*
|
||||
* @param string $asset the asset string reference
|
||||
* @param string $asset the asset string reference
|
||||
* @param bool $absolute build absolute asset link
|
||||
*
|
||||
* @return string the final link url to the asset
|
||||
* @return string the final link url to the asset
|
||||
*/
|
||||
protected function buildLocalLink($asset)
|
||||
protected function buildLocalLink($asset, $absolute = false)
|
||||
{
|
||||
try {
|
||||
$asset = Grav::instance()['locator']->findResource($asset, false);
|
||||
$asset = Grav::instance()['locator']->findResource($asset, $absolute);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
return $asset ? $this->base_url . ltrim($asset, '/') : false;
|
||||
$uri = $absolute ? $asset : $this->base_url . ltrim($asset, '/');
|
||||
return $asset ? $uri : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last modification time of asset
|
||||
*
|
||||
* @param string $asset the asset string reference
|
||||
*
|
||||
* @return string the last modifcation time or false on error
|
||||
*/
|
||||
protected function getLastModificationTime($asset)
|
||||
{
|
||||
$file = GRAV_ROOT . $asset;
|
||||
if (Grav::instance()['locator']->isStream($asset)) {
|
||||
$file = $this->buildLocalLink($asset, true);
|
||||
}
|
||||
|
||||
return file_exists($file) ? filemtime($file) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1149,13 +1253,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]);
|
||||
@@ -1237,6 +1346,21 @@ class Assets
|
||||
$this->timestamp = '?' . $value;
|
||||
}
|
||||
|
||||
public function getTimestamp($asset = null)
|
||||
{
|
||||
if (is_array($asset)) {
|
||||
if ($asset['remote'] == false) {
|
||||
if (Utils::contains($asset['asset'], '?')) {
|
||||
return str_replace('?', '&', $this->timestamp);
|
||||
} else {
|
||||
return $this->timestamp;
|
||||
}
|
||||
}
|
||||
} elseif (empty($asset)) {
|
||||
return $this->timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Backup
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Backup;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\Inflector;
|
||||
|
||||
/**
|
||||
* The ZipBackup class lets you create simple zip-backups of a grav site
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class ZipBackup
|
||||
{
|
||||
protected static $ignorePaths = [
|
||||
@@ -45,7 +46,7 @@ class ZipBackup
|
||||
}
|
||||
}
|
||||
|
||||
$name = Grav::instance()['config']->get('site.title', basename(GRAV_ROOT));
|
||||
$name = substr(strip_tags(Grav::instance()['config']->get('site.title', basename(GRAV_ROOT))), 0, 20);
|
||||
|
||||
$inflector = new Inflector();
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
/**
|
||||
* Handles browser and platform versions
|
||||
*
|
||||
* Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Browser
|
||||
{
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use \Doctrine\Common\Cache as DoctrineCache;
|
||||
@@ -16,9 +23,6 @@ use Grav\Common\Grav;
|
||||
* MemCache
|
||||
* MemCacheD
|
||||
* FileSystem
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Cache extends Getters
|
||||
{
|
||||
@@ -177,11 +181,18 @@ class Cache extends Getters
|
||||
$driver->setMemcache($memcache);
|
||||
break;
|
||||
|
||||
case 'memcached':
|
||||
$memcached = new \Memcached();
|
||||
$memcached->connect($this->config->get('system.cache.memcached.server', 'localhost'),
|
||||
$this->config->get('system.cache.memcached.port', 11211));
|
||||
$driver = new DoctrineCache\MemcachedCache();
|
||||
$driver->setMemcached($memcached);
|
||||
break;
|
||||
|
||||
case 'redis':
|
||||
$redis = new \Redis();
|
||||
$redis->connect($this->config->get('system.cache.redis.server', 'localhost'),
|
||||
$this->config->get('system.cache.redis.port', 6379));
|
||||
|
||||
$driver = new DoctrineCache\RedisCache();
|
||||
$driver->setRedis($redis);
|
||||
break;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
/**
|
||||
* Offers composer helper methods.
|
||||
*
|
||||
* @author eschmar
|
||||
* @license MIT
|
||||
*/
|
||||
class Composer
|
||||
{
|
||||
/** @const Default composer location */
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use RocketTheme\Toolbox\File\PhpFile;
|
||||
|
||||
/**
|
||||
* The Compiled base class.
|
||||
*/
|
||||
abstract class CompiledBase
|
||||
{
|
||||
/**
|
||||
@@ -192,9 +196,9 @@ abstract class CompiledBase
|
||||
}
|
||||
|
||||
$this->createObject($cache['data']);
|
||||
|
||||
|
||||
$this->finalizeObject();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\Data\Blueprint;
|
||||
use Grav\Common\Data\BlueprintSchema;
|
||||
use Grav\Common\Grav;
|
||||
|
||||
/**
|
||||
* The Compiled Blueprints class.
|
||||
*/
|
||||
class CompiledBlueprints extends CompiledBase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\File\CompiledYamlFile;
|
||||
|
||||
/**
|
||||
* The Compiled Configuration class.
|
||||
*/
|
||||
class CompiledConfig extends CompiledBase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\File\CompiledYamlFile;
|
||||
|
||||
/**
|
||||
* The Compiled Languages class.
|
||||
*/
|
||||
class CompiledLanguages extends CompiledBase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\Debugger;
|
||||
@@ -6,12 +13,6 @@ use Grav\Common\Grav;
|
||||
use Grav\Common\Data\Data;
|
||||
use Grav\Common\Service\ConfigServiceProvider;
|
||||
|
||||
/**
|
||||
* The Config class contains configuration information.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Config extends Data
|
||||
{
|
||||
protected $checksum;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\Filesystem\Folder;
|
||||
|
||||
/**
|
||||
* The Configuration & Blueprints Finder class.
|
||||
*/
|
||||
class ConfigFileFinder
|
||||
{
|
||||
protected $base = '';
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
|
||||
/**
|
||||
* The Languages class contains configuration rules.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Languages extends Data
|
||||
{
|
||||
public function checksum($checksum = null)
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Config
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Config;
|
||||
|
||||
use Grav\Common\File\CompiledYamlFile;
|
||||
@@ -8,12 +15,6 @@ use Pimple\Container;
|
||||
use RocketTheme\Toolbox\File\YamlFile;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
|
||||
/**
|
||||
* The Config class contains configuration information.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Setup extends Data
|
||||
{
|
||||
protected $streams = [
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use Grav\Common\File\CompiledYamlFile;
|
||||
@@ -6,11 +13,6 @@ use Grav\Common\Grav;
|
||||
use RocketTheme\Toolbox\Blueprints\BlueprintForm;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
|
||||
/**
|
||||
* The Config class contains configuration information.
|
||||
*
|
||||
* @author RocketTheme
|
||||
*/
|
||||
class Blueprint extends BlueprintForm
|
||||
{
|
||||
/**
|
||||
@@ -23,6 +25,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 +147,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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
@@ -6,12 +13,6 @@ use RocketTheme\Toolbox\ArrayTraits\Export;
|
||||
use RocketTheme\Toolbox\ArrayTraits\ExportInterface;
|
||||
use RocketTheme\Toolbox\Blueprints\BlueprintSchema as BlueprintSchemaBase;
|
||||
|
||||
/**
|
||||
* Blueprint schema handles the internal logic of blueprints.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
|
||||
{
|
||||
use Export;
|
||||
@@ -132,8 +133,15 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
|
||||
}
|
||||
$field = $this->items[$field];
|
||||
if (isset($field['validate']['required'])
|
||||
&& $field['validate']['required'] === true
|
||||
&& !isset($data[$name])) {
|
||||
&& $field['validate']['required'] === true) {
|
||||
|
||||
if (isset($data[$name])) {
|
||||
continue;
|
||||
}
|
||||
if ($field['type'] == 'file' && isset($data['data']['name'][$name])) { //handle case of file input fields required
|
||||
continue;
|
||||
}
|
||||
|
||||
$value = isset($field['label']) ? $field['label'] : $field['name'];
|
||||
$language = Grav::instance()['language'];
|
||||
$message = sprintf($language->translate('FORM.MISSING_REQUIRED_FIELD', null, true) . ' %s', $language->translate($value));
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
|
||||
/**
|
||||
* Blueprints class keeps track on blueprint instances.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Blueprints
|
||||
{
|
||||
protected $search;
|
||||
@@ -87,7 +88,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);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use RocketTheme\Toolbox\ArrayTraits\Countable;
|
||||
@@ -8,12 +15,6 @@ use RocketTheme\Toolbox\ArrayTraits\NestedArrayAccessWithGetters;
|
||||
use RocketTheme\Toolbox\File\File;
|
||||
use RocketTheme\Toolbox\File\FileInterface;
|
||||
|
||||
/**
|
||||
* Recursive data object
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Data implements DataInterface, \ArrayAccess, \Countable, ExportInterface
|
||||
{
|
||||
use NestedArrayAccessWithGetters, Countable, Export;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use RocketTheme\Toolbox\File\FileInterface;
|
||||
|
||||
/**
|
||||
* Data interface
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
interface DataInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
@@ -6,12 +13,6 @@ use Symfony\Component\Yaml\Exception\ParseException;
|
||||
use Symfony\Component\Yaml\Parser;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Data validation.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
class Validation
|
||||
{
|
||||
/**
|
||||
@@ -49,16 +50,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 +302,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 +326,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)) {
|
||||
@@ -413,7 +405,15 @@ class Validation
|
||||
*/
|
||||
public static function typeEmail($value, array $params, array $field)
|
||||
{
|
||||
return self::typeText($value, $params, $field) && filter_var($value, FILTER_VALIDATE_EMAIL);
|
||||
$values = !is_array($value) ? explode(',', preg_replace('/\s+/', '', $value)) : $value;
|
||||
|
||||
foreach ($values as $value) {
|
||||
if (!(self::typeText($value, $params, $field) && filter_var($value, FILTER_VALIDATE_EMAIL))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Data
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Data;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use DebugBar\DataCollector\ConfigCollector;
|
||||
@@ -6,10 +13,6 @@ use DebugBar\JavascriptRenderer;
|
||||
use DebugBar\StandardDebugBar;
|
||||
use Grav\Common\Config\Config;
|
||||
|
||||
/**
|
||||
* Class Debugger
|
||||
* @package Grav\Common
|
||||
*/
|
||||
class Debugger
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
@@ -214,4 +217,19 @@ class Debugger
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump exception into the Messages tab of the Debug Bar
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return Debugger
|
||||
*/
|
||||
public function addException(\Exception $e)
|
||||
{
|
||||
if ($this->enabled()) {
|
||||
$this->debugbar['exceptions']->addException($e);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Errors
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Errors;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use Whoops;
|
||||
|
||||
/**
|
||||
* Class Debugger
|
||||
* @package Grav\Common
|
||||
*/
|
||||
class Errors
|
||||
{
|
||||
public function resetHandlers()
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Errors
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Errors;
|
||||
|
||||
use Whoops\Handler\Handler;
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.File
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\File;
|
||||
|
||||
use RocketTheme\Toolbox\File\PhpFile;
|
||||
|
||||
/**
|
||||
* Class CompiledFile
|
||||
* @package Grav\Common\File
|
||||
*
|
||||
* @property string $filename
|
||||
* @property string $extension
|
||||
* @property string $raw
|
||||
* @property array|string $content
|
||||
*/
|
||||
trait CompiledFile
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.File
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\File;
|
||||
|
||||
use RocketTheme\Toolbox\File\MarkdownFile;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.File
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\File;
|
||||
|
||||
use RocketTheme\Toolbox\File\YamlFile;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.FileSystem
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Filesystem;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
|
||||
/**
|
||||
* Folder helper class.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
abstract class Folder
|
||||
{
|
||||
/**
|
||||
@@ -435,22 +436,11 @@ abstract class Folder
|
||||
return @unlink($folder);
|
||||
}
|
||||
|
||||
$files = new \RecursiveIteratorIterator(
|
||||
new \RecursiveDirectoryIterator($folder, \RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
\RecursiveIteratorIterator::CHILD_FIRST
|
||||
);
|
||||
|
||||
/** @var \DirectoryIterator $fileinfo */
|
||||
foreach ($files as $fileinfo) {
|
||||
if ($fileinfo->isDir()) {
|
||||
if (false === @rmdir($fileinfo->getRealPath())) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (false === @unlink($fileinfo->getRealPath())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Go through all items in filesystem and recursively remove everything.
|
||||
$files = array_diff(scandir($folder), array('.', '..'));
|
||||
foreach ($files as $file) {
|
||||
$path = "{$folder}/{$file}";
|
||||
(is_dir($path)) ? self::doDelete($path) : @unlink($path);
|
||||
}
|
||||
|
||||
return $include_target ? @rmdir($folder) : true;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.FileSystem
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Filesystem;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
|
||||
/**
|
||||
* Class RecursiveFolderFilterIterator
|
||||
* @package Grav\Common\Filesystem
|
||||
*/
|
||||
class RecursiveFolderFilterIterator extends \RecursiveFilterIterator
|
||||
{
|
||||
protected static $folder_ignores;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM;
|
||||
|
||||
use Grav\Common\Iterator;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Common;
|
||||
|
||||
use Grav\Common\Iterator;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Common;
|
||||
|
||||
use Grav\Common\Iterator;
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Common;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
|
||||
/**
|
||||
* @property string name
|
||||
* @property string version
|
||||
* @property string available
|
||||
* @property string package_type
|
||||
* @property string description_plain
|
||||
* @property string slug
|
||||
* @property array author
|
||||
* @property mixed changelog
|
||||
*/
|
||||
|
||||
class Package {
|
||||
|
||||
protected $data;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
@@ -32,19 +39,23 @@ class GPM extends Iterator
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
protected $install_paths = ['plugins' => 'user/plugins/%name%', 'themes' => 'user/themes/%name%', 'skeletons' => 'user/'];
|
||||
protected $install_paths = [
|
||||
'plugins' => 'user/plugins/%name%',
|
||||
'themes' => 'user/themes/%name%',
|
||||
'skeletons' => 'user/'
|
||||
];
|
||||
|
||||
/**
|
||||
* Creates a new GPM instance with Local and Remote packages available
|
||||
* @param boolean $refresh Applies to Remote Packages only and forces a refetch of data
|
||||
* @param boolean $refresh Applies to Remote Packages only and forces a refetch of data
|
||||
* @param callable $callback Either a function or callback in array notation
|
||||
*/
|
||||
public function __construct($refresh = false, $callback = null)
|
||||
{
|
||||
$this->installed = new Local\Packages();
|
||||
$this->installed = new Local\Packages();
|
||||
try {
|
||||
$this->repository = new Remote\Packages($refresh, $callback);
|
||||
$this->grav = new Remote\GravCore($refresh, $callback);
|
||||
$this->grav = new Remote\GravCore($refresh, $callback);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
@@ -72,7 +83,7 @@ class GPM extends Iterator
|
||||
/**
|
||||
* Return the instance of a specific Package
|
||||
*
|
||||
* @param string $slug The slug of the Package
|
||||
* @param string $slug The slug of the Package
|
||||
* @return Local\Package The instance of the Package
|
||||
*/
|
||||
public function getInstalledPackage($slug)
|
||||
@@ -88,7 +99,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Return the instance of a specific Plugin
|
||||
* @param string $slug The slug of the Plugin
|
||||
* @param string $slug The slug of the Plugin
|
||||
* @return Local\Package The instance of the Plugin
|
||||
*/
|
||||
public function getInstalledPlugin($slug)
|
||||
@@ -107,7 +118,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Checks if a Plugin is installed
|
||||
* @param string $slug The slug of the Plugin
|
||||
* @param string $slug The slug of the Plugin
|
||||
* @return boolean True if the Plugin has been installed. False otherwise
|
||||
*/
|
||||
public function isPluginInstalled($slug)
|
||||
@@ -122,7 +133,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Return the instance of a specific Theme
|
||||
* @param string $slug The slug of the Theme
|
||||
* @param string $slug The slug of the Theme
|
||||
* @return Local\Package The instance of the Theme
|
||||
*/
|
||||
public function getInstalledTheme($slug)
|
||||
@@ -141,7 +152,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Checks if a Theme is installed
|
||||
* @param string $slug The slug of the Theme
|
||||
* @param string $slug The slug of the Theme
|
||||
* @return boolean True if the Theme has been installed. False otherwise
|
||||
*/
|
||||
public function isThemeInstalled($slug)
|
||||
@@ -166,20 +177,23 @@ class GPM extends Iterator
|
||||
/**
|
||||
* Returns an array of Plugins and Themes that can be updated.
|
||||
* Plugins and Themes are extended with the `available` property that relies to the remote version
|
||||
* @param $list_type_update specifies what type of package to update
|
||||
* @return array Array of updatable Plugins and Themes.
|
||||
* Format: ['total' => int, 'plugins' => array, 'themes' => array]
|
||||
*/
|
||||
public function getUpdatable()
|
||||
public function getUpdatable($list_type_update = ['plugins' => true, 'themes' => true])
|
||||
{
|
||||
$plugins = $this->getUpdatablePlugins();
|
||||
$themes = $this->getUpdatableThemes();
|
||||
|
||||
$items = [
|
||||
'total' => count($plugins)+count($themes),
|
||||
'plugins' => $plugins,
|
||||
'themes' => $themes
|
||||
];
|
||||
|
||||
$items = ['total' => 0];
|
||||
foreach ($list_type_update as $type => $type_updatable) {
|
||||
if ($type_updatable === false) {
|
||||
continue;
|
||||
}
|
||||
$methodUpdatableType = 'getUpdatable' . ucfirst($type);
|
||||
$to_update = $this->$methodUpdatableType();
|
||||
$items[$type] = $to_update;
|
||||
$items['total'] += count($to_update);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
@@ -190,7 +204,7 @@ class GPM extends Iterator
|
||||
*/
|
||||
public function getUpdatablePlugins()
|
||||
{
|
||||
$items = [];
|
||||
$items = [];
|
||||
$repository = $this->repository['plugins'];
|
||||
|
||||
// local cache to speed things up
|
||||
@@ -203,15 +217,15 @@ class GPM extends Iterator
|
||||
continue;
|
||||
}
|
||||
|
||||
$local_version = $plugin->version ? $plugin->version : 'Unknown';
|
||||
$local_version = $plugin->version ? $plugin->version : 'Unknown';
|
||||
$remote_version = $repository[$slug]->version;
|
||||
|
||||
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];
|
||||
$repository[$slug]->version = $local_version;
|
||||
$repository[$slug]->name = $repository[$slug]->name;
|
||||
$repository[$slug]->type = $repository[$slug]->release_type;
|
||||
$items[$slug] = $repository[$slug];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +259,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Check if a Plugin or Theme is updatable
|
||||
* @param string $slug The slug of the package
|
||||
* @param string $slug The slug of the package
|
||||
* @return boolean True if updatable. False otherwise or if not found
|
||||
*/
|
||||
public function isUpdatable($slug)
|
||||
@@ -255,12 +269,12 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Checks if a Plugin is updatable
|
||||
* @param string $plugin The slug of the Plugin
|
||||
* @param string $plugin The slug of the Plugin
|
||||
* @return boolean True if the Plugin is updatable. False otherwise
|
||||
*/
|
||||
public function isPluginUpdatable($plugin)
|
||||
{
|
||||
return array_key_exists($plugin, (array) $this->getUpdatablePlugins());
|
||||
return array_key_exists($plugin, (array)$this->getUpdatablePlugins());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +284,7 @@ class GPM extends Iterator
|
||||
*/
|
||||
public function getUpdatableThemes()
|
||||
{
|
||||
$items = [];
|
||||
$items = [];
|
||||
$repository = $this->repository['themes'];
|
||||
|
||||
// local cache to speed things up
|
||||
@@ -283,14 +297,14 @@ class GPM extends Iterator
|
||||
continue;
|
||||
}
|
||||
|
||||
$local_version = $plugin->version ? $plugin->version : 'Unknown';
|
||||
$local_version = $plugin->version ? $plugin->version : 'Unknown';
|
||||
$remote_version = $repository[$slug]->version;
|
||||
|
||||
if (version_compare($local_version, $remote_version) < 0) {
|
||||
$repository[$slug]->available = $remote_version;
|
||||
$repository[$slug]->version = $local_version;
|
||||
$repository[$slug]->type = $repository[$slug]->release_type;
|
||||
$items[$slug] = $repository[$slug];
|
||||
$repository[$slug]->version = $local_version;
|
||||
$repository[$slug]->type = $repository[$slug]->release_type;
|
||||
$items[$slug] = $repository[$slug];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,12 +315,12 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Checks if a Theme is Updatable
|
||||
* @param string $theme The slug of the Theme
|
||||
* @param string $theme The slug of the Theme
|
||||
* @return boolean True if the Theme is updatable. False otherwise
|
||||
*/
|
||||
public function isThemeUpdatable($theme)
|
||||
{
|
||||
return array_key_exists($theme, (array) $this->getUpdatableThemes());
|
||||
return array_key_exists($theme, (array)$this->getUpdatableThemes());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,7 +423,7 @@ class GPM extends Iterator
|
||||
|
||||
/**
|
||||
* Searches for a Package in the repository
|
||||
* @param string $search Can be either the slug or the name
|
||||
* @param string $search Can be either the slug or the name
|
||||
* @return Remote\Package Package if found, FALSE if not
|
||||
*/
|
||||
public function findPackage($search)
|
||||
@@ -437,15 +451,19 @@ class GPM extends Iterator
|
||||
throw new \RuntimeException("GPM not reachable. Please check your internet connection or check the Grav site is reachable");
|
||||
}
|
||||
|
||||
if ($themes) foreach ($themes as $slug => $theme) {
|
||||
if ($search == $slug || $search == $theme->name) {
|
||||
return $theme;
|
||||
if ($themes) {
|
||||
foreach ($themes as $slug => $theme) {
|
||||
if ($search == $slug || $search == $theme->name) {
|
||||
return $theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($plugins) foreach ($plugins as $slug => $plugin) {
|
||||
if ($search == $slug || $search == $plugin->name) {
|
||||
return $plugin;
|
||||
if ($plugins) {
|
||||
foreach ($plugins as $slug => $plugin) {
|
||||
if ($search == $slug || $search == $plugin->name) {
|
||||
return $plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +485,7 @@ class GPM extends Iterator
|
||||
$repository = '';
|
||||
// if this is an object, get the search data from the key
|
||||
if (is_object($search)) {
|
||||
$search = (array) $search;
|
||||
$search = (array)$search;
|
||||
$key = key($search);
|
||||
$repository = $search[$key];
|
||||
$search = $key;
|
||||
@@ -521,9 +539,9 @@ class GPM extends Iterator
|
||||
|
||||
$dependent_packages = [];
|
||||
|
||||
foreach($packages as $package_name => $package) {
|
||||
foreach ($packages as $package_name => $package) {
|
||||
if (isset($package['dependencies'])) {
|
||||
foreach($package['dependencies'] as $dependency) {
|
||||
foreach ($package['dependencies'] as $dependency) {
|
||||
if (is_array($dependency)) {
|
||||
$dependency = array_keys($dependency)[0];
|
||||
}
|
||||
@@ -550,7 +568,7 @@ class GPM extends Iterator
|
||||
public function getVersionOfDependencyRequiredByPackage($package_slug, $dependency_slug)
|
||||
{
|
||||
$dependencies = $this->getInstalledPackage($package_slug)->dependencies;
|
||||
foreach($dependencies as $dependency) {
|
||||
foreach ($dependencies as $dependency) {
|
||||
if (isset($dependency[$dependency_slug])) {
|
||||
return $dependency[$dependency_slug];
|
||||
}
|
||||
@@ -562,22 +580,27 @@ class GPM extends Iterator
|
||||
* Thrown an exception if it cannot be updated because another package installed requires it to be at an older version.
|
||||
*
|
||||
* @param string $slug
|
||||
* @param string $version_with_operator
|
||||
* @param string $version_with_operator
|
||||
* @param array $ignore_packages_list
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function checkNoOtherPackageNeedsThisDependencyInALowerVersion($slug, $version_with_operator, $ignore_packages_list) {
|
||||
public function checkNoOtherPackageNeedsThisDependencyInALowerVersion(
|
||||
$slug,
|
||||
$version_with_operator,
|
||||
$ignore_packages_list
|
||||
) {
|
||||
|
||||
// check if any of the currently installed package need this in a lower version than the one we need. In case, abort and tell which package
|
||||
$dependent_packages = $this->getPackagesThatDependOnPackage($slug);
|
||||
$version = $this->calculateVersionNumberFromDependencyVersion($version_with_operator);
|
||||
|
||||
if (count($dependent_packages)) {
|
||||
foreach($dependent_packages as $dependent_package) {
|
||||
$other_dependency_version_with_operator = $this->getVersionOfDependencyRequiredByPackage($dependent_package, $slug);
|
||||
$other_dependency_version= $this->calculateVersionNumberFromDependencyVersion($other_dependency_version_with_operator);
|
||||
foreach ($dependent_packages as $dependent_package) {
|
||||
$other_dependency_version_with_operator = $this->getVersionOfDependencyRequiredByPackage($dependent_package,
|
||||
$slug);
|
||||
$other_dependency_version = $this->calculateVersionNumberFromDependencyVersion($other_dependency_version_with_operator);
|
||||
|
||||
// check version is compatible with the one needed by the current package
|
||||
if ($this->versionFormatIsNextSignificantRelease($other_dependency_version_with_operator)) {
|
||||
@@ -606,7 +629,8 @@ class GPM extends Iterator
|
||||
public function checkPackagesCanBeInstalled($packages_names_list)
|
||||
{
|
||||
foreach ($packages_names_list as $package_name) {
|
||||
$this->checkNoOtherPackageNeedsThisDependencyInALowerVersion($package_name, $this->getLatestVersionOfPackage($package_name), $packages_names_list);
|
||||
$this->checkNoOtherPackageNeedsThisDependencyInALowerVersion($package_name,
|
||||
$this->getLatestVersionOfPackage($package_name), $packages_names_list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,7 +647,8 @@ class GPM extends Iterator
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getDependencies($packages) {
|
||||
public function getDependencies($packages)
|
||||
{
|
||||
$dependencies = $this->calculateMergedDependenciesOfPackages($packages);
|
||||
foreach ($dependencies as $dependency_slug => $dependencyVersionWithOperator) {
|
||||
if (in_array($dependency_slug, $packages)) {
|
||||
@@ -633,7 +658,9 @@ class GPM extends Iterator
|
||||
|
||||
//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) {
|
||||
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 {
|
||||
@@ -674,7 +701,8 @@ class GPM extends Iterator
|
||||
|
||||
if ($this->firstVersionIsLower($latestRelease, $dependencyVersion)) {
|
||||
//throw an exception if a required version cannot be found in the GPM yet
|
||||
throw new \Exception('Dependency <cyan>' . $package_yaml['name'] . '</cyan> is required in version <cyan>' . $dependencyVersion . '</cyan> which is higher than the latest release, <cyan>' . $latestRelease . '</cyan>. Try running `bin/gpm -f index` to force a refresh of the GPM cache', 1);
|
||||
throw new \Exception('Dependency <cyan>' . $package_yaml['name'] . '</cyan> is required in version <cyan>' . $dependencyVersion . '</cyan> which is higher than the latest release, <cyan>' . $latestRelease . '</cyan>. Try running `bin/gpm -f index` to force a refresh of the GPM cache',
|
||||
1);
|
||||
}
|
||||
|
||||
if ($this->firstVersionIsLower($currentlyInstalledVersion, $dependencyVersion)) {
|
||||
@@ -717,18 +745,20 @@ class GPM extends Iterator
|
||||
public function checkNoOtherPackageNeedsTheseDependenciesInALowerVersion($dependencies_slugs)
|
||||
{
|
||||
foreach ($dependencies_slugs as $dependency_slug) {
|
||||
$this->checkNoOtherPackageNeedsThisDependencyInALowerVersion($dependency_slug, $this->getLatestVersionOfPackage($dependency_slug), $dependencies_slugs);
|
||||
$this->checkNoOtherPackageNeedsThisDependencyInALowerVersion($dependency_slug,
|
||||
$this->getLatestVersionOfPackage($dependency_slug), $dependencies_slugs);
|
||||
}
|
||||
}
|
||||
|
||||
private function firstVersionIsLower($firstVersion, $secondVersion) {
|
||||
private function firstVersionIsLower($firstVersion, $secondVersion)
|
||||
{
|
||||
return version_compare($firstVersion, $secondVersion) == -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates and merges the dependencies of a package
|
||||
*
|
||||
* @param string $packageName The package information
|
||||
* @param string $packageName The package information
|
||||
*
|
||||
* @param array $dependencies The dependencies array
|
||||
*
|
||||
@@ -758,8 +788,7 @@ class GPM extends Iterator
|
||||
|
||||
//Factor in the package dependencies too
|
||||
$dependencies = $this->calculateMergedDependenciesOfPackage($current_package_name, $dependencies);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Dependency already added by another package
|
||||
//if this package requires a version higher than the currently stored one, store this requirement instead
|
||||
if (isset($current_package_version_information) && $current_package_version_information !== '*') {
|
||||
@@ -778,7 +807,8 @@ class GPM extends Iterator
|
||||
|
||||
$current_package_version_number = $this->calculateVersionNumberFromDependencyVersion($current_package_version_information);
|
||||
if (!$current_package_version_number) {
|
||||
throw new \Exception('Bad format for version of dependency ' . $current_package_name . ' for package ' . $packageName, 1);
|
||||
throw new \Exception('Bad format for version of dependency ' . $current_package_name . ' for package ' . $packageName,
|
||||
1);
|
||||
}
|
||||
|
||||
$current_package_version_is_in_next_significant_release_format = false;
|
||||
@@ -792,13 +822,17 @@ class GPM extends Iterator
|
||||
} else {
|
||||
if (!$currently_stored_version_is_in_next_significant_release_format && !$current_package_version_is_in_next_significant_release_format) {
|
||||
//Comparing versions equals or higher, a simple version_compare is enough
|
||||
if (version_compare($currently_stored_version_number, $current_package_version_number) == -1) { //Current package version is higher
|
||||
if (version_compare($currently_stored_version_number,
|
||||
$current_package_version_number) == -1
|
||||
) { //Current package version is higher
|
||||
$dependencies[$current_package_name] = $current_package_version_information;
|
||||
}
|
||||
} else {
|
||||
$compatible = $this->checkNextSignificantReleasesAreCompatible($currently_stored_version_number, $current_package_version_number);
|
||||
$compatible = $this->checkNextSignificantReleasesAreCompatible($currently_stored_version_number,
|
||||
$current_package_version_number);
|
||||
if (!$compatible) {
|
||||
throw new \Exception('Dependency ' . $current_package_name . ' is required in two incompatible versions', 2);
|
||||
throw new \Exception('Dependency ' . $current_package_name . ' is required in two incompatible versions',
|
||||
2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -866,7 +900,8 @@ class GPM extends Iterator
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function versionFormatIsNextSignificantRelease($version) {
|
||||
public function versionFormatIsNextSignificantRelease($version)
|
||||
{
|
||||
return substr($version, 0, 1) == '~';
|
||||
}
|
||||
|
||||
@@ -879,7 +914,8 @@ class GPM extends Iterator
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function versionFormatIsEqualOrHigher($version) {
|
||||
public function versionFormatIsEqualOrHigher($version)
|
||||
{
|
||||
return substr($version, 0, 2) == '>=';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM;
|
||||
|
||||
use Grav\Common\Filesystem\Folder;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Local;
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\GPM\Common\CachedCollection;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
|
||||
/**
|
||||
* Class Plugins
|
||||
* @package Grav\Common\GPM\Local
|
||||
*/
|
||||
class Plugins extends AbstractPackageCollection
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
|
||||
/**
|
||||
* Class Themes
|
||||
* @package Grav\Common\GPM\Local
|
||||
*/
|
||||
class Themes extends AbstractPackageCollection
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
@@ -6,10 +13,6 @@ use Grav\Common\GPM\Common\AbstractPackageCollection as BaseCollection;
|
||||
use Grav\Common\GPM\Response;
|
||||
use \Doctrine\Common\Cache\FilesystemCache;
|
||||
|
||||
/**
|
||||
* Class AbstractPackageCollection
|
||||
* @package Grav\Common\GPM\Remote
|
||||
*/
|
||||
class AbstractPackageCollection extends BaseCollection
|
||||
{
|
||||
/**
|
||||
@@ -50,6 +53,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
use Grav\Common\GPM\Common\CachedCollection;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
/**
|
||||
* Class Plugins
|
||||
* @package Grav\Common\GPM\Remote
|
||||
*/
|
||||
class Plugins extends AbstractPackageCollection
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM\Remote;
|
||||
|
||||
/**
|
||||
* Class Themes
|
||||
* @package Grav\Common\GPM\Remote
|
||||
*/
|
||||
class Themes extends AbstractPackageCollection
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\GPM;
|
||||
|
||||
use Grav\Common\Utils;
|
||||
use Grav\Common\Grav;
|
||||
|
||||
/**
|
||||
* Class Response
|
||||
* @package Grav\Common\GPM
|
||||
*/
|
||||
class Response
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<?php
|
||||
namespace Grav\Common\GPM;
|
||||
/**
|
||||
* @package Grav.Common.GPM
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
use Grav\Common\Grav;
|
||||
namespace Grav\Common\GPM;
|
||||
|
||||
/**
|
||||
* Class Upgrader
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
/**
|
||||
* Abstract class to implement magic __get(), __set(), __isset() and __unset().
|
||||
* Also implements ArrayAccess.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
abstract class Getters implements \ArrayAccess, \Countable
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use Grav\Common\Page\Medium\ImageMedium;
|
||||
use RocketTheme\Toolbox\DI\Container;
|
||||
use RocketTheme\Toolbox\Event\Event;
|
||||
|
||||
/**
|
||||
* Grav
|
||||
*
|
||||
* @author Andy Miller
|
||||
* @link http://www.rockettheme.com
|
||||
* @license http://opensource.org/licenses/MIT
|
||||
*
|
||||
* Influenced by Pico, Stacey, Kirby, PieCrust and other great platforms...
|
||||
*/
|
||||
class Grav extends Container
|
||||
{
|
||||
|
||||
@@ -126,6 +124,7 @@ class Grav extends Container
|
||||
|
||||
// Set the header type
|
||||
$this->header();
|
||||
|
||||
echo $this->output;
|
||||
$debugger->render();
|
||||
|
||||
@@ -218,7 +217,10 @@ class Grav extends Container
|
||||
*/
|
||||
public function mime($format)
|
||||
{
|
||||
// look for some standard types
|
||||
switch ($format) {
|
||||
case null:
|
||||
return 'text/html';
|
||||
case 'json':
|
||||
return 'application/json';
|
||||
case 'html':
|
||||
@@ -231,6 +233,16 @@ class Grav extends Container
|
||||
return 'application/xml';
|
||||
}
|
||||
|
||||
// Try finding mime type from media
|
||||
$media_types = $this['config']->get('media.types');
|
||||
if (key_exists($format, $media_types)) {
|
||||
$type = $media_types[$format];
|
||||
if (isset($type['mime'])) {
|
||||
return $type['mime'];
|
||||
}
|
||||
}
|
||||
|
||||
// Can't find the mime type, send as HTML
|
||||
return 'text/html';
|
||||
}
|
||||
|
||||
@@ -322,9 +334,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 +346,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();
|
||||
@@ -446,6 +457,8 @@ class Grav extends Container
|
||||
*/
|
||||
public function fallbackUrl($path)
|
||||
{
|
||||
$this->fireEvent('onPageFallBackUrl');
|
||||
|
||||
/** @var Uri $uri */
|
||||
$uri = $this['uri'];
|
||||
|
||||
@@ -454,7 +467,7 @@ class Grav extends Container
|
||||
|
||||
$uri_extension = $uri->extension();
|
||||
$fallback_types = $config->get('system.media.allowed_fallback_types', null);
|
||||
$supported_types = $config->get('media');
|
||||
$supported_types = $config->get('media.types');
|
||||
|
||||
// Check whitelist first, then ensure extension is a valid media type
|
||||
if (!empty($fallback_types) && !in_array($uri_extension, $fallback_types)) {
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
/**
|
||||
* Class GravTrait
|
||||
*
|
||||
* @package Grav\Common
|
||||
* @deprecated
|
||||
*/
|
||||
trait GravTrait
|
||||
{
|
||||
protected static $grav;
|
||||
|
||||
/**
|
||||
* @return Grav
|
||||
*/
|
||||
public static function getGrav()
|
||||
{
|
||||
return Grav::instance();
|
||||
if (!self::$grav) {
|
||||
self::$grav = Grav::instance();
|
||||
}
|
||||
return self::$grav;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common.Helpers
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Helpers;
|
||||
|
||||
use DOMDocument;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use Grav\Common\Grav;
|
||||
@@ -7,19 +14,6 @@ use Grav\Common\Grav;
|
||||
* This file was originally part of the Akelos Framework
|
||||
*/
|
||||
|
||||
/**
|
||||
* Inflector for pluralize and singularize English nouns.
|
||||
*
|
||||
* This Inflector is a port of Ruby on Rails Inflector.
|
||||
*
|
||||
* It can be really helpful for developers that want to
|
||||
* create frameworks based on naming conventions rather than
|
||||
* configurations.
|
||||
*
|
||||
* @author RocketTheme
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
class Inflector
|
||||
{
|
||||
protected $plural;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Grav.Common
|
||||
*
|
||||
* @copyright Copyright (C) 2014 - 2016 RocketTheme, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common;
|
||||
|
||||
use RocketTheme\Toolbox\ArrayTraits\ArrayAccessWithGetters;
|
||||
@@ -8,10 +15,6 @@ use RocketTheme\Toolbox\ArrayTraits\Countable;
|
||||
use RocketTheme\Toolbox\ArrayTraits\Export;
|
||||
use RocketTheme\Toolbox\ArrayTraits\Serializable;
|
||||
|
||||
/**
|
||||
* Class Iterator
|
||||
* @package Grav\Common
|
||||
*/
|
||||
class Iterator implements \ArrayAccess, \Iterator, \Countable, \Serializable
|
||||
{
|
||||
use Constructor, ArrayAccessWithGetters, ArrayIterator, Countable, Serializable, Export;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user