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