mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Compare commits
83 Commits
develop
...
1.8.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7aaef986e | ||
|
|
ab9363c478 | ||
|
|
7f2da96c0b | ||
|
|
b16db4b9c0 | ||
|
|
42c0682dd8 | ||
|
|
1969ec1876 | ||
|
|
c30661736c | ||
|
|
3d2dfa2faf | ||
|
|
f06bbfc563 | ||
|
|
37e5526a4f | ||
|
|
85c4b8279e | ||
|
|
46736ce256 | ||
|
|
800b2e1ecb | ||
|
|
4f065b95a7 | ||
|
|
b59a3adc80 | ||
|
|
4ec9a3a489 | ||
|
|
173d08243a | ||
|
|
62c60b8ba1 | ||
|
|
59031a8711 | ||
|
|
5cd859865f | ||
|
|
16eafbbb04 | ||
|
|
3947bb03aa | ||
|
|
ee55d097f2 | ||
|
|
ae567469b7 | ||
|
|
f6decaab15 | ||
|
|
10d36a10bc | ||
|
|
574a430a10 | ||
|
|
302f02ca5d | ||
|
|
c334479e4c | ||
|
|
b96483c49a | ||
|
|
cccce836f6 | ||
|
|
bdcb77d429 | ||
|
|
e15cc86716 | ||
|
|
dcfbd73d43 | ||
|
|
1967910789 | ||
|
|
4f1f9a7755 | ||
|
|
e4f483998d | ||
|
|
7a393101ee | ||
|
|
10b15bedf2 | ||
|
|
8c14a9907e | ||
|
|
f490d9a7e1 | ||
|
|
81ca0c2e25 | ||
|
|
fbfac9f8f4 | ||
|
|
d6e72708bf | ||
|
|
2aff274c31 | ||
|
|
74c1dfa433 | ||
|
|
f51a9d9d87 | ||
|
|
e5498f58e6 | ||
|
|
8f58a4494c | ||
|
|
5bfd43256d | ||
|
|
69bc3f7f25 | ||
|
|
782ceada80 | ||
|
|
36392acbea | ||
|
|
4b564df38f | ||
|
|
9d179e5b2a | ||
|
|
6032bd07dc | ||
|
|
9a87a509b0 | ||
|
|
46f2a81b21 | ||
|
|
f5e21645f6 | ||
|
|
12c8cf9c40 | ||
|
|
93bb929b38 | ||
|
|
85eaf308d5 | ||
|
|
d9ede28b99 | ||
|
|
2e65b0eea4 | ||
|
|
7660a80ef7 | ||
|
|
6d0a436834 | ||
|
|
176fd8f1d8 | ||
|
|
2f85fe9c99 | ||
|
|
d93d297dc4 | ||
|
|
fcd9093f84 | ||
|
|
58b54a70bd | ||
|
|
9daa0a9041 | ||
|
|
965e03daf2 | ||
|
|
b6c3db082a | ||
|
|
26b68953c4 | ||
|
|
fba015c5d9 | ||
|
|
7223c177c4 | ||
|
|
a68bdd2b75 | ||
|
|
38e4624506 | ||
|
|
ad9287ee0f | ||
|
|
777ac119de | ||
|
|
076c64841e | ||
|
|
62cb40fef5 |
8
.github/workflows/build.yaml
vendored
8
.github/workflows/build.yaml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # for release creation (svenstaro/upload-release-action)
|
contents: write # for release creation (svenstaro/upload-release-action)
|
||||||
|
|
||||||
if: "!github.event.release.prerelease"
|
#if: "!github.event.release.prerelease"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 7.3
|
php-version: 8.2
|
||||||
extensions: opcache, gd
|
extensions: opcache, gd
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
@ -38,10 +38,10 @@ jobs:
|
||||||
- name: Retrieval of Builder Scripts
|
- name: Retrieval of Builder Scripts
|
||||||
run: |
|
run: |
|
||||||
# Real Grav URL
|
# Real Grav URL
|
||||||
curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
|
curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL_18 }} --output build-grav.sh
|
||||||
|
|
||||||
# Development Local URL
|
# Development Local URL
|
||||||
# curl ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
|
# curl ${{ secrets.BUILD_SCRIPT_URL_18 }} --output build-grav.sh
|
||||||
|
|
||||||
- name: Grav Builder
|
- name: Grav Builder
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
28
.github/workflows/tests.yaml
vendored
28
.github/workflows/tests.yaml
vendored
|
|
@ -10,18 +10,20 @@ permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
php: ['8.3', '8.2', '8.1', '8.0', '7.4', '7.3']
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
strategy:
|
||||||
- uses: actions/checkout@v4
|
matrix:
|
||||||
|
php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3]
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
|
||||||
- name: Setup PHP ${{ matrix.php }}
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php }}
|
php-version: ${{ matrix.php }}
|
||||||
|
|
@ -29,14 +31,20 @@ jobs:
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
coverage: none
|
coverage: none
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# - name: Update composer
|
||||||
|
# run: composer update
|
||||||
|
#
|
||||||
|
# - name: Validate composer.json and composer.lock
|
||||||
|
# run: composer validate
|
||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
|
|
||||||
50
CHANGELOG.md
50
CHANGELOG.md
|
|
@ -1,3 +1,33 @@
|
||||||
|
# v1.8.0-beta.2
|
||||||
|
## 10/28/2024
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Use `dev-master` branch of Clockwork to support Monolog2 / Monolog3
|
||||||
|
* `AVIF` image support via updates to `getgrav/Image` library
|
||||||
|
* Upgraded to **Doctrine Collection 2.2**
|
||||||
|
1. [](#improved)
|
||||||
|
* Updated composer libraries
|
||||||
|
* Updated composer.php binary to `v2.8.1`
|
||||||
|
* Fixes for PHP 8.4 - Implicitly nullable parameter declarations deprecated
|
||||||
|
* Added back Missing `RocketTheme\Toolbox\Event\EventSubscriberInterface` for Gantry5
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Various fixes to use `$log->debug()`, `$log->info()`, `$log->warning()` and `$log->error()` For Monolog2 support
|
||||||
|
|
||||||
|
# v1.8.0-beta.1
|
||||||
|
## 10/23/2024
|
||||||
|
|
||||||
|
1. [](#new)
|
||||||
|
* Set minimum requirements to **PHP 8.2**
|
||||||
|
* Updated to **Twig 2.14**
|
||||||
|
* Updated to **Symfony 6.4**
|
||||||
|
* Updated to **Monolog 2.3**
|
||||||
|
* Updated to **RocketTheme/Toolbox 2.0**
|
||||||
|
* Updated to **Composer/Semver 3.2**
|
||||||
|
* Use **Symfony Cache** instead of unmaintained **Doctrine Cache**
|
||||||
|
* Removed unsupported **APC**, **WinCache**, **XCache** and **Memcache**, use apcu or memcached instead
|
||||||
|
* Removed `system.umask_fix` setting for security reasons
|
||||||
|
* Support phpstan level 6 in Framework classes
|
||||||
|
|
||||||
# v1.7.48
|
# v1.7.48
|
||||||
## 10/28/2024
|
## 10/28/2024
|
||||||
|
|
||||||
|
|
@ -12,18 +42,18 @@
|
||||||
## 10/23/2024
|
## 10/23/2024
|
||||||
|
|
||||||
1. [](#new)
|
1. [](#new)
|
||||||
* New `Utils::toAscii()` method
|
* New `Utils::toAscii()` method
|
||||||
* Added support for Clockwork Debugger to allow web UI (requires new `clockwork-web` plugin)
|
* Added support for Clockwork Debugger to allow web UI (requires new `clockwork-web` plugin)
|
||||||
1. [](#improved)
|
1. [](#improved)
|
||||||
* Include modular sub-pages in last-modification date computation [#3562](https://github.com/getgrav/grav/pull/3562)
|
* Include modular sub-pages in last-modification date computation [#3562](https://github.com/getgrav/grav/pull/3562)
|
||||||
* Updated vendor libs to latest versions
|
* Updated vendor libs to latest versions
|
||||||
* Updated JQuery to `3.7.1` [#3787](https://github.com/getgrav/grav/pull/3827)
|
* Updated JQuery to `3.7.1` [#3787](https://github.com/getgrav/grav/pull/3827)
|
||||||
* Updated vendor libraries to latest versions
|
* Updated vendor libraries to latest versions
|
||||||
* Support for Fediverse Creator meta tag [#3844](https://github.com/getgrav/grav/pull/3844)
|
* Support for Fediverse Creator meta tag [#3844](https://github.com/getgrav/grav/pull/3844)
|
||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixes deprecated for return type in Filesystem with PHP 8.3.6 [#3831](https://github.com/getgrav/grav/issues/3831)
|
* Fixes deprecated for return type in Filesystem with PHP 8.3.6 [#3831](https://github.com/getgrav/grav/issues/3831)
|
||||||
* Fix for `exif_imagtetype()` throwing an exception when file doesn't exist
|
* Fix for `exif_imagtetype()` throwing an exception when file doesn't exist
|
||||||
* Fix JSON output comments check with content type [#3859](https://github.com/getgrav/grav/pull/3859)
|
* Fix JSON output comments check with content type [#3859](https://github.com/getgrav/grav/pull/3859)
|
||||||
|
|
||||||
# v1.7.46
|
# v1.7.46
|
||||||
## 05/15/2024
|
## 05/15/2024
|
||||||
|
|
|
||||||
35
README.md
35
README.md
|
|
@ -39,22 +39,22 @@ You can download a **ready-built** package from the [Downloads page on https://g
|
||||||
|
|
||||||
You can create a new project with the latest **stable** Grav release with the following command:
|
You can create a new project with the latest **stable** Grav release with the following command:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
composer create-project getgrav/grav ~/webroot/grav
|
$ composer create-project getgrav/grav ~/webroot/grav
|
||||||
```
|
```
|
||||||
|
|
||||||
### From GitHub
|
### From GitHub
|
||||||
|
|
||||||
1. Clone the Grav repository from [https://github.com/getgrav/grav]() to a folder in the webroot of your server, e.g. `~/webroot/grav`. Launch a **terminal** or **console** and navigate to the webroot folder:
|
1. Clone the Grav repository from [https://github.com/getgrav/grav]() to a folder in the webroot of your server, e.g. `~/webroot/grav`. Launch a **terminal** or **console** and navigate to the webroot folder:
|
||||||
```bash
|
```
|
||||||
cd ~/webroot
|
$ cd ~/webroot
|
||||||
git clone https://github.com/getgrav/grav.git
|
$ git clone https://github.com/getgrav/grav.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install the **plugin** and **theme dependencies** by using the [Grav CLI application](https://learn.getgrav.org/advanced/grav-cli) `bin/grav`:
|
2. Install the **plugin** and **theme dependencies** by using the [Grav CLI application](https://learn.getgrav.org/advanced/grav-cli) `bin/grav`:
|
||||||
```bash
|
```
|
||||||
cd ~/webroot/grav
|
$ cd ~/webroot/grav
|
||||||
bin/grav install
|
$ bin/grav install
|
||||||
```
|
```
|
||||||
|
|
||||||
Check out the [install procedures](https://learn.getgrav.org/basics/installation) for more information.
|
Check out the [install procedures](https://learn.getgrav.org/basics/installation) for more information.
|
||||||
|
|
@ -63,35 +63,36 @@ Check out the [install procedures](https://learn.getgrav.org/basics/installation
|
||||||
|
|
||||||
You can download [plugins](https://getgrav.org/downloads/plugins) or [themes](https://getgrav.org/downloads/themes) manually from the appropriate tab on the [Downloads page on https://getgrav.org](https://getgrav.org/downloads), but the preferred solution is to use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
|
You can download [plugins](https://getgrav.org/downloads/plugins) or [themes](https://getgrav.org/downloads/themes) manually from the appropriate tab on the [Downloads page on https://getgrav.org](https://getgrav.org/downloads), but the preferred solution is to use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
bin/gpm index
|
$ bin/gpm index
|
||||||
```
|
```
|
||||||
|
|
||||||
This will display all the available plugins and then you can install one or more with:
|
This will display all the available plugins and then you can install one or more with:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
bin/gpm install <plugin/theme>
|
$ bin/gpm install <plugin/theme>
|
||||||
```
|
```
|
||||||
|
|
||||||
# Updating
|
# Updating
|
||||||
|
|
||||||
To update Grav you should use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
|
To update Grav you should use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
bin/gpm selfupgrade
|
$ bin/gpm selfupgrade
|
||||||
```
|
```
|
||||||
|
|
||||||
To update plugins and themes:
|
To update plugins and themes:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
bin/gpm update
|
$ bin/gpm update
|
||||||
```
|
```
|
||||||
|
|
||||||
## Upgrading from older version
|
## Upgrading from older version
|
||||||
|
|
||||||
|
* [Upgrading to Grav 1.8](https://learn.getgrav.org/16/advanced/grav-development/grav-18-upgrade-guide)
|
||||||
* [Upgrading to Grav 1.7](https://learn.getgrav.org/16/advanced/grav-development/grav-17-upgrade-guide)
|
* [Upgrading to Grav 1.7](https://learn.getgrav.org/16/advanced/grav-development/grav-17-upgrade-guide)
|
||||||
* [Upgrading to Grav 1.6](https://learn.getgrav.org/16/advanced/grav-development/grav-16-upgrade-guide)
|
* [Upgrading to Grav 1.6](https://learn.getgrav.org/16/advanced/grav-development/grav-16-upgrade-guide)
|
||||||
* [Upgrading from Grav <1.6](https://learn.getgrav.org/16/advanced/grav-development/grav-15-upgrade-guide)
|
* [Upgrading from Grav before 1.6](https://learn.getgrav.org/16/advanced/grav-development/grav-15-upgrade-guide)
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
We appreciate any contribution to Grav, whether it is related to bugs, grammar, or simply a suggestion or improvement! Please refer to the [Contributing guide](CONTRIBUTING.md) for more guidance on this topic.
|
We appreciate any contribution to Grav, whether it is related to bugs, grammar, or simply a suggestion or improvement! Please refer to the [Contributing guide](CONTRIBUTING.md) for more guidance on this topic.
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ We are focusing our security updates on the following versions
|
||||||
|
|
||||||
## :pushpin: Note on Security Severity
|
## :pushpin: Note on Security Severity
|
||||||
|
|
||||||
> NOTE: Please use the following guidelines when selecting a **Severity**. Submitted advisories that are marked **High** or **Critical** that don't meet the guidelines below will be closed.
|
> NOTE: Please use the following guidlines when selecting a **Severity**. Submitted advisories that are marked **High** or **Critical** that don't meet the guidelines below will be cliosed.
|
||||||
|
|
||||||
* **CRITICAL** - no account required, can modify content, or run malicious code or nefarious activity without any access.
|
* **CRITICAL** - no account required, can modify content, or run malicious code or nefarious activity without any access.
|
||||||
* **HIGH** - publisher level account able to run malicious code or nefarious activity, or other high level security things.
|
* **HIGH** - publisher level account able to run malicious code or nefarious activity, or other high level security things.
|
||||||
|
|
|
||||||
Binary file not shown.
2
bin/gpm
2
bin/gpm
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
2
bin/grav
2
bin/grav
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ actor: Tester
|
||||||
bootstrap: _bootstrap.php
|
bootstrap: _bootstrap.php
|
||||||
paths:
|
paths:
|
||||||
tests: tests
|
tests: tests
|
||||||
log: tests/_output
|
output: tests/_output
|
||||||
data: tests/_data
|
data: tests/_data
|
||||||
support: tests/_support
|
support: tests/_support
|
||||||
envs: tests/_envs
|
envs: tests/_envs
|
||||||
|
|
|
||||||
102
composer.json
102
composer.json
|
|
@ -12,7 +12,7 @@
|
||||||
"homepage": "https://getgrav.org",
|
"homepage": "https://getgrav.org",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.3.6 || ^8.0",
|
"php": "^8.2",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
|
|
@ -20,61 +20,71 @@
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"symfony/polyfill-mbstring": "~1.23",
|
"symfony/polyfill-mbstring": "^1.24",
|
||||||
"symfony/polyfill-iconv": "^1.23",
|
"symfony/polyfill-iconv": "^1.24",
|
||||||
"symfony/polyfill-php74": "^1.23",
|
"symfony/polyfill-php80": "^1.24",
|
||||||
"symfony/polyfill-php80": "^1.23",
|
"symfony/polyfill-php81": "^1.24",
|
||||||
"symfony/polyfill-php81": "^1.23",
|
|
||||||
"psr/simple-cache": "^1.0",
|
"psr/simple-cache": "^1.0",
|
||||||
"psr/http-message": "^1.0",
|
"psr/http-message": "^1.1",
|
||||||
"psr/http-server-middleware": "^1.0",
|
"psr/http-server-middleware": "^1.0",
|
||||||
"psr/container": "~1.1.0",
|
"psr/container": "^1.1",
|
||||||
"nyholm/psr7-server": "^1.0",
|
"psr/log": "^1.1",
|
||||||
"nyholm/psr7": "^1.3",
|
"symfony/cache": "^6.4",
|
||||||
"twig/twig": "~v1.44",
|
"symfony/yaml": "^6.4",
|
||||||
|
"symfony/console": "^6.4",
|
||||||
|
"symfony/event-dispatcher": "^6.4",
|
||||||
|
"symfony/var-exporter": "^6.4",
|
||||||
|
"symfony/var-dumper": "^6.4",
|
||||||
|
"symfony/process": "^6.4",
|
||||||
|
"symfony/http-client": "^6.4",
|
||||||
|
"twig/twig": "^2.1",
|
||||||
|
"monolog/monolog": "^2.0",
|
||||||
|
"doctrine/cache": "^2.2",
|
||||||
|
"doctrine/collections": "^2.2",
|
||||||
|
"pimple/pimple": "~3.5.0",
|
||||||
|
"nyholm/psr7-server": "^1.1",
|
||||||
|
"nyholm/psr7": "^1.8",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"erusev/parsedown-extra": "~0.8",
|
"erusev/parsedown-extra": "~0.8",
|
||||||
"symfony/contracts": "~1.1",
|
"rockettheme/toolbox": "v2.x-dev",
|
||||||
"symfony/yaml": "~4.4",
|
"composer/ca-bundle": "^1.5",
|
||||||
"symfony/console": "~4.4",
|
"composer/semver": "^3.4",
|
||||||
"symfony/event-dispatcher": "~4.4",
|
"dragonmantank/cron-expression": "^3.0",
|
||||||
"symfony/var-dumper": "~4.4",
|
"willdurand/negotiation": "^3.1",
|
||||||
"symfony/process": "~4.4",
|
|
||||||
"doctrine/cache": "^1.10",
|
|
||||||
"doctrine/collections": "^1.6",
|
|
||||||
"guzzlehttp/psr7": "^1.7",
|
|
||||||
"filp/whoops": "~2.9",
|
|
||||||
"matthiasmullie/minify": "^1.3",
|
|
||||||
"monolog/monolog": "~1.25",
|
|
||||||
"getgrav/image": "^3.0",
|
|
||||||
"getgrav/cache": "^2.0",
|
|
||||||
"donatj/phpuseragentparser": "~1.1",
|
|
||||||
"pimple/pimple": "~3.5.0",
|
|
||||||
"rockettheme/toolbox": "~1.5",
|
|
||||||
"maximebf/debugbar": "~1.16",
|
|
||||||
"league/climate": "^3.6",
|
|
||||||
"miljar/php-exif": "^0.6",
|
|
||||||
"composer/ca-bundle": "^1.2",
|
|
||||||
"dragonmantank/cron-expression": "^1.2",
|
|
||||||
"willdurand/negotiation": "^3.0",
|
|
||||||
"itsgoingd/clockwork": "^5.0",
|
|
||||||
"symfony/http-client": "^4.4",
|
|
||||||
"composer/semver": "^1.4",
|
|
||||||
"rhukster/dom-sanitizer": "^1.0",
|
"rhukster/dom-sanitizer": "^1.0",
|
||||||
|
"matthiasmullie/minify": "^1.3",
|
||||||
|
"donatj/phpuseragentparser": "~1.9",
|
||||||
|
"guzzlehttp/psr7": "^2.7",
|
||||||
|
"filp/whoops": "~2.16",
|
||||||
|
"itsgoingd/clockwork": "dev-master",
|
||||||
|
"maximebf/debugbar": "~1.23",
|
||||||
|
"getgrav/image": "^4.0",
|
||||||
|
"getgrav/cache": "^2.0",
|
||||||
|
"antoligy/dom-string-iterators": "^1.0",
|
||||||
|
"miljar/php-exif": "^0.6",
|
||||||
|
"league/climate": "^3.8",
|
||||||
"multiavatar/multiavatar-php": "^1.0"
|
"multiavatar/multiavatar-php": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeception/codeception": "^4.1",
|
"codeception/codeception": "^5.1",
|
||||||
"phpstan/phpstan": "^1.8",
|
"phpstan/phpstan": "^1.12",
|
||||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
"phpstan/phpstan-deprecation-rules": "^1.2",
|
||||||
"phpunit/php-code-coverage": "~9.2",
|
"phpunit/php-code-coverage": "~9.2",
|
||||||
"getgrav/markdowndocs": "^2.0",
|
"getgrav/markdowndocs": "^2.0",
|
||||||
"codeception/module-asserts": "^1.3",
|
"codeception/module-asserts": "*",
|
||||||
"codeception/module-phpbrowser": "^1.0"
|
"codeception/module-phpbrowser": "*",
|
||||||
|
"rector/rector": "^1.2"
|
||||||
},
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/rockettheme/toolbox"
|
||||||
|
}
|
||||||
|
],
|
||||||
"replace": {
|
"replace": {
|
||||||
"symfony/polyfill-php72": "*",
|
"symfony/polyfill-php72": "*",
|
||||||
"symfony/polyfill-php73": "*"
|
"symfony/polyfill-php73": "*",
|
||||||
|
"symfony/polyfill-php74": "*"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mbstring": "Recommended for better performance",
|
"ext-mbstring": "Recommended for better performance",
|
||||||
|
|
@ -89,12 +99,14 @@
|
||||||
"config": {
|
"config": {
|
||||||
"apcu-autoloader": true,
|
"apcu-autoloader": true,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.3.6"
|
"php": "8.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Grav\\": "system/src/Grav",
|
"Grav\\": "system/src/Grav",
|
||||||
|
"Doctrine\\": "system/src/Doctrine",
|
||||||
|
"RocketTheme\\": "system/src/RocketTheme",
|
||||||
"Twig\\": "system/src/Twig"
|
"Twig\\": "system/src/Twig"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
@ -117,7 +129,7 @@
|
||||||
"api-17": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.17.md",
|
"api-17": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.17.md",
|
||||||
"post-create-project-cmd": "bin/grav install",
|
"post-create-project-cmd": "bin/grav install",
|
||||||
"phpstan": "vendor/bin/phpstan analyse -l 2 -c ./tests/phpstan/phpstan.neon --memory-limit=720M system/src",
|
"phpstan": "vendor/bin/phpstan analyse -l 2 -c ./tests/phpstan/phpstan.neon --memory-limit=720M system/src",
|
||||||
"phpstan-framework": "vendor/bin/phpstan analyse -l 5 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src/Grav/Framework system/src/Grav/Events system/src/Grav/Installer",
|
"phpstan-framework": "vendor/bin/phpstan analyse -l 6 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src/Grav/Framework system/src/Grav/Events system/src/Grav/Installer",
|
||||||
"phpstan-plugins": "vendor/bin/phpstan analyse -l 1 -c ./tests/phpstan/plugins.neon --memory-limit=400M user/plugins",
|
"phpstan-plugins": "vendor/bin/phpstan analyse -l 1 -c ./tests/phpstan/plugins.neon --memory-limit=400M user/plugins",
|
||||||
"test": "vendor/bin/codecept run unit",
|
"test": "vendor/bin/codecept run unit",
|
||||||
"test-windows": "vendor\\bin\\codecept run unit"
|
"test-windows": "vendor\\bin\\codecept run unit"
|
||||||
|
|
|
||||||
2437
composer.lock
generated
2437
composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -10,7 +10,7 @@
|
||||||
namespace Grav;
|
namespace Grav;
|
||||||
|
|
||||||
\define('GRAV_REQUEST_TIME', microtime(true));
|
\define('GRAV_REQUEST_TIME', microtime(true));
|
||||||
\define('GRAV_PHP_MIN', '7.3.6');
|
\define('GRAV_PHP_MIN', '8.2.0');
|
||||||
|
|
||||||
if (PHP_SAPI === 'cli-server') {
|
if (PHP_SAPI === 'cli-server') {
|
||||||
$symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'] ?? '', 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'] ?? '', 'symfony') !== false;
|
$symfony_server = stripos(getenv('_'), 'symfony') !== false || stripos($_SERVER['SERVER_SOFTWARE'] ?? '', 'symfony') !== false || stripos($_ENV['SERVER_SOFTWARE'] ?? '', 'symfony') !== false;
|
||||||
|
|
|
||||||
|
|
@ -619,11 +619,9 @@ form:
|
||||||
options:
|
options:
|
||||||
auto: Auto detect
|
auto: Auto detect
|
||||||
file: File
|
file: File
|
||||||
apc: APC
|
|
||||||
apcu: APCu
|
apcu: APCu
|
||||||
memcache: Memcache
|
memcache: Memcache
|
||||||
memcached: Memcached
|
memcached: Memcached
|
||||||
wincache: WinCache
|
|
||||||
redis: Redis
|
redis: Redis
|
||||||
|
|
||||||
cache.prefix:
|
cache.prefix:
|
||||||
|
|
@ -707,20 +705,6 @@ form:
|
||||||
validate:
|
validate:
|
||||||
type: bool
|
type: bool
|
||||||
|
|
||||||
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:
|
cache.memcached.server:
|
||||||
type: text
|
type: text
|
||||||
size: medium
|
size: medium
|
||||||
|
|
@ -884,17 +868,6 @@ form:
|
||||||
validate:
|
validate:
|
||||||
type: bool
|
type: bool
|
||||||
|
|
||||||
twig.umask_fix:
|
|
||||||
type: toggle
|
|
||||||
label: PLUGIN_ADMIN.TWIG_UMASK_FIX
|
|
||||||
help: PLUGIN_ADMIN.TWIG_UMASK_FIX_HELP
|
|
||||||
highlight: 0
|
|
||||||
options:
|
|
||||||
1: PLUGIN_ADMIN.YES
|
|
||||||
0: PLUGIN_ADMIN.NO
|
|
||||||
validate:
|
|
||||||
type: bool
|
|
||||||
|
|
||||||
assets:
|
assets:
|
||||||
type: tab
|
type: tab
|
||||||
title: PLUGIN_ADMIN.ASSETS
|
title: PLUGIN_ADMIN.ASSETS
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -93,13 +93,13 @@ cache:
|
||||||
enabled: true # Set to true to enable caching
|
enabled: true # Set to true to enable caching
|
||||||
check:
|
check:
|
||||||
method: file # Method to check for updates in pages: file|folder|hash|none
|
method: file # Method to check for updates in pages: file|folder|hash|none
|
||||||
driver: auto # One of: auto|file|apcu|memcache|wincache
|
driver: auto # One of: auto|file|apcu|memcached|redis
|
||||||
prefix: 'g' # Cache prefix string (prevents cache conflicts)
|
prefix: 'g' # Cache prefix string (prevents cache conflicts)
|
||||||
purge_at: '0 4 * * *' # How often to purge old file cache (using new scheduler)
|
purge_at: '0 4 * * *' # How often to purge old file cache (using new scheduler)
|
||||||
clear_at: '0 3 * * *' # How often to clear cache (using new scheduler)
|
clear_at: '0 3 * * *' # How often to clear cache (using new scheduler)
|
||||||
clear_job_type: 'standard' # Type to clear when processing the scheduled clear job `standard`|`all`
|
clear_job_type: 'standard' # Type to clear when processing the scheduled clear job `standard`|`all`
|
||||||
clear_images_by_default: false # By default grav does not include processed images in cache clear, this can be enabled
|
clear_images_by_default: false # By default grav does not include processed images in cache clear, this can be enabled
|
||||||
cli_compatibility: false # Ensures only non-volatile drivers are used (file, redis, memcache, etc.)
|
cli_compatibility: false # Ensures only non-volatile drivers are used (file, redis, memcached, etc.)
|
||||||
lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite)
|
lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite)
|
||||||
gzip: false # GZip compress the page output
|
gzip: false # GZip compress the page output
|
||||||
allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event
|
allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event
|
||||||
|
|
@ -117,7 +117,6 @@ twig:
|
||||||
undefined_filters: true # Allow undefined filters
|
undefined_filters: true # Allow undefined filters
|
||||||
safe_functions: [] # List of PHP functions which are allowed to be used as Twig functions
|
safe_functions: [] # List of PHP functions which are allowed to be used as Twig functions
|
||||||
safe_filters: [] # List of PHP functions which are allowed to be used as Twig filters
|
safe_filters: [] # List of PHP functions which are allowed to be used as Twig filters
|
||||||
umask_fix: false # By default Twig creates cached files as 755, fix switches this to 775
|
|
||||||
|
|
||||||
assets: # Configuration for Assets Manager (JS, CSS)
|
assets: # Configuration for Assets Manager (JS, CSS)
|
||||||
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
|
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
|
||||||
|
|
|
||||||
|
|
@ -3,19 +3,19 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Core
|
* @package Grav\Core
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Some standard defines
|
// Some standard defines
|
||||||
define('GRAV', true);
|
define('GRAV', true);
|
||||||
define('GRAV_VERSION', '1.7.48');
|
define('GRAV_VERSION', '1.8.0-beta.2');
|
||||||
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
|
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
|
||||||
define('GRAV_TESTING', false);
|
define('GRAV_TESTING', true);
|
||||||
|
|
||||||
// PHP minimum requirement
|
// PHP minimum requirement
|
||||||
if (!defined('GRAV_PHP_MIN')) {
|
if (!defined('GRAV_PHP_MIN')) {
|
||||||
define('GRAV_PHP_MIN', '7.3.6');
|
define('GRAV_PHP_MIN', '8.2.0');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Directory separator
|
// Directory separator
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Core
|
* @package Grav\Core
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Core
|
* @package Grav\Core
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
93
system/src/Doctrine/Common/Cache/FilesystemCache.php
Normal file
93
system/src/Doctrine/Common/Cache/FilesystemCache.php
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Doctrine\Common\Cache;
|
||||||
|
|
||||||
|
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filesystem cache driver (backwards compatibility).
|
||||||
|
*/
|
||||||
|
class FilesystemCache extends CacheProvider
|
||||||
|
{
|
||||||
|
public const EXTENSION = '.doctrinecache.data';
|
||||||
|
|
||||||
|
/** @var FilesystemAdapter */
|
||||||
|
private $pool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function __construct($directory, $extension = self::EXTENSION, $umask = 0002)
|
||||||
|
{
|
||||||
|
user_error(__CLASS__ . ' is deprecated since Grav 1.8, use Symfony cache instead', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
$this->pool = new FilesystemAdapter('', 0, $directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function doFetch($id)
|
||||||
|
{
|
||||||
|
$item = $this->pool->getItem(rawurlencode($id));
|
||||||
|
|
||||||
|
return $item->isHit() ? $item->get() : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function doContains($id)
|
||||||
|
{
|
||||||
|
return $this->pool->hasItem(rawurlencode($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function doSave($id, $data, $lifeTime = 0)
|
||||||
|
{
|
||||||
|
$item = $this->pool->getItem(rawurlencode($id));
|
||||||
|
|
||||||
|
if (0 < $lifeTime) {
|
||||||
|
$item->expiresAfter($lifeTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->pool->save($item->set($data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function doDelete($id)
|
||||||
|
{
|
||||||
|
return $this->pool->deleteItem(rawurlencode($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function doFlush()
|
||||||
|
{
|
||||||
|
return $this->pool->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*
|
||||||
|
* @return array|null
|
||||||
|
*/
|
||||||
|
protected function doGetStats()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common
|
* @package Grav\Common
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets
|
* @package Grav\Common\Assets
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets\Traits
|
* @package Grav\Common\Assets\Traits
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets\Traits
|
* @package Grav\Common\Assets\Traits
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Assets\Traits
|
* @package Grav\Common\Assets\Traits
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Backup
|
* @package Grav\Common\Backup
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ class Backups
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public static function backup($id = 0, callable $status = null)
|
public static function backup($id = 0, ?callable $status = null)
|
||||||
{
|
{
|
||||||
$grav = Grav::instance();
|
$grav = Grav::instance();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common
|
* @package Grav\Common
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common
|
* @package Grav\Common
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Grav\Common;
|
namespace Grav\Common;
|
||||||
|
|
||||||
use DirectoryIterator;
|
use DirectoryIterator;
|
||||||
use \Doctrine\Common\Cache as DoctrineCache;
|
use Doctrine\Common\Cache\CacheProvider;
|
||||||
|
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Grav\Common\Config\Config;
|
use Grav\Common\Config\Config;
|
||||||
use Grav\Common\Filesystem\Folder;
|
use Grav\Common\Filesystem\Folder;
|
||||||
|
|
@ -18,6 +19,12 @@ use Grav\Common\Scheduler\Scheduler;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
use RocketTheme\Toolbox\Event\Event;
|
use RocketTheme\Toolbox\Event\Event;
|
||||||
|
use Symfony\Component\Cache\Adapter\AdapterInterface;
|
||||||
|
use Symfony\Component\Cache\Adapter\ApcuAdapter;
|
||||||
|
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
|
||||||
|
use Symfony\Component\Cache\Adapter\MemcachedAdapter;
|
||||||
|
use Symfony\Component\Cache\Adapter\RedisAdapter;
|
||||||
|
use Symfony\Component\Cache\Psr16Cache;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||||
use function dirname;
|
use function dirname;
|
||||||
use function extension_loaded;
|
use function extension_loaded;
|
||||||
|
|
@ -27,12 +34,11 @@ use function is_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The GravCache object is used throughout Grav to store and retrieve cached data.
|
* The GravCache object is used throughout Grav to store and retrieve cached data.
|
||||||
* It uses DoctrineCache library and supports a variety of caching mechanisms. Those include:
|
* It uses Symfony library (adding backward compatibility to Doctrine Cache) and supports a variety of caching mechanisms. Those include:
|
||||||
*
|
*
|
||||||
* APCu
|
* APCu
|
||||||
* RedisCache
|
* RedisCache
|
||||||
* MemCache
|
* MemCached
|
||||||
* MemCacheD
|
|
||||||
* FileSystem
|
* FileSystem
|
||||||
*/
|
*/
|
||||||
class Cache extends Getters
|
class Cache extends Getters
|
||||||
|
|
@ -49,7 +55,10 @@ class Cache extends Getters
|
||||||
/** @var Config $config */
|
/** @var Config $config */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/** @var DoctrineCache\CacheProvider */
|
/** @var AdapterInterface */
|
||||||
|
protected $adapter;
|
||||||
|
|
||||||
|
/** @var CacheProvider */
|
||||||
protected $driver;
|
protected $driver;
|
||||||
|
|
||||||
/** @var CacheInterface */
|
/** @var CacheInterface */
|
||||||
|
|
@ -70,6 +79,7 @@ class Cache extends Getters
|
||||||
protected static $standard_remove = [
|
protected static $standard_remove = [
|
||||||
'cache://twig/',
|
'cache://twig/',
|
||||||
'cache://doctrine/',
|
'cache://doctrine/',
|
||||||
|
'cache://grav/',
|
||||||
'cache://compiled/',
|
'cache://compiled/',
|
||||||
'cache://clockwork/',
|
'cache://clockwork/',
|
||||||
'cache://validated-',
|
'cache://validated-',
|
||||||
|
|
@ -80,6 +90,7 @@ class Cache extends Getters
|
||||||
protected static $standard_remove_no_images = [
|
protected static $standard_remove_no_images = [
|
||||||
'cache://twig/',
|
'cache://twig/',
|
||||||
'cache://doctrine/',
|
'cache://doctrine/',
|
||||||
|
'cache://grav/',
|
||||||
'cache://compiled/',
|
'cache://compiled/',
|
||||||
'cache://clockwork/',
|
'cache://clockwork/',
|
||||||
'cache://validated-',
|
'cache://validated-',
|
||||||
|
|
@ -142,10 +153,10 @@ class Cache extends Getters
|
||||||
|
|
||||||
// Cache key allows us to invalidate all cache on configuration changes.
|
// Cache key allows us to invalidate all cache on configuration changes.
|
||||||
$this->key = ($prefix ?: 'g') . '-' . $uniqueness;
|
$this->key = ($prefix ?: 'g') . '-' . $uniqueness;
|
||||||
$this->cache_dir = $grav['locator']->findResource('cache://doctrine/' . $uniqueness, true, true);
|
$this->cache_dir = $grav['locator']->findResource('cache://grav/' . $uniqueness, true, true);
|
||||||
$this->driver_setting = $this->config->get('system.cache.driver');
|
$this->driver_setting = $this->config->get('system.cache.driver');
|
||||||
$this->driver = $this->getCacheDriver();
|
$this->adapter = $this->getCacheAdapter();
|
||||||
$this->driver->setNamespace($this->key);
|
$this->driver = $this->getCacheDriver($this->adapter);
|
||||||
|
|
||||||
/** @var EventDispatcher $dispatcher */
|
/** @var EventDispatcher $dispatcher */
|
||||||
$dispatcher = Grav::instance()['events'];
|
$dispatcher = Grav::instance()['events'];
|
||||||
|
|
@ -158,12 +169,7 @@ class Cache extends Getters
|
||||||
public function getSimpleCache()
|
public function getSimpleCache()
|
||||||
{
|
{
|
||||||
if (null === $this->simpleCache) {
|
if (null === $this->simpleCache) {
|
||||||
$cache = new \Grav\Framework\Cache\Adapter\DoctrineCache($this->driver, '', $this->getLifetime());
|
$this->simpleCache = new Psr16Cache($this->adapter);
|
||||||
|
|
||||||
// Disable cache key validation.
|
|
||||||
$cache->setValidation(false);
|
|
||||||
|
|
||||||
$this->simpleCache = $cache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->simpleCache;
|
return $this->simpleCache;
|
||||||
|
|
@ -229,53 +235,42 @@ class Cache extends Getters
|
||||||
* If there is no config option for $driver in the config, or it's set to 'auto', it will
|
* If there is no config option for $driver in the config, or it's set to 'auto', it will
|
||||||
* pick the best option based on which cache extensions are installed.
|
* pick the best option based on which cache extensions are installed.
|
||||||
*
|
*
|
||||||
* @return DoctrineCache\CacheProvider The cache driver to use
|
* @param string|null $namespace
|
||||||
|
* @param int|null $defaultLifetime
|
||||||
|
* @return AdapterInterface The cache driver to use
|
||||||
|
* @throws \RedisException
|
||||||
|
* @throws \Symfony\Component\Cache\Exception\CacheException
|
||||||
*/
|
*/
|
||||||
public function getCacheDriver()
|
public function getCacheAdapter(?string $namespace = null, ?int $defaultLifetime = null): AdapterInterface
|
||||||
{
|
{
|
||||||
$setting = $this->driver_setting;
|
$setting = $this->driver_setting ?? 'auto';
|
||||||
$driver_name = 'file';
|
$driver_name = 'file';
|
||||||
|
|
||||||
|
if (in_array($setting, ['apc', 'xcache', 'wincache', 'memcache'], true)) {
|
||||||
|
throw new LogicException(sprintf('Cache driver for %s has been removed, use auto, file, apcu or memcached instead!', $setting));
|
||||||
|
}
|
||||||
|
|
||||||
// CLI compatibility requires a non-volatile cache driver
|
// CLI compatibility requires a non-volatile cache driver
|
||||||
if ($this->config->get('system.cache.cli_compatibility') && (
|
if ($this->config->get('system.cache.cli_compatibility') && ($setting === 'auto' || $this->isVolatileDriver($setting))) {
|
||||||
$setting === 'auto' || $this->isVolatileDriver($setting))) {
|
|
||||||
$setting = $driver_name;
|
$setting = $driver_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$setting || $setting === 'auto') {
|
if ($setting === 'auto' || $this->isVolatileDriver($setting)) {
|
||||||
if (extension_loaded('apcu')) {
|
if (extension_loaded('apcu')) {
|
||||||
$driver_name = 'apcu';
|
$driver_name = 'apcu';
|
||||||
} elseif (extension_loaded('wincache')) {
|
|
||||||
$driver_name = 'wincache';
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$driver_name = $setting;
|
$driver_name = $setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->driver_name = $driver_name;
|
$this->driver_name = $driver_name;
|
||||||
|
$namespace = $namespace ?? $this->key;
|
||||||
|
$defaultLifetime = $defaultLifetime ?? 0;
|
||||||
|
|
||||||
switch ($driver_name) {
|
switch ($driver_name) {
|
||||||
case 'apc':
|
case 'apc':
|
||||||
case 'apcu':
|
case 'apcu':
|
||||||
$driver = new DoctrineCache\ApcuCache();
|
$adapter = new ApcuAdapter($namespace, $defaultLifetime);
|
||||||
break;
|
|
||||||
|
|
||||||
case 'wincache':
|
|
||||||
$driver = new DoctrineCache\WinCacheCache();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'memcache':
|
|
||||||
if (extension_loaded('memcache')) {
|
|
||||||
$memcache = new \Memcache();
|
|
||||||
$memcache->connect(
|
|
||||||
$this->config->get('system.cache.memcache.server', 'localhost'),
|
|
||||||
$this->config->get('system.cache.memcache.port', 11211)
|
|
||||||
);
|
|
||||||
$driver = new DoctrineCache\MemcacheCache();
|
|
||||||
$driver->setMemcache($memcache);
|
|
||||||
} else {
|
|
||||||
throw new LogicException('Memcache PHP extension has not been installed');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'memcached':
|
case 'memcached':
|
||||||
|
|
@ -285,8 +280,7 @@ class Cache extends Getters
|
||||||
$this->config->get('system.cache.memcached.server', 'localhost'),
|
$this->config->get('system.cache.memcached.server', 'localhost'),
|
||||||
$this->config->get('system.cache.memcached.port', 11211)
|
$this->config->get('system.cache.memcached.port', 11211)
|
||||||
);
|
);
|
||||||
$driver = new DoctrineCache\MemcachedCache();
|
$adapter = new MemcachedAdapter($memcached, $namespace, $defaultLifetime);
|
||||||
$driver->setMemcached($memcached);
|
|
||||||
} else {
|
} else {
|
||||||
throw new LogicException('Memcached PHP extension has not been installed');
|
throw new LogicException('Memcached PHP extension has not been installed');
|
||||||
}
|
}
|
||||||
|
|
@ -318,19 +312,39 @@ class Cache extends Getters
|
||||||
throw new \RedisException('Could not select alternate Redis database ID');
|
throw new \RedisException('Could not select alternate Redis database ID');
|
||||||
}
|
}
|
||||||
|
|
||||||
$driver = new DoctrineCache\RedisCache();
|
$adapter = new RedisAdapter($redis, $namespace, $defaultLifetime);
|
||||||
$driver->setRedis($redis);
|
|
||||||
} else {
|
} else {
|
||||||
throw new LogicException('Redis PHP extension has not been installed');
|
throw new LogicException('Redis PHP extension has not been installed');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$driver = new DoctrineCache\FilesystemCache($this->cache_dir);
|
$adapter = new FilesystemAdapter($namespace, $defaultLifetime, $this->cache_dir);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $driver;
|
return $adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Automatically picks the cache mechanism to use. If you pick one manually it will use that
|
||||||
|
* If there is no config option for $driver in the config, or it's set to 'auto', it will
|
||||||
|
* pick the best option based on which cache extensions are installed.
|
||||||
|
*
|
||||||
|
* @return CacheProvider The cache driver to use
|
||||||
|
*/
|
||||||
|
public function getCacheDriver(?AdapterInterface $adapter = null)
|
||||||
|
{
|
||||||
|
if (null === $adapter) {
|
||||||
|
$adapter = $this->getCacheAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
$cache = DoctrineProvider::wrap($adapter);
|
||||||
|
if (!$cache instanceof CacheProvider) {
|
||||||
|
throw new \RuntimeException('Internal error');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -618,7 +632,7 @@ class Cache extends Getters
|
||||||
*/
|
*/
|
||||||
public function isVolatileDriver($setting)
|
public function isVolatileDriver($setting)
|
||||||
{
|
{
|
||||||
return in_array($setting, ['apc', 'apcu', 'xcache', 'wincache'], true);
|
return $setting === 'apcu';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common
|
* @package Grav\Common
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Config
|
* @package Grav\Common\Config
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -323,7 +323,7 @@ class Data implements DataInterface, ArrayAccess, \Countable, JsonSerializable,
|
||||||
* @param FileInterface|null $storage Optionally enter a new storage.
|
* @param FileInterface|null $storage Optionally enter a new storage.
|
||||||
* @return FileInterface|null
|
* @return FileInterface|null
|
||||||
*/
|
*/
|
||||||
public function file(FileInterface $storage = null)
|
public function file(?FileInterface $storage = null)
|
||||||
{
|
{
|
||||||
if ($storage) {
|
if ($storage) {
|
||||||
$this->storage = $storage;
|
$this->storage = $storage;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -80,5 +80,5 @@ interface DataInterface
|
||||||
* @param FileInterface|null $storage Optionally enter a new storage.
|
* @param FileInterface|null $storage Optionally enter a new storage.
|
||||||
* @return FileInterface
|
* @return FileInterface
|
||||||
*/
|
*/
|
||||||
public function file(FileInterface $storage = null);
|
public function file(?FileInterface $storage = null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -162,7 +162,7 @@ class Validation
|
||||||
* @param UserInterface|null $user
|
* @param UserInterface|null $user
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function authorize($action, UserInterface $user = null)
|
public static function authorize($action, ?UserInterface $user = null)
|
||||||
{
|
{
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Data
|
* @package Grav\Common\Data
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common
|
* @package Grav\Common
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -544,7 +544,7 @@ class Debugger
|
||||||
* @param string|null $message
|
* @param string|null $message
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function profile(callable $callable, string $message = null)
|
public function profile(callable $callable, ?string $message = null)
|
||||||
{
|
{
|
||||||
$this->startProfiling();
|
$this->startProfiling();
|
||||||
$response = $callable();
|
$response = $callable();
|
||||||
|
|
@ -585,7 +585,7 @@ class Debugger
|
||||||
* @param string|null $message
|
* @param string|null $message
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
public function stopProfiling(string $message = null): ?array
|
public function stopProfiling(?string $message = null): ?array
|
||||||
{
|
{
|
||||||
$timings = null;
|
$timings = null;
|
||||||
if ($this->enabled && extension_loaded('tideways_xhprof')) {
|
if ($this->enabled && extension_loaded('tideways_xhprof')) {
|
||||||
|
|
@ -776,7 +776,7 @@ class Debugger
|
||||||
* @param float|null $time
|
* @param float|null $time
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addEvent(string $name, $event, EventDispatcherInterface $dispatcher, float $time = null)
|
public function addEvent(string $name, $event, EventDispatcherInterface $dispatcher, ?float $time = null)
|
||||||
{
|
{
|
||||||
if ($this->enabled && $this->clockwork) {
|
if ($this->enabled && $this->clockwork) {
|
||||||
$time = $time ?? microtime(true);
|
$time = $time ?? microtime(true);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Errors
|
* @package Grav\Common\Errors
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Errors
|
* @package Grav\Common\Errors
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ class Errors
|
||||||
$logger = $grav['log'];
|
$logger = $grav['log'];
|
||||||
$whoops->pushHandler(function ($exception, $inspector, $run) use ($logger) {
|
$whoops->pushHandler(function ($exception, $inspector, $run) use ($logger) {
|
||||||
try {
|
try {
|
||||||
$logger->addCritical($exception->getMessage() . ' - Trace: ' . $exception->getTraceAsString());
|
$logger->critical($exception->getMessage() . ' - Trace: ' . $exception->getTraceAsString());
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo $e;
|
echo $e;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Errors
|
* @package Grav\Common\Errors
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Errors
|
* @package Grav\Common\Errors
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\File
|
* @package Grav\Common\File
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\File
|
* @package Grav\Common\File
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\File
|
* @package Grav\Common\File
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\File
|
* @package Grav\Common\File
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Filesystem
|
* @package Grav\Common\Filesystem
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -75,21 +75,21 @@ abstract class Archiver
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
abstract public function compress($folder, callable $status = null);
|
abstract public function compress($folder, ?callable $status = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $destination
|
* @param string $destination
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
abstract public function extract($destination, callable $status = null);
|
abstract public function extract($destination, ?callable $status = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $folders
|
* @param array $folders
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
abstract public function addEmptyFolders($folders, callable $status = null);
|
abstract public function addEmptyFolders($folders, ?callable $status = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $rootPath
|
* @param string $rootPath
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Filesystem
|
* @package Grav\Common\Filesystem
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Filesystem
|
* @package Grav\Common\Filesystem
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Filesystem
|
* @package Grav\Common\Filesystem
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Filesystem
|
* @package Grav\Common\Filesystem
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ class ZipArchiver extends Archiver
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function extract($destination, callable $status = null)
|
public function extract($destination, ?callable $status = null)
|
||||||
{
|
{
|
||||||
$zip = new ZipArchive();
|
$zip = new ZipArchive();
|
||||||
$archive = $zip->open($this->archive_file);
|
$archive = $zip->open($this->archive_file);
|
||||||
|
|
@ -51,7 +51,7 @@ class ZipArchiver extends Archiver
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function compress($source, callable $status = null)
|
public function compress($source, ?callable $status = null)
|
||||||
{
|
{
|
||||||
if (!extension_loaded('zip')) {
|
if (!extension_loaded('zip')) {
|
||||||
throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');
|
throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');
|
||||||
|
|
@ -105,7 +105,7 @@ class ZipArchiver extends Archiver
|
||||||
* @param callable|null $status
|
* @param callable|null $status
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function addEmptyFolders($folders, callable $status = null)
|
public function addEmptyFolders($folders, ?callable $status = null)
|
||||||
{
|
{
|
||||||
if (!extension_loaded('zip')) {
|
if (!extension_loaded('zip')) {
|
||||||
throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');
|
throw new InvalidArgumentException('ZipArchiver: Zip PHP module not installed...');
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ abstract class FlexObject extends \Grav\Framework\Flex\FlexObject implements Med
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
* @see FlexObjectInterface::getFormValue()
|
* @see FlexObjectInterface::getFormValue()
|
||||||
*/
|
*/
|
||||||
public function getFormValue(string $name, $default = null, string $separator = null)
|
public function getFormValue(string $name, $default = null, ?string $separator = null)
|
||||||
{
|
{
|
||||||
$value = $this->getNestedProperty($name, null, $separator);
|
$value = $this->getNestedProperty($name, null, $separator);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -766,7 +766,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa
|
||||||
* @return static
|
* @return static
|
||||||
* @phpstan-return static<T>
|
* @phpstan-return static<T>
|
||||||
*/
|
*/
|
||||||
public function withTranslation(bool $bool = true, string $languageCode = null, bool $fallback = null)
|
public function withTranslation(bool $bool = true, ?string $languageCode = null, ?bool $fallback = null)
|
||||||
{
|
{
|
||||||
$list = array_keys(array_filter($this->call('hasTranslation', [$languageCode, $fallback])));
|
$list = array_keys(array_filter($this->call('hasTranslation', [$languageCode, $fallback])));
|
||||||
|
|
||||||
|
|
@ -778,7 +778,7 @@ class PageCollection extends FlexPageCollection implements PageCollectionInterfa
|
||||||
* @param bool|null $fallback
|
* @param bool|null $fallback
|
||||||
* @return PageIndex
|
* @return PageIndex
|
||||||
*/
|
*/
|
||||||
public function withTranslated(string $languageCode = null, bool $fallback = null)
|
public function withTranslated(?string $languageCode = null, ?bool $fallback = null)
|
||||||
{
|
{
|
||||||
return $this->getIndex()->withTranslated($languageCode, $fallback);
|
return $this->getIndex()->withTranslated($languageCode, $fallback);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
public const ORDER_LIST_REGEX = '/(\/\d+)\.[^\/]+/u';
|
public const ORDER_LIST_REGEX = '/(\/\d+)\.[^\/]+/u';
|
||||||
public const PAGE_ROUTE_REGEX = '/\/\d+\./u';
|
public const PAGE_ROUTE_REGEX = '/\/\d+\./u';
|
||||||
|
|
||||||
/** @var PageObject|array */
|
/** @var T|array */
|
||||||
protected $_root;
|
protected $_root;
|
||||||
/** @var array|null */
|
/** @var array|null */
|
||||||
protected $_params;
|
protected $_params;
|
||||||
|
|
@ -66,7 +66,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @param array $entries
|
* @param array $entries
|
||||||
* @param FlexDirectory|null $directory
|
* @param FlexDirectory|null $directory
|
||||||
*/
|
*/
|
||||||
public function __construct(array $entries = [], FlexDirectory $directory = null)
|
public function __construct(array $entries = [], ?FlexDirectory $directory = null)
|
||||||
{
|
{
|
||||||
// Remove root if it's taken.
|
// Remove root if it's taken.
|
||||||
if (isset($entries[''])) {
|
if (isset($entries[''])) {
|
||||||
|
|
@ -181,7 +181,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @return static
|
* @return static
|
||||||
* @phpstan-return static<T,C>
|
* @phpstan-return static<T,C>
|
||||||
*/
|
*/
|
||||||
public function withTranslated(string $languageCode = null, bool $fallback = null)
|
public function withTranslated(?string $languageCode = null, ?bool $fallback = null)
|
||||||
{
|
{
|
||||||
if (null === $languageCode) {
|
if (null === $languageCode) {
|
||||||
return $this;
|
return $this;
|
||||||
|
|
@ -413,7 +413,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @return static
|
* @return static
|
||||||
* @phpstan-return static<T,C>
|
* @phpstan-return static<T,C>
|
||||||
*/
|
*/
|
||||||
protected function createFrom(array $entries, string $keyField = null)
|
protected function createFrom(array $entries, ?string $keyField = null)
|
||||||
{
|
{
|
||||||
/** @var static $index */
|
/** @var static $index */
|
||||||
$index = parent::createFrom($entries, $keyField);
|
$index = parent::createFrom($entries, $keyField);
|
||||||
|
|
@ -428,7 +428,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @param bool|null $fallback
|
* @param bool|null $fallback
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function translateEntries(array $entries, string $lang, bool $fallback = null): array
|
protected function translateEntries(array $entries, string $lang, ?bool $fallback = null): array
|
||||||
{
|
{
|
||||||
$languages = $this->getFallbackLanguages($lang, $fallback);
|
$languages = $this->getFallbackLanguages($lang, $fallback);
|
||||||
foreach ($entries as $key => &$entry) {
|
foreach ($entries as $key => &$entry) {
|
||||||
|
|
@ -493,7 +493,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @param bool|null $fallback
|
* @param bool|null $fallback
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function getFallbackLanguages(string $languageCode = null, bool $fallback = null): array
|
protected function getFallbackLanguages(?string $languageCode = null, ?bool $fallback = null): array
|
||||||
{
|
{
|
||||||
$fallback = $fallback ?? true;
|
$fallback = $fallback ?? true;
|
||||||
if (!$fallback && null !== $languageCode) {
|
if (!$fallback && null !== $languageCode) {
|
||||||
|
|
@ -781,7 +781,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
|
||||||
* @param int|null $timestamp
|
* @param int|null $timestamp
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
private function jsDate(int $timestamp = null): ?string
|
private function jsDate(?int $timestamp = null): ?string
|
||||||
{
|
{
|
||||||
if (!$timestamp) {
|
if (!$timestamp) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -129,7 +129,7 @@ class PageObject extends FlexPageObject
|
||||||
/**
|
/**
|
||||||
* @inheritdoc PageInterface
|
* @inheritdoc PageInterface
|
||||||
*/
|
*/
|
||||||
public function getFormValue(string $name, $default = null, string $separator = null)
|
public function getFormValue(string $name, $default = null, ?string $separator = null)
|
||||||
{
|
{
|
||||||
$test = new stdClass();
|
$test = new stdClass();
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ class PageObject extends FlexPageObject
|
||||||
/**
|
/**
|
||||||
* @param UserInterface|null $user
|
* @param UserInterface|null $user
|
||||||
*/
|
*/
|
||||||
public function check(UserInterface $user = null): void
|
public function check(?UserInterface $user = null): void
|
||||||
{
|
{
|
||||||
parent::check($user);
|
parent::check($user);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ trait PageRoutableTrait
|
||||||
* @return PageInterface|null the parent page object if it exists.
|
* @return PageInterface|null the parent page object if it exists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function parent(PageInterface $var = null)
|
public function parent(?PageInterface $var = null)
|
||||||
{
|
{
|
||||||
if (Utils::isAdminPlugin()) {
|
if (Utils::isAdminPlugin()) {
|
||||||
return parent::parent();
|
return parent::parent();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ class UserGroupCollection extends FlexCollection
|
||||||
* @param string|null $scope
|
* @param string|null $scope
|
||||||
* @return bool|null
|
* @return bool|null
|
||||||
*/
|
*/
|
||||||
public function authorize(string $action, string $scope = null): ?bool
|
public function authorize(string $action, ?string $scope = null): ?bool
|
||||||
{
|
{
|
||||||
$authorized = null;
|
$authorized = null;
|
||||||
/** @var UserGroupObject $object */
|
/** @var UserGroupObject $object */
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ class UserGroupObject extends FlexObject implements UserGroupInterface
|
||||||
* @param string|null $scope
|
* @param string|null $scope
|
||||||
* @return bool|null
|
* @return bool|null
|
||||||
*/
|
*/
|
||||||
public function authorize(string $action, string $scope = null): ?bool
|
public function authorize(string $action, ?string $scope = null): ?bool
|
||||||
{
|
{
|
||||||
if ($scope === 'test') {
|
if ($scope === 'test') {
|
||||||
$scope = null;
|
$scope = null;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ class UserFileStorage extends FileStorage
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
* @see FlexStorageInterface::getMediaPath()
|
* @see FlexStorageInterface::getMediaPath()
|
||||||
*/
|
*/
|
||||||
public function getMediaPath(string $key = null): ?string
|
public function getMediaPath(?string $key = null): ?string
|
||||||
{
|
{
|
||||||
// There is no media support for file storage (fallback to common location).
|
// There is no media support for file storage (fallback to common location).
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@ class UserIndex extends FlexIndex implements UserCollectionInterface
|
||||||
|
|
||||||
/** @var Logger $logger */
|
/** @var Logger $logger */
|
||||||
$logger = $grav['log'];
|
$logger = $grav['log'];
|
||||||
$logger->addDebug($message);
|
$logger->debug($message);
|
||||||
|
|
||||||
/** @var Debugger $debugger */
|
/** @var Debugger $debugger */
|
||||||
$debugger = $grav['debugger'];
|
$debugger = $grav['debugger'];
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Flex
|
* @package Grav\Common\Flex
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -92,9 +92,9 @@ class UserObject extends FlexObject implements UserInterface, Countable
|
||||||
protected $_uploads_original;
|
protected $_uploads_original;
|
||||||
/** @var FileInterface|null */
|
/** @var FileInterface|null */
|
||||||
protected $_storage;
|
protected $_storage;
|
||||||
/** @var UserGroupIndex */
|
/** @var UserGroupIndex|null */
|
||||||
protected $_groups;
|
protected $_groups;
|
||||||
/** @var Access */
|
/** @var Access|null */
|
||||||
protected $_access;
|
protected $_access;
|
||||||
/** @var array|null */
|
/** @var array|null */
|
||||||
protected $access;
|
protected $access;
|
||||||
|
|
@ -270,7 +270,7 @@ class UserObject extends FlexObject implements UserInterface, Countable
|
||||||
* @param string|null $scope
|
* @param string|null $scope
|
||||||
* @return bool|null
|
* @return bool|null
|
||||||
*/
|
*/
|
||||||
public function authorize(string $action, string $scope = null): ?bool
|
public function authorize(string $action, ?string $scope = null): ?bool
|
||||||
{
|
{
|
||||||
if ($scope === 'test') {
|
if ($scope === 'test') {
|
||||||
// Special scope to test user permissions.
|
// Special scope to test user permissions.
|
||||||
|
|
@ -557,7 +557,7 @@ class UserObject extends FlexObject implements UserInterface, Countable
|
||||||
* @param FileInterface|null $storage Optionally enter a new storage.
|
* @param FileInterface|null $storage Optionally enter a new storage.
|
||||||
* @return FileInterface|null
|
* @return FileInterface|null
|
||||||
*/
|
*/
|
||||||
public function file(FileInterface $storage = null)
|
public function file(?FileInterface $storage = null)
|
||||||
{
|
{
|
||||||
if (null !== $storage) {
|
if (null !== $storage) {
|
||||||
$this->_storage = $storage;
|
$this->_storage = $storage;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\Form
|
* @package Grav\Common\Form
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\GPM
|
* @package Grav\Common\GPM
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\GPM
|
* @package Grav\Common\GPM
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\GPM
|
* @package Grav\Common\GPM
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @package Grav\Common\GPM
|
* @package Grav\Common\GPM
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
|
||||||
* @license MIT License; see LICENSE file for details.
|
* @license MIT License; see LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user