Releases: mirko-pagliai/cakephp-database-backup
2.14.1
- many improvements for the
AbstractExecutorabstract class; - method
AbstractBackupUtility::getExecutor()now accepts the optional$Connectionargument. ThegetConnection()
method has been removed; getExecutable(),getExportExecutable()andgetImportExecutable()methods provided byAbstractExecutorhave
been renamed asgetCommand(),getExportCommand()andgetImportCommand(). This is because they never actually
returned "executables", but rather commands. This makes their name clearer. ForgetExportExecutable()and
getImportExecutable()methods backwards compatibility is ensured via the magic method_call()(with deprecation);- significant improvement for
SqlExecutor. Also, improved related tests; - the
DriverTestCaseabstract class, used in particular for old, no longer existing "Driver" classes, has been removed.
Tests involving "Executor" classes do not use this class, as they have no need for it. ThePostgresExecutorTesttest
class has also been removed, since the class it covers, by default, does not implement anything that the parent class
does not; - all PHPUnit deprecations have finally been removed;
- added
symfony/polyfill-php83. This allowed the#[Override]attribute to be added to all affected methods; - we also begin to apply the
UsesClassattribute and remove the old@usestag; - updated for
cakedc/cakephp-phpstanto^4.0(and sophpstan/phpstanto2.1.8)
What's Changed
- updated for
cakedc/cakephp-phpstanto^4.0(and so `phpstan/phpst… by @mirko-pagliai in #147 - 2.14.x develop by @mirko-pagliai in #148
- 2.14.x develop executor by @mirko-pagliai in #149
- 2.14.x develop by @mirko-pagliai in #150
- significant improvement for
SqlExecutor. Also, improved related tests by @mirko-pagliai in #151 - added
symfony/polyfill-php83. This allowed the#[Override]attrib… by @mirko-pagliai in #152 - we also begin to apply the
UsesClassattribute and remove the old `… by @mirko-pagliai in #153 - 2.14.x develop by @mirko-pagliai in #154
- fixed by @mirko-pagliai in #155
- 2.14.x develop by @mirko-pagliai in #156
- 2.14.x develop executor by @mirko-pagliai in #158
- 2.14.x develop by @mirko-pagliai in #159
Full Changelog: 2.14.0...2.14.1
2.14.0
Caution
This release starts the new 2.14.x branch.
For the end user, there should be no major problems upgrading from 2.13.x, except for some possible deprecations. It is recommended that you perform any necessary checks before and after upgrading.
- added new magic
AbstractBackupUtility::__call()method. This allowsBackupExportandBackupImportto access the
property via the magic methodsgetX()(be careful not to confuse thegetCompression()method, which now returns
the$compressionproperty ofBackupExport, with the old method provided byBackupTrait, which had been
deprecated and has now been removed); - class
DatabaseBackup\Driver\AbstractDriverhas becomeDatabaseBackup\Executor\AbstractExecutor, class
DatabaseBackup\Driver\Mysqlhas becomeDatabaseBackup\Executor\MysqlExecutor, classDatabaseBackup\Driver\Postgres
has becomeDatabaseBackup\Executor\PostgresExecutorand classDatabaseBackup\Driver\Sqlitehas become
DatabaseBackup\Executor\SqliteExecutor. Aliases have been added to old classes for backwards compatibility, but will
be removed in a future release; - added new
AbstractBackupUtility::getExecutor()that gets theExecutorinstance (oldDriverclasses now renamed)
according to the connection; - passing the
$compressionargument as a string ornulltoBackupExport::compression()had been deprecated and has
been removed (backwards compatibility removed); - the
BackupManager::indexmethods no longer returns, in the array for each file, thefilenamekey; - the
BackupExport::filename()andBackupImport::filename()methods now throw anIOExceptionexception (rather
than aLogicException) if the target (directory) is not writable/the filename already exists/the filename is not
readable; - the
BackupExport::export()andBackupImport::import()methods now throw aRuntimeExceptionexception (rather
than aLogicException) when export/import fails; - the
BackupImport::import()methods now throws aBadMethodCallExceptionexception (rather than aLogicException)
when the filename has not been set; - fixed a deprecation regarding a
Finder::sort()method call; - the
TestCase::createSomeBackups()method has been improved; - tests for
MysqlExecutor(henceMysqlExecutorTest) can be run regardless of the driver in use; - the
AbstractBackupUtility::getDriver()method is deprecated and will be removed in a future release. Use instead the
getExecutor()method; - the
AbstractBackupUtility::__get()method is deprecated and will be removed in a future release; DeleteAllCommand,RotateCommandandSendCommandclasses had been deprecated and have been removed;- the
getConnection()andgetDriverName()methods provided byBackupTraitare deprecated and will be removed in a
future release. The entireBackupTraittrait is now deprecated and will be removed in a future release; getAbsolutePath(),getCompression(),getExtension()andgetValidCompressions()methods provided by
BackupTraithad been deprecated and has been removed;- all classes, methods and code related to sending backups via email had been deprecated, and now they have been
removed. So, theBackupManager::send()method (and, consequently, the internalBackupManager::getEmailInstance()
method), theBackupExport::send()method and thesendoption for theExportCommandhave been removed; - the
delete()anddeleteAll()methods provided byBackupManagerhad been deprecated and have been removed; - the
rtr()global function had been deprecated and has been removed.
What's Changed
- 2.14.x develop by @mirko-pagliai in #142
- 2.14.x develop by @mirko-pagliai in #143
- 2.14.x develop by @mirko-pagliai in #144
- tests for
MysqlExecutor(henceMysqlExecutorTest) can be run rega… by @mirko-pagliai in #145 - updated by @mirko-pagliai in #146
Full Changelog: 2.13.6...2.14.0
2.13.6
Important
If there are no particular needs (e.g. bug fixes, vulnerability fixes, etc.), this will be the last release of the 2.13 branch.
- now all
Driverclasses (through theAbstractDriverclass) have$Connectionas their constructor argument, and
therefore as their property. This argument is automatically passed by theAbstractBackupUtility::getDriver()method
(which was already happening previously, but without any consequences).
What's Changed
- 2.13.x actions by @mirko-pagliai in #141
Full Changelog: 2.13.5...2.13.6
2.13.5
Important
This new version 2.13.15, following 2.13.14 and 2.13.13, introduces many new deprecations, following the same deprecation logic already applied.
The code has been extensively optimized and with it also the tests, removing redundant methods, superfluous code, etc.
The tests are reviewed and rewritten, in addition to using the new attributes provided by the latest versions of PHPUnit.
This process has so far affected half of the available classes and will continue with the 2.14.x branch and will end only with the 2.15.x branch.
The user should not currently have problems upgrading on the same branch, but these deprecations (and some planned renamed classes) will be removed in future branches.
Starting with this release, it was decided to abandon the master/develop branch structure on GitHub and mirror the real branching of the code (e.g. the master branch is now 2.13.x and after this release it will become 2.14.x).
This allows for easy and transparent development on multiple branches at the same time.
A small regression in the coverage reported by Codecov is tentatively expected. But this is reasonably expected, as the application of the new PHPUnit attributes tightens the checks (and thus the coverage is now more real).
- added new
DatabaseBackup\Compressionenum, with some methods useful for the complete management of compressions; - the
BackupExport::compression()method now accepts aCompressionvalue as its$compressionargument. String and
nullvalues are still supported, but are now deprecated and will be removed in a future release. Additionally, if an
invalid string is now passed as an argument, aInvalidArgumentExceptionexception is thrown; - the
BackupManager::index()method now returns, in the array for each file, aCompressionenum value for the
compressionkey (rather than a string ornull), the absolute path for thepathkey, and the basename for the
basenamekey. Thefilenamekey is still returned, but will be removed in version 2.14.0 (basenameis more
efficient). Theextensionkey has already been removed, as it is now useless. TheIndexCommandinstead still
carries the compression as a string (it couldn't be otherwise), while it also no longer reports the extension (also
useless in this case); - the
BackupExportclass no longer directly handles the backup extension, which is automatically deduced from the
value ofCompression, now set by default toCompression::None(no compression) and which can always be changed
with thecompression()and (indirectly)filename()methods. For this reason, theBackupExport::$extension
property no longer exists; - except for
ExportCommandandImportCommand, all otherCommandclasses (including deprecated ones) now directly
extendCake\Console\BaseCommand. This means that they will no longer display connection information by default, but
that makes sense since those classes only work on the filesystem; - added new
Command::makeRelativeFilename()method. This will replace the globalrtr()function, since only
Commandclasses really need it; - the
BackupImport::filename()method usesCompressionto check the validity of the file you want to import (so it
no longer checks its extension). This will throw aValueErrorexception for invalid files; - the global test functions
createBackup()andcreateSomeBackups()are now methods of theTestCaseclass (as they
should be). ThecreateBackup()method now has the$fakeBackupargument (falseby default), which allows you to
create a fake backup file (i.e. an empty file) Added tests; - added new
AbstractBackupUtility::makeAbsoluteFilename()method. Since theBackupTrait::getAbsolutePath()method is
now deprecated (see below), it provides theBackupExportandBackupImportclasses (the only ones that really need
it) with a method to construct absolute paths; - added
OperationTypeenum, which is used by theAbstractDriver::getExecutable()private method; - the
AbstractDriver::getBinary()method can now accept aCompressionvalue as an argument (in addition to a
string). Invalid values will now throw anInvalidArgumentException(rather than aLogicException); - the
BackupManager::rotate()method throws anInvalidArgumentException(and no longerLogicException) for an
invalid$rotatevalue. The method description has been corrected; - the code, introduced in version
2.13.3, that allows paths relative toROOT, has been moved from
BackupTrait::getAbsolutePath()method toImportCommand::execute(), since it is the only one that takes advantage
of it; - the
DATABASE_BACKUP_EXTENSIONSconstant no longer exists, as it is no longer needed due to theCompressionenum; - the
rtr()global function is deprecated and will be removed in a future release; - the
RotateCommandclass is deprecated and will be removed in a later release. For this reason, theExportCommand
class now uses theBackupManager::rotate()method to continue supporting the--rotateoption; getAbsolutePath(),getCompression(),getExtension()andgetValidCompressions()methods provided by
BackupTraitare deprecated. They will be removed in a future release;- the
delete()anddeleteAll()methods provided byBackupManagerare deprecated. They will be removed in a future
release. The few methods that need to delete files (e.g. rotation methods) implement the necessary code themselves; - compatibility with the transition from
_cake_core_to_cake_translations_expected in CakePHP 5.1; - the
BackupExport::$defaultExtensionproperty no longer exists (by now it had become useless); - updated for the latest version of psalm.
What's Changed
- Develop by @mirko-pagliai in #123
- compatibility with the transition from
_cake_core_to `_cake_transl… by @mirko-pagliai in #124 - fixed by @mirko-pagliai in #125
- Develop compression enum by @mirko-pagliai in #126
- Develop by @mirko-pagliai in #128
- Develop by @mirko-pagliai in #129
- Develop by @mirko-pagliai in #130
- Develop by @mirko-pagliai in #131
- Develop by @mirko-pagliai in #132
- Develop by @mirko-pagliai in #133
- Develop by @mirko-pagliai in #134
- Develop by @mirko-pagliai in #135
- Develop by @mirko-pagliai in #136
- Develop by @mirko-pagliai in #137
- Develop by @mirko-pagliai in #138
- Develop by @mirko-pagliai in #139
- Develop by @mirko-pagliai in #140
Full Changelog: 2.13.4...2.13.5
2.13.4
Since all features related to sending backups via email have been deprecated with this release (and will be removed in 2.14.0), the Send backups via email wiki page has been added, which explains both the reason for the deprecation and how to implement that feature yourself.
The Common issues page has also been added.
Changelog:
- fixed bug #119:
BackupManagerignored the timezone of backup files, and consequently alsoIndexCommand; - fixed bug #111: for Mysql it first looks for
mariadbandmariadb-dumpexecutables, otherwisemysql
andmysqldumpexecutables; - all classes, methods and code related to sending backups via email are now deprecated. So, the
BackupManager::send()
method (and, consequently, also the internalBackupManager::getEmailInstance()method), theBackupExport::send()
method, theSendCommandclass and thesendoption for theExportCommandare deprecated. All of these will be
removed in a later release. No replacement is provided; - setting the
DatabaseBackup.mailSendervalue of the configuration is deprecated (bootstrap checks that the value
has not been set by the user); - the
DeleteAllCommandis deprecated. Will be removed in a future release; - added tests for php 8.4;
- all chainable methods of
BackupExportandBackupImportclasses now have the typehint for returning self. Updated
descriptions; - updated
phpunitto^10.5.5 || ^11.1.3; - updated
psalmto6.x; - uses
cakedc/cakephp-phpstan; - the old
FrozenTimeclasses have been replaced withDateTime(which it was an alias for); - extensive revision of descriptions and tags of all classes and methods;
- removed some errors related to phpcs, phpstan and psalm, previously silenced;
- the
READMEfile has been updated for compatibility with older versions of CakePHP and PHP (branches have been
removed and older versions are available as tags); - overall updated
READMEfile, updated links to CakePHP documentation. Some information has been moved from the
READMEfile to the (new) Common issues wiki page.
What's Changed
- Develop php8.4 by @mirko-pagliai in #115
- all chainable methods of X and Y now have the typehint for returning … by @mirko-pagliai in #118
- Develop backup manager send is deprecated by @mirko-pagliai in #120
- updated
phpunitto^10.5.5 || ^11.1.3by @mirko-pagliai in #122 - Develop by @mirko-pagliai in #116
Full Changelog: 2.13.3...2.13.4
2.13.3
- added
--reverseoption for theIndexCommand(issue #96); - the
BackupTrait::getAbsolutePath()method is now able to recognize a path relative to itsROOT, so as to be able
to take advantage of the autocompletion already offered by the bash console when, for example, you use theimport
command from theROOTand 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/process7.1.7, due to this security vulnerability; - fixed some errors in localizations of some strings;
- replaced deprecated
getMockForAbstractClass()method in tests.
What's Changed
- Bump symfony/process from 7.1.5 to 7.1.7 by @dependabot in #107
- requires at least
symfony/process7.1.7, due to a security vulner… by @mirko-pagliai in #108
New Contributors
- @dependabot made their first contribution in #107
Full Changelog: 2.13.2...2.13.3
2.13.2
- no longer needs
php-tools; - removed useless
CommandTestCase; - little fixes and updates.
What's Changed
- Develop by @mirko-pagliai in #105
- Develop by @mirko-pagliai in #106
Full Changelog: 2.13.1...2.13.2
2.13.1
- updated for
php-tools1.10.0.
What's Changed
- Develop by @mirko-pagliai in #103
- Develop by @mirko-pagliai in #104
Full Changelog: 2.13.0...2.13.1
2.13.0
- requires at least PHP 8.1, PHPUnit 10 and CakePHP 5.0;
- added tests for PHP 8.3.
What's Changed
- Develop by @mirko-pagliai in #100
- Php8.1 by @mirko-pagliai in #101
- Develop by @mirko-pagliai in #102
Full Changelog: 2.12.3...2.13.0
2.12.3
- updated for
php-tools1.8.
What's Changed
- Develop by @mirko-pagliai in #99
Full Changelog: 2.12.2...2.12.3