diff --git a/CHANGELOG.md b/CHANGELOG.md
index e1505cbe..034425b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,16 @@
# 2.x branch
## 2.13 branch
+### 2.13.3
+* added `--reverse` option for the `IndexCommand` ([issue #96](https://github.com/mirko-pagliai/cakephp-database-backup/issues/96));
+* the `BackupTrait::getAbsolutePath()` method is now able to recognize a path relative to its `ROOT`, so as to be able
+ to take advantage of the autocompletion already offered by the bash console when, for example, you use the `import`
+ command from the `ROOT` and the backup directory is inside it;
+* fixed a bug for `IndexCommand`, data was not sorted correctly on individual rows. Improved testing;
+* slightly improved backup file sorting for `BackupManager::index()` method (this is useful when you have a lot of files);
+* requires at least `symfony/process` `7.1.7`, due to this [security vulnerability](https://github.com/mirko-pagliai/cakephp-database-backup/security/dependabot/1);
+* fixed some errors in localizations of some strings;
+* replaced deprecated `getMockForAbstractClass()` method in tests.
+
### 2.13.2
* no longer needs `php-tools`;
* removed useless `CommandTestCase`;
diff --git a/composer.json b/composer.json
index 4af2de04..db8245b2 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
"ext-fileinfo": "*",
"cakephp/cakephp": "^5.0",
"symfony/finder": "^6.0|^7.1",
- "symfony/process": "^6.0|^7.0"
+ "symfony/process": "^6.0|^7.1.7"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0",
diff --git a/composer.lock b/composer.lock
index c63de494..d9091e71 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "4485227061f58e3b7fe72cd383857b51",
+ "content-hash": "600b928e403761fa8d0f5635d401f3d0",
"packages": [
{
"name": "cakephp/cakephp",
- "version": "5.1.1",
+ "version": "5.1.4",
"source": {
"type": "git",
"url": "https://github.com/cakephp/cakephp.git",
- "reference": "b7ac799b88cd751cdbe8ce808767a0e8fbf474bb"
+ "reference": "c8e4f57dcb812255c8af24b44a967e9a6ac5662e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/cakephp/zipball/b7ac799b88cd751cdbe8ce808767a0e8fbf474bb",
- "reference": "b7ac799b88cd751cdbe8ce808767a0e8fbf474bb",
+ "url": "https://api.github.com/repos/cakephp/cakephp/zipball/c8e4f57dcb812255c8af24b44a967e9a6ac5662e",
+ "reference": "c8e4f57dcb812255c8af24b44a967e9a6ac5662e",
"shasum": ""
},
"require": {
@@ -71,7 +71,7 @@
"mockery/mockery": "^1.6",
"paragonie/csp-builder": "^2.3 || ^3.0",
"phpstan/extension-installer": "^1.3",
- "phpstan/phpstan": "1.12.3",
+ "phpstan/phpstan": "1.12.7",
"phpunit/phpunit": "^10.5.5 || ^11.1.3",
"symplify/phpstan-rules": "^12.4"
},
@@ -124,7 +124,7 @@
"issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/cakephp"
},
- "time": "2024-10-04T02:50:14+00:00"
+ "time": "2024-12-13T03:56:40+00:00"
},
{
"name": "cakephp/chronos",
@@ -187,16 +187,16 @@
},
{
"name": "composer/ca-bundle",
- "version": "1.5.2",
+ "version": "1.5.4",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137"
+ "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137",
- "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/bc0593537a463e55cadf45fd938d23b75095b7e1",
+ "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1",
"shasum": ""
},
"require": {
@@ -243,7 +243,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/ca-bundle/issues",
- "source": "https://github.com/composer/ca-bundle/tree/1.5.2"
+ "source": "https://github.com/composer/ca-bundle/tree/1.5.4"
},
"funding": [
{
@@ -259,7 +259,7 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T07:49:53+00:00"
+ "time": "2024-11-27T15:35:25+00:00"
},
{
"name": "laminas/laminas-diactoros",
@@ -302,8 +302,8 @@
"type": "library",
"extra": {
"laminas": {
- "config-provider": "Laminas\\Diactoros\\ConfigProvider",
- "module": "Laminas\\Diactoros"
+ "module": "Laminas\\Diactoros",
+ "config-provider": "Laminas\\Diactoros\\ConfigProvider"
}
},
"autoload": {
@@ -351,30 +351,30 @@
},
{
"name": "laminas/laminas-httphandlerrunner",
- "version": "2.10.0",
+ "version": "2.11.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-httphandlerrunner.git",
- "reference": "35a0ba92e940a2f9533754f5a56187fa321f7693"
+ "reference": "c428d9f67f280d155637cbe2b7245b5188c8cdae"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/35a0ba92e940a2f9533754f5a56187fa321f7693",
- "reference": "35a0ba92e940a2f9533754f5a56187fa321f7693",
+ "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/c428d9f67f280d155637cbe2b7245b5188c8cdae",
+ "reference": "c428d9f67f280d155637cbe2b7245b5188c8cdae",
"shasum": ""
},
"require": {
- "php": "~8.1.0 || ~8.2.0 || ~8.3.0",
+ "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/http-message-implementation": "^1.0 || ^2.0",
"psr/http-server-handler": "^1.0"
},
"require-dev": {
- "laminas/laminas-coding-standard": "~2.5.0",
- "laminas/laminas-diactoros": "^3.3.0",
- "phpunit/phpunit": "^10.5.5",
- "psalm/plugin-phpunit": "^0.18.4",
- "vimeo/psalm": "^5.18"
+ "laminas/laminas-coding-standard": "~3.0.0",
+ "laminas/laminas-diactoros": "^3.4.0",
+ "phpunit/phpunit": "^10.5.36",
+ "psalm/plugin-phpunit": "^0.19.0",
+ "vimeo/psalm": "^5.26.1"
},
"type": "library",
"extra": {
@@ -414,20 +414,20 @@
"type": "community_bridge"
}
],
- "time": "2024-01-04T10:50:34+00:00"
+ "time": "2024-10-17T20:37:17+00:00"
},
{
"name": "league/container",
- "version": "4.2.2",
+ "version": "4.2.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/container.git",
- "reference": "ff346319ca1ff0e78277dc2311a42107cc1aab88"
+ "reference": "7ea728b013b9a156c409c6f0fc3624071b742dec"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/container/zipball/ff346319ca1ff0e78277dc2311a42107cc1aab88",
- "reference": "ff346319ca1ff0e78277dc2311a42107cc1aab88",
+ "url": "https://api.github.com/repos/thephpleague/container/zipball/7ea728b013b9a156c409c6f0fc3624071b742dec",
+ "reference": "7ea728b013b9a156c409c6f0fc3624071b742dec",
"shasum": ""
},
"require": {
@@ -452,11 +452,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.x-dev",
- "dev-4.x": "4.x-dev",
- "dev-3.x": "3.x-dev",
+ "dev-1.x": "1.x-dev",
"dev-2.x": "2.x-dev",
- "dev-1.x": "1.x-dev"
+ "dev-3.x": "3.x-dev",
+ "dev-4.x": "4.x-dev",
+ "dev-master": "4.x-dev"
}
},
"autoload": {
@@ -488,7 +488,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/container/issues",
- "source": "https://github.com/thephpleague/container/tree/4.2.2"
+ "source": "https://github.com/thephpleague/container/tree/4.2.4"
},
"funding": [
{
@@ -496,7 +496,7 @@
"type": "github"
}
],
- "time": "2024-03-13T13:12:53+00:00"
+ "time": "2024-11-10T12:42:13+00:00"
},
{
"name": "psr/clock",
@@ -975,16 +975,16 @@
},
{
"name": "symfony/finder",
- "version": "v7.1.4",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "d95bbf319f7d052082fb7af147e0f835a695e823"
+ "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823",
- "reference": "d95bbf319f7d052082fb7af147e0f835a695e823",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49",
+ "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49",
"shasum": ""
},
"require": {
@@ -1019,7 +1019,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v7.1.4"
+ "source": "https://github.com/symfony/finder/tree/v7.2.0"
},
"funding": [
{
@@ -1035,20 +1035,20 @@
"type": "tidelift"
}
],
- "time": "2024-08-13T14:28:19+00:00"
+ "time": "2024-10-23T06:56:12+00:00"
},
{
"name": "symfony/process",
- "version": "v7.1.7",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "9b8a40b7289767aa7117e957573c2a535efe6585"
+ "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585",
- "reference": "9b8a40b7289767aa7117e957573c2a535efe6585",
+ "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
+ "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
"shasum": ""
},
"require": {
@@ -1080,7 +1080,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v7.1.7"
+ "source": "https://github.com/symfony/process/tree/v7.2.0"
},
"funding": [
{
@@ -1096,7 +1096,7 @@
"type": "tidelift"
}
],
- "time": "2024-11-06T09:25:12+00:00"
+ "time": "2024-11-06T14:24:19+00:00"
}
],
"packages-dev": [
@@ -1315,16 +1315,16 @@
},
{
"name": "cakephp/migrations",
- "version": "4.4.2",
+ "version": "4.5.0",
"source": {
"type": "git",
"url": "https://github.com/cakephp/migrations.git",
- "reference": "40b5ef9355047d707af9ac63b88e43c4ee390a69"
+ "reference": "32afa21c95062819eef8f19a74862dbc21b31d0c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/migrations/zipball/40b5ef9355047d707af9ac63b88e43c4ee390a69",
- "reference": "40b5ef9355047d707af9ac63b88e43c4ee390a69",
+ "url": "https://api.github.com/repos/cakephp/migrations/zipball/32afa21c95062819eef8f19a74862dbc21b31d0c",
+ "reference": "32afa21c95062819eef8f19a74862dbc21b31d0c",
"shasum": ""
},
"require": {
@@ -1371,20 +1371,20 @@
"issues": "https://github.com/cakephp/migrations/issues",
"source": "https://github.com/cakephp/migrations"
},
- "time": "2024-10-08T14:22:48+00:00"
+ "time": "2024-11-24T03:11:14+00:00"
},
{
"name": "composer/pcre",
- "version": "3.3.1",
+ "version": "3.3.2",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
- "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4"
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4",
- "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"shasum": ""
},
"require": {
@@ -1394,8 +1394,8 @@
"phpstan/phpstan": "<1.11.10"
},
"require-dev": {
- "phpstan/phpstan": "^1.11.10",
- "phpstan/phpstan-strict-rules": "^1.1",
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2",
"phpunit/phpunit": "^8 || ^9"
},
"type": "library",
@@ -1434,7 +1434,7 @@
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
- "source": "https://github.com/composer/pcre/tree/3.3.1"
+ "source": "https://github.com/composer/pcre/tree/3.3.2"
},
"funding": [
{
@@ -1450,7 +1450,7 @@
"type": "tidelift"
}
],
- "time": "2024-08-27T18:44:43+00:00"
+ "time": "2024-11-12T16:29:46+00:00"
},
{
"name": "composer/semver",
@@ -1716,29 +1716,27 @@
},
{
"name": "doctrine/deprecations",
- "version": "1.1.3",
+ "version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
- "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab"
+ "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
- "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
+ "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^9",
- "phpstan/phpstan": "1.4.10 || 1.10.15",
- "phpstan/phpstan-phpunit": "^1.0",
+ "doctrine/coding-standard": "^9 || ^12",
+ "phpstan/phpstan": "1.4.10 || 2.0.3",
+ "phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "psalm/plugin-phpunit": "0.18.4",
- "psr/log": "^1 || ^2 || ^3",
- "vimeo/psalm": "4.30.0 || 5.12.0"
+ "psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
@@ -1746,7 +1744,7 @@
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
+ "Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1757,9 +1755,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
- "source": "https://github.com/doctrine/deprecations/tree/1.1.3"
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.4"
},
- "time": "2024-01-30T19:34:25+00:00"
+ "time": "2024-12-07T21:18:45+00:00"
},
{
"name": "felixfbecker/advanced-json-rpc",
@@ -1925,16 +1923,16 @@
},
{
"name": "myclabs/deep-copy",
- "version": "1.12.0",
+ "version": "1.12.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
- "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845",
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845",
"shasum": ""
},
"require": {
@@ -1973,7 +1971,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0"
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1"
},
"funding": [
{
@@ -1981,7 +1979,7 @@
"type": "tidelift"
}
],
- "time": "2024-06-12T14:39:25+00:00"
+ "time": "2024-11-08T17:47:46+00:00"
},
{
"name": "netresearch/jsonmapper",
@@ -2263,16 +2261,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.4.1",
+ "version": "5.6.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c"
+ "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
- "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
+ "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
"shasum": ""
},
"require": {
@@ -2281,17 +2279,17 @@
"php": "^7.4 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
"phpdocumentor/type-resolver": "^1.7",
- "phpstan/phpdoc-parser": "^1.7",
+ "phpstan/phpdoc-parser": "^1.7|^2.0",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.5",
+ "mockery/mockery": "~1.3.5 || ~1.6.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5",
- "vimeo/psalm": "^5.13"
+ "psalm/phar": "^5.26"
},
"type": "library",
"extra": {
@@ -2321,29 +2319,29 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
},
- "time": "2024-05-21T05:55:05+00:00"
+ "time": "2024-12-07T09:39:29+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.8.2",
+ "version": "1.10.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "153ae662783729388a584b4361f2545e4d841e3c"
+ "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c",
- "reference": "153ae662783729388a584b4361f2545e4d841e3c",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a",
+ "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.0",
"php": "^7.3 || ^8.0",
"phpdocumentor/reflection-common": "^2.0",
- "phpstan/phpdoc-parser": "^1.13"
+ "phpstan/phpdoc-parser": "^1.18|^2.0"
},
"require-dev": {
"ext-tokenizer": "*",
@@ -2379,9 +2377,9 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2"
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0"
},
- "time": "2024-02-23T11:10:43+00:00"
+ "time": "2024-11-09T15:12:26+00:00"
},
{
"name": "phpstan/phpdoc-parser",
@@ -2432,16 +2430,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "1.12.6",
+ "version": "1.12.13",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae"
+ "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae",
- "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b469068840cfa031e1deaf2fa1886d00e20680f",
+ "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f",
"shasum": ""
},
"require": {
@@ -2486,7 +2484,7 @@
"type": "github"
}
],
- "time": "2024-10-06T15:03:59+00:00"
+ "time": "2024-12-17T17:00:20+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -3167,16 +3165,16 @@
},
{
"name": "sebastian/comparator",
- "version": "5.0.2",
+ "version": "5.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53"
+ "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53",
- "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
+ "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
"shasum": ""
},
"require": {
@@ -3187,7 +3185,7 @@
"sebastian/exporter": "^5.0"
},
"require-dev": {
- "phpunit/phpunit": "^10.4"
+ "phpunit/phpunit": "^10.5"
},
"type": "library",
"extra": {
@@ -3232,7 +3230,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"security": "https://github.com/sebastianbergmann/comparator/security/policy",
- "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.2"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3"
},
"funding": [
{
@@ -3240,7 +3238,7 @@
"type": "github"
}
],
- "time": "2024-08-12T06:03:08+00:00"
+ "time": "2024-10-18T14:56:07+00:00"
},
{
"name": "sebastian/complexity",
@@ -3980,16 +3978,16 @@
},
{
"name": "spatie/array-to-xml",
- "version": "3.3.0",
+ "version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/array-to-xml.git",
- "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876"
+ "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/f56b220fe2db1ade4c88098d83413ebdfc3bf876",
- "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876",
+ "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67",
+ "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67",
"shasum": ""
},
"require": {
@@ -4032,7 +4030,7 @@
"xml"
],
"support": {
- "source": "https://github.com/spatie/array-to-xml/tree/3.3.0"
+ "source": "https://github.com/spatie/array-to-xml/tree/3.4.0"
},
"funding": [
{
@@ -4044,20 +4042,20 @@
"type": "github"
}
],
- "time": "2024-05-01T10:20:27+00:00"
+ "time": "2024-12-16T12:45:15+00:00"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.10.3",
+ "version": "3.11.2",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
+ "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079",
+ "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079",
"shasum": ""
},
"require": {
@@ -4124,20 +4122,20 @@
"type": "open_collective"
}
],
- "time": "2024-09-18T10:38:58+00:00"
+ "time": "2024-12-11T16:04:26+00:00"
},
{
"name": "symfony/config",
- "version": "v7.1.1",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2"
+ "reference": "bcd3c4adf0144dee5011bb35454728c38adec055"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2",
- "reference": "2210fc99fa42a259eb6c89d1f724ce0c4d62d5d2",
+ "url": "https://api.github.com/repos/symfony/config/zipball/bcd3c4adf0144dee5011bb35454728c38adec055",
+ "reference": "bcd3c4adf0144dee5011bb35454728c38adec055",
"shasum": ""
},
"require": {
@@ -4183,7 +4181,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/config/tree/v7.1.1"
+ "source": "https://github.com/symfony/config/tree/v7.2.0"
},
"funding": [
{
@@ -4199,20 +4197,20 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T14:57:53+00:00"
+ "time": "2024-11-04T11:36:24+00:00"
},
{
"name": "symfony/console",
- "version": "v7.1.5",
+ "version": "v7.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee"
+ "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee",
- "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee",
+ "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
+ "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"shasum": ""
},
"require": {
@@ -4276,7 +4274,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v7.1.5"
+ "source": "https://github.com/symfony/console/tree/v7.2.1"
},
"funding": [
{
@@ -4292,20 +4290,20 @@
"type": "tidelift"
}
],
- "time": "2024-09-20T08:28:38+00:00"
+ "time": "2024-12-11T03:49:26+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.5.0",
+ "version": "v3.5.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
+ "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
- "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
+ "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
"shasum": ""
},
"require": {
@@ -4343,7 +4341,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
},
"funding": [
{
@@ -4359,20 +4357,20 @@
"type": "tidelift"
}
],
- "time": "2024-04-18T09:32:20+00:00"
+ "time": "2024-09-25T14:20:29+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v7.1.5",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a"
+ "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/61fe0566189bf32e8cfee78335d8776f64a66f5a",
- "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
+ "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
"shasum": ""
},
"require": {
@@ -4409,7 +4407,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v7.1.5"
+ "source": "https://github.com/symfony/filesystem/tree/v7.2.0"
},
"funding": [
{
@@ -4425,7 +4423,7 @@
"type": "tidelift"
}
],
- "time": "2024-09-17T09:16:35+00:00"
+ "time": "2024-10-25T15:15:23+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4453,8 +4451,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -4529,8 +4527,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -4607,8 +4605,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -4691,8 +4689,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -4747,16 +4745,16 @@
},
{
"name": "symfony/service-contracts",
- "version": "v3.5.0",
+ "version": "v3.5.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f"
+ "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
- "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0",
+ "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0",
"shasum": ""
},
"require": {
@@ -4810,7 +4808,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v3.5.0"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.5.1"
},
"funding": [
{
@@ -4826,20 +4824,20 @@
"type": "tidelift"
}
],
- "time": "2024-04-18T09:32:20+00:00"
+ "time": "2024-09-25T14:20:29+00:00"
},
{
"name": "symfony/string",
- "version": "v7.1.5",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306"
+ "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/d66f9c343fa894ec2037cc928381df90a7ad4306",
- "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306",
+ "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82",
+ "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82",
"shasum": ""
},
"require": {
@@ -4897,7 +4895,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v7.1.5"
+ "source": "https://github.com/symfony/string/tree/v7.2.0"
},
"funding": [
{
@@ -4913,7 +4911,7 @@
"type": "tidelift"
}
],
- "time": "2024-09-20T08:28:38+00:00"
+ "time": "2024-11-13T13:31:26+00:00"
},
{
"name": "theseer/tokenizer",
@@ -5040,11 +5038,11 @@
"type": "project",
"extra": {
"branch-alias": {
- "dev-master": "5.x-dev",
- "dev-4.x": "4.x-dev",
- "dev-3.x": "3.x-dev",
+ "dev-1.x": "1.x-dev",
"dev-2.x": "2.x-dev",
- "dev-1.x": "1.x-dev"
+ "dev-3.x": "3.x-dev",
+ "dev-4.x": "4.x-dev",
+ "dev-master": "5.x-dev"
}
},
"autoload": {
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 2b4f7930..0fb73e8e 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1,9 +1,9 @@
parameters:
ignoreErrors:
-
- message: "#^Property DatabaseBackup\\\\Test\\\\TestCase\\\\BackupTraitTest\\:\\:\\$Trait has no type specified\\.$#"
- count: 1
- path: tests/TestCase/BackupTraitTest.php
+ message: "#^Cannot call method messages\\(\\) on Cake\\\\Console\\\\TestSuite\\\\StubConsoleOutput\\|null\\.$#"
+ count: 3
+ path: tests/TestCase/Command/IndexCommandTest.php
-
message: "#^Access to an undefined property DatabaseBackup\\\\Utility\\\\BackupExport\\:\\:\\$noExistingProperty\\.$#"
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 75b82c6a..b8618ede 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -9,18 +9,20 @@
cacheDirectory=".phpunit.cache"
>
-
-
- ./tests/TestCase
-
-
-
-
-
-
-
+
+
+ ./tests/TestCase
+
+
+
+
+
+
+
+
+
diff --git a/resources/locales/database_backup.pot b/resources/locales/database_backup.pot
index 8ecb5e9f..c5d08600 100644
--- a/resources/locales/database_backup.pot
+++ b/resources/locales/database_backup.pot
@@ -4,113 +4,119 @@
#, fuzzy
msgid ""
msgstr ""
-"POT-Creation-Date: 2023-06-06 16:05+0200\n"
+"Project-Id-Version: PROJECT VERSION\n"
+"POT-Creation-Date: 2024-12-18 19:47+0100\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME \n"
+"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:36
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:38
msgid "Deletes all database backups"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:53
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:64
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:54
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:66
msgid "No backup has been deleted"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:59
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:70
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:60
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:72
msgid "Backup `{0}` has been deleted"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:62
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:73
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:63
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:75
msgid "Deleted backup files: {0}"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:42
msgid "Exports a database backup"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:43
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:46
msgid "Compression type. By default, no compression will be used"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:47
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:50
msgid "Filename. It can be an absolute path and may contain patterns. The compression type will be automatically set"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:52
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:55
msgid "Rotates backups. You have to indicate the number of backups you want to keep. So, it will delete all backups that are older. By default, no backup will be deleted"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:58
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:61
msgid "Sends the backup file via email. You have to indicate the recipient's email address"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:63
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:45
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:66
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:48
msgid "Timeout for shell commands. Default value: {0} seconds"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:101
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:74
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:112
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:85
msgid "The `{0}` event stopped the operation"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:102
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:114
msgid "Backup `{0}` has been exported"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:42
msgid "Imports a database backup"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:41
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:44
#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/SendCommand.php:40
msgid "Filename. It can be an absolute path"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:75
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:87
msgid "Backup `{0}` has been imported"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:38
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:40
msgid "Lists database backups"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:54
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:43
+msgid "List database backups in reverse order (oldest first, then newest)"
+msgstr ""
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:58
msgid "Backup files found: {0}"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:60
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:65
msgid "Filename"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:61
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:66
msgid "Extension"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:62
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:67
msgid "Compression"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:63
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:68
msgid "Size"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:64
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:69
msgid "Datetime"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:37
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:40
msgid "Rotates backups"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:42
msgid "Number of backups you want to keep. So, it will delete all backups that are older"
msgstr ""
@@ -138,43 +144,61 @@ msgstr ""
msgid "Timeout for shell commands: {0} seconds"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/AbstractBackupUtility.php:83
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Driver/AbstractDriver.php:75
+msgid "`{0}` parameter should be `{1}` or `{2}`"
+msgstr ""
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Driver/AbstractDriver.php:177
+msgid "Binary for `{0}` could not be found. You have to set its path manually"
+msgstr ""
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/AbstractBackupUtility.php:107
msgid "The `{0}` driver does not exist"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:75
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:82
msgid "Invalid compression type"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:106
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:114
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:48
+msgid "File or directory `{0}` is not writable"
+msgstr ""
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:117
msgid "File `{0}` already exists"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:109
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:120
msgid "Invalid `{0}` file extension"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:176
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:192
msgid "Export failed with error message: `{0}`"
msgstr ""
#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:38
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:123
+msgid "File or directory `{0}` is not readable"
+msgstr ""
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:42
msgid "Invalid file extension"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:59
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:66
msgid "You must first set the filename"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:73
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:82
msgid "Import failed with error message: `{0}`"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:94
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:103
msgid "Invalid rotate value"
msgstr ""
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:117
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:130
msgid "Database backup {0} from {1}"
msgstr ""
diff --git a/resources/locales/it/database_backup.po b/resources/locales/it/database_backup.po
index 77e1a307..3a5a00ff 100644
--- a/resources/locales/it/database_backup.po
+++ b/resources/locales/it/database_backup.po
@@ -1,45 +1,49 @@
# LANGUAGE translation of cakephp-database-backup plugin
# Copyright Mirko Pagliai
#
+# Mirko Pagliai , 2024.
msgid ""
msgstr ""
-"POT-Creation-Date: 2023-06-06 16:05+0200\n"
-"PO-Revision-Date: 2023-06-06 16:09+0200\n"
+"Project-Id-Version: PROJECT VERSION\n"
+"POT-Creation-Date: 2024-12-18 19:47+0100\n"
+"PO-Revision-Date: 2024-12-18 19:49+0100\n"
"Last-Translator: Mirko Pagliai \n"
+"Language-Team: Italian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it_IT\n"
+"X-Generator: Lokalize 22.12.3\n"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:36
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:38
msgid "Deletes all database backups"
msgstr "Cancella tutti i backup del database"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:53
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:64
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:54
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:66
msgid "No backup has been deleted"
msgstr "Nessun backup è stato cancellato"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:59
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:70
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:60
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:72
msgid "Backup `{0}` has been deleted"
msgstr "Il backup `{0}` è stato cancellato"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:62
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:73
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/DeleteAllCommand.php:63
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:75
msgid "Deleted backup files: {0}"
msgstr "File di backup cancellati: {0}"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:42
msgid "Exports a database backup"
msgstr "Esporta un backup del database"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:43
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:46
msgid "Compression type. By default, no compression will be used"
msgstr "Tipo di compressione. Di default, nessuna compressione sarà utilizzata"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:47
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:50
msgid ""
"Filename. It can be an absolute path and may contain patterns. The"
" compression type will be automatically set"
@@ -47,7 +51,7 @@ msgstr ""
"Filename. Può essere una path assoluta e può contenere pattern. Il tipo di"
" compressione sarà impostato automaticamente"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:52
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:55
msgid ""
"Rotates backups. You have to indicate the number of backups you want to keep."
" So, it will delete all backups that are older. By default, no backup will be"
@@ -57,73 +61,79 @@ msgstr ""
" cancellerà tutti i backup più vecchi. Di default, nessun backup verrà"
" cancellato"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:58
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:61
msgid ""
"Sends the backup file via email. You have to indicate the recipient's email"
" address"
msgstr ""
"Invia il backup via mail. Devi indicare l'indirizzo email del destinatario"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:63
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:45
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:66
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:48
msgid "Timeout for shell commands. Default value: {0} seconds"
msgstr "Timeout per i comandi della shell. Valore di default: {0} secondi"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:101
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:74
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:112
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:85
msgid "The `{0}` event stopped the operation"
msgstr "L'evento `{0}` ha stoppato l'operazione"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:102
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ExportCommand.php:114
msgid "Backup `{0}` has been exported"
msgstr "Il backup `{0}` è stato esportato"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:42
msgid "Imports a database backup"
msgstr "Importa un backup del database"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:41
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:44
#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/SendCommand.php:40
msgid "Filename. It can be an absolute path"
msgstr "Filename. Può essere un percorso assoluto"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:75
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/ImportCommand.php:87
msgid "Backup `{0}` has been imported"
msgstr "Il backup `{0}` è stato importato"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:38
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:40
msgid "Lists database backups"
msgstr "Elenca i backup del database"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:54
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:43
+msgid "List database backups in reverse order (oldest first, then newest)"
+msgstr ""
+"Elenca i backup dei database in ordine inverso (prima i più vecchi, dopo i"
+" più recenti)"
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:58
msgid "Backup files found: {0}"
msgstr "File di backup trovati: {0}"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:60
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:65
msgid "Filename"
msgstr "Filename"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:61
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:66
msgid "Extension"
msgstr "Estensione"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:62
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:67
msgid "Compression"
msgstr "Compressione"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:63
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:68
msgid "Size"
msgstr "Dimensione"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:64
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/IndexCommand.php:69
msgid "Datetime"
msgstr "Data e orario"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:37
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:40
msgid "Rotates backups"
msgstr "Ruota i backup"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:39
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Command/RotateCommand.php:42
msgid ""
"Number of backups you want to keep. So, it will delete all backups that are"
" older"
@@ -155,43 +165,63 @@ msgstr "Driver: {0}"
msgid "Timeout for shell commands: {0} seconds"
msgstr "Timeout per i comandi della shell: {0} secondi"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/AbstractBackupUtility.php:83
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Driver/AbstractDriver.php:75
+msgid "`{0}` parameter should be `{1}` or `{2}`"
+msgstr "Il parametro `{0}` dovrebbe essere `{1}` o `{2}`"
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Driver/AbstractDriver.php:177
+msgid "Binary for `{0}` could not be found. You have to set its path manually"
+msgstr ""
+"Il binario per `{0}` non può essere trovato. Devi impostare manualmente la"
+" sua path"
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/AbstractBackupUtility.php:107
msgid "The `{0}` driver does not exist"
msgstr "Il driver `{0}` non esiste"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:75
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:82
msgid "Invalid compression type"
msgstr "Tipo di compressione non valido"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:106
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:114
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:48
+msgid "File or directory `{0}` is not writable"
+msgstr "Il file o la directory `{0}` non è scrivibile"
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:117
msgid "File `{0}` already exists"
msgstr "Il file `{0}` già esiste"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:109
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:120
msgid "Invalid `{0}` file extension"
msgstr "Estensione file `{0}` non valida"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:176
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupExport.php:192
msgid "Export failed with error message: `{0}`"
msgstr "Esportazione fallita con messaggio di errore: `{0}`"
#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:38
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:123
+msgid "File or directory `{0}` is not readable"
+msgstr "Il file o la directory `{0}` non è leggibile"
+
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:42
msgid "Invalid file extension"
msgstr "Estensione del file non valida"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:59
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:66
msgid "You must first set the filename"
msgstr "Devi prima impostare il filename"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:73
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupImport.php:82
msgid "Import failed with error message: `{0}`"
msgstr "Importazione fallita con messaggio di errore: `{0}`"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:94
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:103
msgid "Invalid rotate value"
msgstr "Valore rotazione non valido"
-#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:117
+#: ./home/mirko/Libs/Plugins/cakephp-database-backup/src/Utility/BackupManager.php:130
msgid "Database backup {0} from {1}"
msgstr "Backup del database {0} da {1}"
diff --git a/src/BackupTrait.php b/src/BackupTrait.php
index c1801cff..32f7e527 100644
--- a/src/BackupTrait.php
+++ b/src/BackupTrait.php
@@ -12,12 +12,14 @@
* @link https://github.com/mirko-pagliai/cakephp-database-backup
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
namespace DatabaseBackup;
use Cake\Core\Configure;
use Cake\Datasource\ConnectionInterface;
use Cake\Datasource\ConnectionManager;
use Symfony\Component\Filesystem\Filesystem;
+use Symfony\Component\Filesystem\Path;
/**
* A trait that provides some methods used by all other classes
@@ -36,7 +38,11 @@ public static function getAbsolutePath(string $path): string
return $path;
}
- return rtrim(Configure::readOrFail('DatabaseBackup.target'), DS) . DS . $path;
+ if (is_readable(Path::makeAbsolute($path, ROOT))) {
+ return Path::makeAbsolute($path, ROOT);
+ }
+
+ return Path::makeAbsolute($path, Configure::readOrFail('DatabaseBackup.target'));
}
/**
diff --git a/src/Command/DeleteAllCommand.php b/src/Command/DeleteAllCommand.php
index 5eadb344..1849865a 100644
--- a/src/Command/DeleteAllCommand.php
+++ b/src/Command/DeleteAllCommand.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Command;
use Cake\Console\Arguments;
diff --git a/src/Command/ExportCommand.php b/src/Command/ExportCommand.php
index 6e6c749e..ce7bf3a8 100644
--- a/src/Command/ExportCommand.php
+++ b/src/Command/ExportCommand.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Command;
use Cake\Console\Arguments;
@@ -37,7 +38,8 @@ class ExportCommand extends Command
*/
protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
- return $parser->setDescription(__d('database_backup', 'Exports a database backup'))
+ return $parser
+ ->setDescription(__d('database_backup', 'Exports a database backup'))
->addOptions([
'compression' => [
'choices' => $this->getValidCompressions(),
diff --git a/src/Command/ImportCommand.php b/src/Command/ImportCommand.php
index 4d01e8e0..1194c59e 100644
--- a/src/Command/ImportCommand.php
+++ b/src/Command/ImportCommand.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Command;
use Cake\Console\Arguments;
@@ -37,7 +38,8 @@ class ImportCommand extends Command
*/
protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
- return $parser->setDescription(__d('database_backup', 'Imports a database backup'))
+ return $parser
+ ->setDescription(__d('database_backup', 'Imports a database backup'))
->addArgument('filename', [
'help' => __d('database_backup', 'Filename. It can be an absolute path'),
'required' => true,
diff --git a/src/Command/IndexCommand.php b/src/Command/IndexCommand.php
index 36dc1c02..aa31a973 100644
--- a/src/Command/IndexCommand.php
+++ b/src/Command/IndexCommand.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Command;
use Cake\Console\Arguments;
@@ -35,7 +36,12 @@ class IndexCommand extends Command
*/
protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
- return $parser->setDescription(__d('database_backup', 'Lists database backups'));
+ return $parser
+ ->setDescription(__d('database_backup', 'Lists database backups'))
+ ->addOption('reverse', [
+ 'boolean' => true,
+ 'help' => __d('database_backup', 'List database backups in reverse order (oldest first, then newest)'),
+ ]);
}
/**
@@ -43,7 +49,6 @@ protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOption
* @param \Cake\Console\Arguments $args The command arguments
* @param \Cake\Console\ConsoleIo $io The console io
* @return void
- * @throws \ReflectionException
*/
public function execute(Arguments $args, ConsoleIo $io): void
{
@@ -51,6 +56,7 @@ public function execute(Arguments $args, ConsoleIo $io): void
$backups = BackupManager::index();
$io->out(__d('database_backup', 'Backup files found: {0}', $backups->count()));
+
if ($backups->isEmpty()) {
return;
}
@@ -62,11 +68,19 @@ public function execute(Arguments $args, ConsoleIo $io): void
__d('database_backup', 'Size'),
__d('database_backup', 'Datetime'),
];
- $cells = $backups->map(fn (array $backup): array => [
- 'compression' => $backup['compression'] ?: '',
- 'datetime' => $backup['datetime']->nice(),
- 'size' => Number::toReadableSize($backup['size']),
- ] + $backup);
- $io->helper('table')->output(array_merge([$headers], $cells->toList()));
+
+ $rows = $backups
+ ->map(fn (array $backup): array => array_merge($backup, [
+ 'compression' => $backup['compression'] ?: '',
+ 'datetime' => $backup['datetime']->nice(),
+ 'size' => Number::toReadableSize($backup['size']),
+ ]))
+ ->toList();
+
+ if ($args->getOption('reverse')) {
+ $rows = array_reverse($rows);
+ }
+
+ $io->helper('table')->output(array_merge([$headers], $rows));
}
}
diff --git a/src/Command/RotateCommand.php b/src/Command/RotateCommand.php
index 8947a759..72853d6c 100644
--- a/src/Command/RotateCommand.php
+++ b/src/Command/RotateCommand.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Command;
use Cake\Console\Arguments;
@@ -35,7 +36,8 @@ class RotateCommand extends Command
*/
protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
- return $parser->setDescription(__d('database_backup', 'Rotates backups'))
+ return $parser
+ ->setDescription(__d('database_backup', 'Rotates backups'))
->addArgument('keep', [
'help' => __d('database_backup', 'Number of backups you want to keep. So, it will delete all backups that are older'),
'required' => true,
diff --git a/src/Command/SendCommand.php b/src/Command/SendCommand.php
index c1673481..cfa34526 100644
--- a/src/Command/SendCommand.php
+++ b/src/Command/SendCommand.php
@@ -33,7 +33,8 @@ class SendCommand extends Command
*/
protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
- return $parser->setDescription(__d('database_backup', 'Send a database backup via mail'))
+ return $parser
+ ->setDescription(__d('database_backup', 'Send a database backup via mail'))
->addArguments([
'filename' => [
'help' => __d('database_backup', 'Filename. It can be an absolute path'),
diff --git a/src/Console/Command.php b/src/Console/Command.php
index 45985fdf..c777de39 100644
--- a/src/Console/Command.php
+++ b/src/Console/Command.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup\Console;
use Cake\Console\Arguments;
@@ -32,7 +33,6 @@ class Command extends BaseCommand
* @param \Cake\Console\Arguments $args The command arguments
* @param \Cake\Console\ConsoleIo $io The console io
* @return void
- * @throws \ReflectionException
*/
public function execute(Arguments $args, ConsoleIo $io): void
{
diff --git a/src/Driver/AbstractDriver.php b/src/Driver/AbstractDriver.php
index 4cd1e6d4..04b04d76 100644
--- a/src/Driver/AbstractDriver.php
+++ b/src/Driver/AbstractDriver.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.0.0
*/
+
namespace DatabaseBackup\Driver;
use Cake\Core\Configure;
@@ -71,7 +72,7 @@ private function getExecutable(string $type): string
{
// @codeCoverageIgnoreStart
if (!in_array($type, ['export', 'import'])) {
- throw new LogicException(__d('database_backup', '`$type` parameter should be `export` or `import`'));
+ throw new LogicException(__d('database_backup', '`{0}` parameter should be `{1}` or `{2}`', '$type', 'export', 'import'));
}
// @codeCoverageIgnoreEnd
$driverName = strtolower($this->getDriverName());
diff --git a/src/Driver/Mysql.php b/src/Driver/Mysql.php
index 933a9201..97c32312 100644
--- a/src/Driver/Mysql.php
+++ b/src/Driver/Mysql.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.0.0
*/
+
namespace DatabaseBackup\Driver;
use Symfony\Component\Filesystem\Filesystem;
diff --git a/src/Driver/Postgres.php b/src/Driver/Postgres.php
index 6642636e..3fb0844e 100644
--- a/src/Driver/Postgres.php
+++ b/src/Driver/Postgres.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.1.0
*/
+
namespace DatabaseBackup\Driver;
/**
diff --git a/src/Driver/Sqlite.php b/src/Driver/Sqlite.php
index f905e859..a0d15203 100644
--- a/src/Driver/Sqlite.php
+++ b/src/Driver/Sqlite.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.0.0
*/
+
namespace DatabaseBackup\Driver;
/**
diff --git a/src/Plugin.php b/src/Plugin.php
index 7eda849d..ba19c3bd 100644
--- a/src/Plugin.php
+++ b/src/Plugin.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.6.0
*/
+
namespace DatabaseBackup;
use Cake\Console\CommandCollection;
diff --git a/src/TestSuite/DriverTestCase.php b/src/TestSuite/DriverTestCase.php
index 94a78660..5463fb9d 100644
--- a/src/TestSuite/DriverTestCase.php
+++ b/src/TestSuite/DriverTestCase.php
@@ -14,6 +14,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.0.0
*/
+
namespace DatabaseBackup\TestSuite;
use Cake\Core\App;
@@ -35,7 +36,7 @@ abstract class DriverTestCase extends TestCase
* Called before every test method
* @return void
*/
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php
index e10bd452..0b4f19c5 100644
--- a/src/TestSuite/TestCase.php
+++ b/src/TestSuite/TestCase.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 2.0.0
*/
+
namespace DatabaseBackup\TestSuite;
use Cake\TestSuite\TestCase as BaseTestCase;
@@ -27,10 +28,9 @@ abstract class TestCase extends BaseTestCase
use BackupTrait;
/**
- * Called after every test method
- * @return void
+ * @inheritDoc
*/
- public function tearDown(): void
+ protected function tearDown(): void
{
parent::tearDown();
diff --git a/src/Utility/AbstractBackupUtility.php b/src/Utility/AbstractBackupUtility.php
index a199c83b..f0557fbe 100644
--- a/src/Utility/AbstractBackupUtility.php
+++ b/src/Utility/AbstractBackupUtility.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @see https://github.com/mirko-pagliai/cakephp-database-backup/wiki/How-to-use-the-BackupExport-utility
*/
+
namespace DatabaseBackup\Utility;
use Cake\Core\App;
diff --git a/src/Utility/BackupExport.php b/src/Utility/BackupExport.php
index 3530d929..64483e7d 100644
--- a/src/Utility/BackupExport.php
+++ b/src/Utility/BackupExport.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @see https://github.com/mirko-pagliai/cakephp-database-backup/wiki/How-to-use-the-BackupExport-utility
*/
+
namespace DatabaseBackup\Utility;
use Cake\Core\Configure;
@@ -110,7 +111,7 @@ public function filename(string $filename)
$filename = $this->getAbsolutePath($filename);
if (!is_writable(dirname($filename))) {
- throw new LogicException(__d('database_backup', 'File or directory `' . dirname($filename) . '` is not writable'));
+ throw new LogicException(__d('database_backup', 'File or directory `{0}` is not writable', dirname($filename)));
}
if (file_exists($filename)) {
throw new LogicException(__d('database_backup', 'File `{0}` already exists', $filename));
diff --git a/src/Utility/BackupImport.php b/src/Utility/BackupImport.php
index 6fb1952d..d8796da3 100644
--- a/src/Utility/BackupImport.php
+++ b/src/Utility/BackupImport.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @see https://github.com/mirko-pagliai/cakephp-database-backup/wiki/How-to-use-the-BackupImport-utility
*/
+
namespace DatabaseBackup\Utility;
use LogicException;
@@ -34,7 +35,7 @@ public function filename(string $filename)
{
$filename = $this->getAbsolutePath($filename);
if (!is_readable($filename)) {
- throw new LogicException(__d('database_backup', 'File or directory `' . $filename . '` is not readable'));
+ throw new LogicException(__d('database_backup', 'File or directory `{0}` is not readable', $filename));
}
if (!$this->getExtension($filename)) {
diff --git a/src/Utility/BackupManager.php b/src/Utility/BackupManager.php
index 09c3a38a..86ef1fa9 100644
--- a/src/Utility/BackupManager.php
+++ b/src/Utility/BackupManager.php
@@ -13,6 +13,7 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
* @see https://github.com/mirko-pagliai/cakephp-database-backup/wiki/How-to-use-the-BackupManager-utility
*/
+
namespace DatabaseBackup\Utility;
use Cake\Collection\Collection;
@@ -44,7 +45,7 @@ public static function delete(string $filename): string
{
$filename = self::getAbsolutePath($filename);
if (!is_writable($filename)) {
- throw new LogicException(__d('database_backup', 'File or directory `' . $filename . '` is not writable'));
+ throw new LogicException(__d('database_backup', 'File or directory `{0}` is not writable', $filename));
}
(new Filesystem())->remove($filename);
@@ -73,16 +74,18 @@ public static function index(): CollectionInterface
$Finder->files()
->in(Configure::readOrFail('DatabaseBackup.target'))
->name('/\.sql(\.(gz|bz2))?$/')
- ->sortByModifiedTime()
- ->reverseSorting();
+ //Sorts in descending order by last modified date
+ ->sort(fn (SplFileInfo $a, SplFileInfo $b): bool => $a->getMTime() < $b->getMTime());
- return (new Collection($Finder))->map(fn (SplFileInfo $File): array => [
- 'filename' => $File->getFilename(),
- 'extension' => self::getExtension($File->getFilename()),
- 'compression' => self::getCompression($File->getFilename()),
- 'size' => $File->getSize(),
- 'datetime' => FrozenTime::createFromTimestamp($File->getMTime()),
- ])->compile(false);
+ return (new Collection($Finder))
+ ->map(fn (SplFileInfo $File): array => [
+ 'filename' => $File->getFilename(),
+ 'extension' => self::getExtension($File->getFilename()),
+ 'compression' => self::getCompression($File->getFilename()),
+ 'size' => $File->getSize(),
+ 'datetime' => FrozenTime::createFromTimestamp($File->getMTime()),
+ ])
+ ->compile(false);
}
/**
@@ -117,7 +120,7 @@ protected static function getEmailInstance(string $backup, string $recipient): M
{
$filename = self::getAbsolutePath($backup);
if (!is_readable($filename)) {
- throw new LogicException(__d('database_backup', 'File or directory `' . $filename . '` is not readable'));
+ throw new LogicException(__d('database_backup', 'File or directory `{0}` is not readable', $filename));
}
$server = env('SERVER_NAME', 'localhost');
diff --git a/tests/TestCase/BackupTraitTest.php b/tests/TestCase/BackupTraitTest.php
index 242bec38..abdf1b89 100644
--- a/tests/TestCase/BackupTraitTest.php
+++ b/tests/TestCase/BackupTraitTest.php
@@ -1,5 +1,4 @@
+ * @var \App\BackupTraitAsClass
*/
- protected $Trait;
+ protected BackupTraitAsClass $Trait;
/**
* @inheritDoc
*/
- public array $fixtures = ['core.Articles', 'core.Comments'];
+ public array $fixtures = [
+ 'core.Articles',
+ 'core.Comments',
+ ];
/**
* @inheritDoc
*/
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
- $this->Trait ??= $this->getMockForTrait(BackupTrait::class);
+ $this->Trait ??= new BackupTraitAsClass();
}
/**
diff --git a/tests/TestCase/Command/DeleteAllCommandTest.php b/tests/TestCase/Command/DeleteAllCommandTest.php
index 776816be..f2ce51d9 100644
--- a/tests/TestCase/Command/DeleteAllCommandTest.php
+++ b/tests/TestCase/Command/DeleteAllCommandTest.php
@@ -1,5 +1,4 @@
expectException(StopException::class);
$this->expectExceptionMessage('The `Backup.beforeImport` event stopped the operation');
- $Command = $this->createPartialMock(ImportCommand::class, ['getBackupImport']);
- $Command->method('getBackupImport')->willReturn($this->createConfiguredMock(BackupImport::class, ['import' => false]));
- $Command->run(['--filename' => createBackup()], new ConsoleIo(new StubConsoleOutput(), new StubConsoleOutput()));
+ $BackupImport = $this->createConfiguredMock(BackupImport::class, ['import' => false]);
+ $ImportCommand = $this->createPartialMock(ImportCommand::class, ['getBackupImport']);
+ $ImportCommand->method('getBackupImport')->willReturn($BackupImport);
+ $ImportCommand->run(['--filename' => createBackup()], new ConsoleIo(new StubConsoleOutput(), new StubConsoleOutput()));
}
/**
diff --git a/tests/TestCase/Command/IndexCommandTest.php b/tests/TestCase/Command/IndexCommandTest.php
index e75d23fc..3b5df8e0 100644
--- a/tests/TestCase/Command/IndexCommandTest.php
+++ b/tests/TestCase/Command/IndexCommandTest.php
@@ -1,5 +1,4 @@
exec('database_backup.index -v');
+ $this->assertExitSuccess();
+ $this->assertOutputContains('Backup files found: 3');
+
+ /**
+ * Extracts and checks only the lines containing headers and data about backup file
+ */
+ $expectedHeaders = [
+ 'Filename',
+ 'Extension',
+ 'Compression',
+ 'Size',
+ 'Datetime',
+ ];
+ $headers = preg_split(pattern: '/\s*\|\s*/', subject: $this->_out->messages()[7], flags: PREG_SPLIT_NO_EMPTY);
+ $this->assertSame($expectedHeaders, $headers);
+
+ $expectedRows = array_reverse(array_map(fn (string $filename): array => [
+ '',
+ basename($filename),
+ $this->getExtension($filename),
+ $this->getCompression($filename) ?: '',
+ Number::toReadableSize(filesize($filename) ?: 0),
+ DateTime::createFromTimestamp(filemtime($filename) ?: 0)->nice(),
+ '',
+ ], $backups));
+ $rows = array_map(
+ callback: fn (string $row): array => preg_split(pattern: '/\s*\|\s*/', subject: $row) ?: [],
+ array: array_slice($this->_out->messages(), 9, 3)
+ );
+ $this->assertSame($expectedRows, $rows);
+
+ $this->_out = $this->_err = null;
+
+ //With `reverse` option
+ $this->exec('database_backup.index -v --reverse');
+ $this->assertExitSuccess();
+ $this->assertOutputContains('Backup files found: 3');
+ $rows = array_map(
+ callback: fn (string $row): array => preg_split(pattern: '/\s*\|\s*/', subject: $row) ?: [],
+ array: array_slice($this->_out->messages(), 9, 3)
+ );
+ $this->assertSame(array_reverse($expectedRows), $rows);
+ }
+
+ /**
+ * @test
+ * @uses \DatabaseBackup\Command\IndexCommand::execute()
+ */
+ public function testExecuteWithNoFiles(): void
{
//With no backups
$this->exec('database_backup.index -v');
@@ -38,14 +95,5 @@ public function testExecute(): void
$this->assertOutputRegExp('/Driver: (Mysql|Postgres|Sqlite)/');
$this->assertOutputContains('Backup files found: 0');
$this->assertErrorEmpty();
-
- createSomeBackups();
- $this->exec('database_backup.index -v');
- $this->assertExitSuccess();
- $this->assertOutputContains('Backup files found: 3');
- $this->assertOutputRegExp('/backup\.sql\.gz\s+|\s+sql\.gz\s+|\s+gzip\s+|\s+[\d\.]+ \w+\s+|\s+[\d\/]+, [\d:]+ (AP)M/');
- $this->assertOutputRegExp('/backup\.sql\.bz2\s+|\s+sql\.bz2\s+|\s+bzip2\s+|\s+[\d\.]+ \w+\s+|\s+[\d\/]+, [\d:]+ (AP)M/');
- $this->assertOutputRegExp('/backup\.sq\s+|\s+sql\s+|\s+|\s+[\d\.]+ \w+\s+|\s+[\d\/]+, [\d:]+ (AP)M/');
- $this->assertErrorEmpty();
}
}
diff --git a/tests/TestCase/Command/RotateCommandTest.php b/tests/TestCase/Command/RotateCommandTest.php
index 5bac387a..fe2c7345 100644
--- a/tests/TestCase/Command/RotateCommandTest.php
+++ b/tests/TestCase/Command/RotateCommandTest.php
@@ -1,5 +1,4 @@
getMockForAbstractClass(AbstractDriver::class);
+ $Driver = $this->getMockBuilder(AbstractDriver::class)
+ ->onlyMethods([])
+ ->getMock();
$this->assertNotEmpty($Driver->getBinary('mysql'));
$this->expectExceptionMessage('Binary for `noExistingBinary` could not be found. You have to set its path manually');
diff --git a/tests/TestCase/Driver/MysqlTest.php b/tests/TestCase/Driver/MysqlTest.php
index 42a75476..a6ccdbce 100644
--- a/tests/TestCase/Driver/MysqlTest.php
+++ b/tests/TestCase/Driver/MysqlTest.php
@@ -1,5 +1,4 @@
getConnection()->config()['scheme'] !== 'mysql') {
$this->markTestSkipped('Skipping tests for mysql, current driver is `' . $this->getConnection()->config()['scheme'] . '`');
@@ -47,6 +49,7 @@ public function setUp(): void
/**
* @test
+ * @throws \PHPUnit\Framework\MockObject\Exception
* @uses \DatabaseBackup\Driver\Mysql::afterExport()
*/
public function testAfterExport(): void
@@ -65,6 +68,7 @@ public function testAfterExport(): void
/**
* @test
+ * @throws \PHPUnit\Framework\MockObject\Exception
* @uses \DatabaseBackup\Driver\Mysql::afterImport()
*/
public function testAfterImport(): void
@@ -121,6 +125,7 @@ public function testBeforeImport(): void
/**
* @test
+ * @throws \PHPUnit\Framework\MockObject\Exception
* @uses \DatabaseBackup\Driver\Mysql::writeAuthFile()
*/
public function testWriteAuthFile(): void
diff --git a/tests/TestCase/Driver/PostgresTest.php b/tests/TestCase/Driver/PostgresTest.php
index 8b4143ce..c2c222d9 100644
--- a/tests/TestCase/Driver/PostgresTest.php
+++ b/tests/TestCase/Driver/PostgresTest.php
@@ -12,20 +12,22 @@
* @link https://github.com/mirko-pagliai/cakephp-database-backup
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
namespace DatabaseBackup\Test\TestCase\Driver;
use DatabaseBackup\TestSuite\DriverTestCase;
/**
* PostgresTest class
+ *
+ * @uses \DatabaseBackup\Driver\Postgres
*/
class PostgresTest extends DriverTestCase
{
/**
- * Called before every test method
- * @return void
+ * @inheritDoc
*/
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
diff --git a/tests/TestCase/Driver/SqliteTest.php b/tests/TestCase/Driver/SqliteTest.php
index 6ff5eab6..6f424b10 100644
--- a/tests/TestCase/Driver/SqliteTest.php
+++ b/tests/TestCase/Driver/SqliteTest.php
@@ -12,20 +12,22 @@
* @link https://github.com/mirko-pagliai/cakephp-database-backup
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
namespace DatabaseBackup\Test\TestCase\Driver;
use DatabaseBackup\TestSuite\DriverTestCase;
/**
* SqliteTest class
+ *
+ * @uses \DatabaseBackup\Driver\Sqlite
*/
class SqliteTest extends DriverTestCase
{
/**
- * Called before every test method
- * @return void
+ * @inheritDoc
*/
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
diff --git a/tests/TestCase/Utility/AbstractBackupUtilityTest.php b/tests/TestCase/Utility/AbstractBackupUtilityTest.php
index 8f97ec80..53dbbed0 100644
--- a/tests/TestCase/Utility/AbstractBackupUtilityTest.php
+++ b/tests/TestCase/Utility/AbstractBackupUtilityTest.php
@@ -21,28 +21,26 @@
/**
* AbstractBackupUtilityTest
+ *
+ * @uses \DatabaseBackup\Utility\AbstractBackupUtility
*/
class AbstractBackupUtilityTest extends TestCase
{
/**
* @test
+ * @throws \ReflectionException
* @uses \DatabaseBackup\Utility\AbstractBackupUtility::getDriver()
*/
public function testGetDriver(): void
{
- $Utility = $this->getMockForAbstractClass(AbstractBackupUtility::class);
+ $Utility = $this->getMockBuilder(AbstractBackupUtility::class)
+ ->getMock();
$this->assertInstanceOf(AbstractDriver::class, $Utility->getDriver());
$this->expectExceptionMessage('The `noExistingDriver` driver does not exist');
- $Utility = $this->getMockForAbstractClass(
- AbstractBackupUtility::class,
- [],
- '',
- true,
- true,
- true,
- ['getDriverName']
- );
+ $Utility = $this->getMockBuilder(AbstractBackupUtility::class)
+ ->onlyMethods(['getDriverName', 'filename'])
+ ->getMock();
$Utility->method('getDriverName')->willReturn('noExistingDriver');
$Utility->getDriver();
}
diff --git a/tests/TestCase/Utility/BackupExportAndImportTest.php b/tests/TestCase/Utility/BackupExportAndImportTest.php
index 0e00764c..e44e6ac7 100644
--- a/tests/TestCase/Utility/BackupExportAndImportTest.php
+++ b/tests/TestCase/Utility/BackupExportAndImportTest.php
@@ -1,5 +1,4 @@
loadInternalFile(ROOT . 'vendor/cakephp/cakephp/tests/schema.php');
+/** @uses tests/schema.php */
+$loader->loadInternalFile(ROOT . 'tests' . DS . 'schema.php');
echo 'Running tests for `' . (new BackupManager())->getDriverName() . '` driver ' . PHP_EOL;
@@ -120,7 +119,6 @@
* Global function to create a backup file
* @param string $filename Filename
* @return string
- * @throws \LogicException
* @throws \ReflectionException
*/
function createBackup(string $filename = 'backup.sql'): string
@@ -133,7 +131,6 @@ function createBackup(string $filename = 'backup.sql'): string
/**
* Global function to create some backup files
* @return string[]
- * @throws \LogicException
* @throws \ReflectionException
*/
function createSomeBackups(): array
diff --git a/tests/schema.php b/tests/schema.php
new file mode 100644
index 00000000..4edcabef
--- /dev/null
+++ b/tests/schema.php
@@ -0,0 +1,618 @@
+ [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'username' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'password' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'created' => [
+ 'type' => 'timestamp',
+ 'null' => true,
+ ],
+ 'updated' => [
+ 'type' => 'timestamp',
+ 'null' => true,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'auth_users' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'username' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'password' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'created' => 'datetime',
+ 'updated' => 'datetime',
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'date_keys' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'date',
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'members' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'section_count' => [
+ 'type' => 'integer',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'articles' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'author_id' => [
+ 'type' => 'integer',
+ 'null' => true,
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'body' => 'text',
+ 'published' => [
+ 'type' => 'string',
+ 'length' => 1,
+ 'default' => 'N',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'products' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'category' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'price' => [
+ 'type' => 'integer',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'category',
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'orders' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'product_category' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'product_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ 'product_category_fk' => [
+ 'type' => 'foreign',
+ 'columns' => [
+ 'product_category',
+ 'product_id',
+ ],
+ 'references' => [
+ 'products',
+ [
+ 'category',
+ 'id',
+ ],
+ ],
+ 'update' => 'cascade',
+ 'delete' => 'cascade',
+ ],
+ ],
+ 'indexes' => [
+ 'product_category' => [
+ 'type' => 'index',
+ 'columns' => [
+ 'product_category',
+ 'product_id',
+ ],
+ ],
+ ],
+ ],
+ 'comments' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'article_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'user_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'comment' => [
+ 'type' => 'text',
+ ],
+ 'published' => [
+ 'type' => 'string',
+ 'length' => 1,
+ 'default' => 'N',
+ ],
+ 'created' => [
+ 'type' => 'datetime',
+ ],
+ 'updated' => [
+ 'type' => 'datetime',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'authors' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'default' => null,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'tags' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'description' => [
+ 'type' => 'text',
+ 'length' => 16777215,
+ ],
+ 'created' => [
+ 'type' => 'datetime',
+ 'null' => true,
+ 'default' => null,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'articles_tags' => [
+ 'columns' => [
+ 'article_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'tag_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'unique_tag' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'article_id',
+ 'tag_id',
+ ],
+ ],
+ ],
+ ],
+ 'profiles' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ 'autoIncrement' => true,
+ ],
+ 'user_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'first_name' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'last_name' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'is_active' => [
+ 'type' => 'boolean',
+ 'null' => false,
+ 'default' => true,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'sessions' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'string',
+ 'length' => 128,
+ ],
+ 'data' => [
+ 'type' => 'binary',
+ 'length' => 16777215,
+ 'null' => true,
+ ],
+ 'expires' => [
+ 'type' => 'integer',
+ 'length' => 11,
+ 'null' => true,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'menu_link_trees' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'menu' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'lft' => [
+ 'type' => 'integer',
+ ],
+ 'rght' => [
+ 'type' => 'integer',
+ ],
+ 'parent_id' => 'integer',
+ 'url' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'things' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'length' => 20,
+ ],
+ 'body' => [
+ 'type' => 'string',
+ 'length' => 50,
+ ],
+ ],
+ ],
+ 'site_articles' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'author_id' => [
+ 'type' => 'integer',
+ 'null' => true,
+ ],
+ 'site_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'null' => true,
+ ],
+ 'body' => 'text',
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ 'site_id',
+ ],
+ ],
+ ],
+ ],
+ 'authors_tags' => [
+ 'columns' => [
+ 'author_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'tag_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'unique_tag' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'author_id',
+ 'tag_id',
+ ],
+ ],
+ 'author_id_fk' => [
+ 'type' => 'foreign',
+ 'columns' => ['author_id'],
+ 'references' => ['authors', 'id'],
+ 'update' => 'cascade',
+ 'delete' => 'cascade',
+ ],
+ ],
+ ],
+ 'site_authors' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'default' => null,
+ ],
+ 'site_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ 'site_id',
+ ],
+ ],
+ ],
+ ],
+ 'posts' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'author_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'title' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'body' => 'text',
+ 'published' => [
+ 'type' => 'string',
+ 'length' => 1,
+ 'default' => 'N',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'attachments' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'comment_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'attachment' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'created' => 'datetime',
+ 'updated' => 'datetime',
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'categories' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'parent_id' => [
+ 'type' => 'integer',
+ 'null' => false,
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ 'created' => 'datetime',
+ 'updated' => 'datetime',
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'sections' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'title' => [
+ 'type' => 'string',
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ ],
+ ],
+ ],
+ ],
+ 'site_tags' => [
+ 'columns' => [
+ 'id' => [
+ 'type' => 'integer',
+ ],
+ 'site_id' => [
+ 'type' => 'integer',
+ ],
+ 'name' => [
+ 'type' => 'string',
+ 'null' => false,
+ ],
+ ],
+ 'constraints' => [
+ 'primary' => [
+ 'type' => 'primary',
+ 'columns' => [
+ 'id',
+ 'site_id',
+ ],
+ ],
+ ],
+ ],
+];
diff --git a/tests/test_app/TestApp/Application.php b/tests/test_app/TestApp/Application.php
index aadf9189..af02efd0 100644
--- a/tests/test_app/TestApp/Application.php
+++ b/tests/test_app/TestApp/Application.php
@@ -1,5 +1,4 @@