Skip to content

Commit c5b4ee4

Browse files
Develop (#48)
* improved exception message when no binary file is found * no longer uses the `Folder` class * updated * fixed * Develop dependencies (#42) added tests for lower dependencies * updated * come back * fixed * fixed * updated * little fixes for `BackupManager` and `BackupExport` classes * test * fixed typo * little fixes * fixed * updated * fixed * added badge * some fixes * uses `Filesystem` class * come back * fixed * fixed tests * updated * updated * updated * APIs are now generated by `phpDocumentor` and no longer by` apigen` * fixed * fixed slashs term * fixed sniffer rules * fixed * fixed description * tests have been optimized and speeded up * updated * fixed string for i18n * fixed * fixed string * updated pot template and it translation
1 parent 7a63cb8 commit c5b4ee4

20 files changed

+352
-439
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 2.x branch
22
## 2.6 branch
3+
### 2.6.6
4+
* tests have been optimized and speeded up;
5+
* APIs are now generated by `phpDocumentor` and no longer by` apigen`.
6+
37
### 2.6.5
48
* little fixes.
59

apigen.neon

Lines changed: 0 additions & 69 deletions
This file was deleted.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ before_test:
2727

2828
install:
2929
- cd c:\
30-
- curl -fsS -o php.zip https://windows.php.net/downloads/releases/php-7.2.22-nts-Win32-VC15-x86.zip
30+
- curl -fsS -o php.zip https://windows.php.net/downloads/releases/latest/php-7.2-nts-Win32-VC15-x86-latest.zip
3131
- 7z x php.zip -oc:\php > nul
3232
- cd c:\php
3333
- copy php.ini-production php.ini

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"type": "cakephp-plugin",
66
"license": "MIT",
77
"authors": [{
8-
"name": "Mirko Pagliai",
9-
"email": "mirko.pagliai@gmail.com"
10-
}],
8+
"name": "Mirko Pagliai",
9+
"email": "mirko.pagliai@gmail.com"
10+
}],
1111
"require": {
1212
"php": ">=5.5.9",
1313
"cakephp/cakephp": "^3.7",
14-
"mirko-pagliai/php-tools": "^1.2.8"
14+
"mirko-pagliai/php-tools": "^1.2.15"
1515
},
1616
"require-dev": {
1717
"cakephp/cakephp-codesniffer": "^3.0",

phpcs.xml.dist

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
<?xml version="1.0"?>
2-
<ruleset>
2+
<ruleset name="cakephp-database-backup">
33
<arg value="p"/>
44
<file>.</file>
55

6-
<rule ref="./vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml"/>
7-
8-
<rule ref="Generic.Commenting.Todo">
9-
<severity>0</severity>
10-
</rule>
11-
<rule ref="Generic.PHP.NoSilencedErrors.Discouraged">
12-
<severity>0</severity>
13-
</rule>
14-
<rule ref="Internal.NoCodeFound">
15-
<severity>0</severity>
16-
</rule>
17-
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
18-
<exclude-pattern>/webroot</exclude-pattern>
19-
</rule>
20-
21-
<exclude-pattern>*.min.css</exclude-pattern>
22-
<exclude-pattern>*.min.js</exclude-pattern>
23-
<exclude-pattern>/config/ckeditor/build-config.js</exclude-pattern>
24-
<exclude-pattern>/config/Migrations</exclude-pattern>
25-
<exclude-pattern>/coverage</exclude-pattern>
26-
<exclude-pattern>/vendor</exclude-pattern>
6+
<rule ref="./vendor/mirko-pagliai/php-tools/sniffer-ruleset.xml"/>
277
</ruleset>

phpdoc.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdocumentor>
3+
<title>cakephp-database-backup</title>
4+
<parser>
5+
<default-package-name>cakephp-database-backup</default-package-name>
6+
<target>../cakephp-database-backup-gh-pages/cache</target>
7+
</parser>
8+
<transformer>
9+
<target>../cakephp-database-backup-gh-pages</target>
10+
</transformer>
11+
<files>
12+
<directory>src</directory>
13+
</files>
14+
<transformations>
15+
<template name="responsive" />
16+
</transformations>
17+
</phpdocumentor>

src/BackupTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
trait BackupTrait
2727
{
2828
/**
29-
* Valid extensions (as keys) and compressions (as values)
29+
* Valid extensions. Names as keys and compressions as values
3030
* @since 2.4.0
3131
* @var array
3232
*/
@@ -40,7 +40,7 @@ trait BackupTrait
4040
*/
4141
public function getAbsolutePath($path)
4242
{
43-
return (new Filesystem())->isAbsolutePath($path) ? $path : $this->getTarget() . DS . $path;
43+
return (new Filesystem())->isAbsolutePath($path) ? $path : add_slash_term($this->getTarget()) . $path;
4444
}
4545

4646
/**
@@ -53,7 +53,7 @@ public function getAbsolutePath($path)
5353
public function getBinary($name)
5454
{
5555
$binary = Configure::read('DatabaseBackup.binaries.' . $name);
56-
is_true_or_fail($binary, sprintf('Binary for `%s` could not be found. You have to set its path manually', $name), RuntimeException::class);
56+
is_true_or_fail($binary, __d('database_backup', 'Binary for `{0}` could not be found. You have to set its path manually', $name), RuntimeException::class);
5757

5858
return $binary;
5959
}
@@ -119,7 +119,7 @@ public function getDriverName(ConnectionInterface $connection = null)
119119
{
120120
$connection = $connection ?: $this->getConnection();
121121

122-
return get_class_short_name(get_class($connection->getDriver()));
122+
return get_class_short_name($connection->getDriver());
123123
}
124124

125125
/**

src/Command/ExportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ protected function buildOptionParser(ConsoleOptionParser $parser)
4747
'short' => 'f',
4848
],
4949
'rotate' => [
50-
'help' => __d('database_backup', 'Rotates backups. You have to indicate the number of backups' .
51-
'you ìwant to keep. So, it will delete all backups that are older. By default, no backup' .
50+
'help' => __d('database_backup', 'Rotates backups. You have to indicate the number of backups ' .
51+
'you want to keep. So, it will delete all backups that are older. By default, no backup ' .
5252
'will be deleted'),
5353
'short' => 'r',
5454
],

src/Driver/Driver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*/
2525
abstract class Driver implements EventListenerInterface
2626
{
27-
use BackupTrait, EventDispatcherTrait;
27+
use BackupTrait;
28+
use EventDispatcherTrait;
2829

2930
/**
3031
* A connection object

0 commit comments

Comments
 (0)