Skip to content

2.13.5

Choose a tag to compare

@mirko-pagliai mirko-pagliai released this 12 Mar 15:59
4028a9a

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\Compression enum, with some methods useful for the complete management of compressions;
  • the BackupExport::compression() method now accepts a Compression value as its $compression argument. String and
    null values 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, a InvalidArgumentException exception is thrown;
  • the BackupManager::index() method now returns, in the array for each file, a Compression enum value for the
    compression key (rather than a string or null), the absolute path for the path key, and the basename for the
    basename key. The filename key is still returned, but will be removed in version 2.14.0 (basename is more
    efficient). The extension key has already been removed, as it is now useless. The IndexCommand instead 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 BackupExport class no longer directly handles the backup extension, which is automatically deduced from the
    value of Compression, now set by default to Compression::None (no compression) and which can always be changed
    with the compression() and (indirectly) filename() methods. For this reason, the BackupExport::$extension
    property no longer exists;
  • except for ExportCommand and ImportCommand, all other Command classes (including deprecated ones) now directly
    extend Cake\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 global rtr() function, since only
    Command classes really need it;
  • the BackupImport::filename() method uses Compression to check the validity of the file you want to import (so it
    no longer checks its extension). This will throw a ValueError exception for invalid files;
  • the global test functions createBackup() and createSomeBackups() are now methods of the TestCase class (as they
    should be). The createBackup() method now has the $fakeBackup argument (false by default), which allows you to
    create a fake backup file (i.e. an empty file) Added tests;
  • added new AbstractBackupUtility::makeAbsoluteFilename() method. Since the BackupTrait::getAbsolutePath() method is
    now deprecated (see below), it provides the BackupExport and BackupImport classes (the only ones that really need
    it) with a method to construct absolute paths;
  • added OperationType enum, which is used by the AbstractDriver::getExecutable() private method;
  • the AbstractDriver::getBinary() method can now accept a Compression value as an argument (in addition to a
    string). Invalid values will now throw an InvalidArgumentException (rather than a LogicException);
  • the BackupManager::rotate() method throws an InvalidArgumentException (and no longer LogicException) for an
    invalid $rotate value. The method description has been corrected;
  • the code, introduced in version 2.13.3, that allows paths relative to ROOT, has been moved from
    BackupTrait::getAbsolutePath() method to ImportCommand::execute(), since it is the only one that takes advantage
    of it;
  • the DATABASE_BACKUP_EXTENSIONS constant no longer exists, as it is no longer needed due to the Compression enum;
  • the rtr() global function is deprecated and will be removed in a future release;
  • the RotateCommand class is deprecated and will be removed in a later release. For this reason, the ExportCommand
    class now uses the BackupManager::rotate() method to continue supporting the --rotate option;
  • getAbsolutePath(), getCompression(), getExtension() and getValidCompressions() methods provided by
    BackupTrait are deprecated. They will be removed in a future release;
  • the delete() and deleteAll() methods provided by BackupManager are 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::$defaultExtension property no longer exists (by now it had become useless);
  • updated for the latest version of psalm.

What's Changed

Full Changelog: 2.13.4...2.13.5