Skip to content

Releases: mirko-pagliai/cakephp-database-backup

3.0.0-RC1

30 May 15:18
Compare
Choose a tag to compare
3.0.0-RC1 Pre-release
Pre-release

What's Changed

Full Changelog: 3.0.0-beta1...3.0.0-RC1

2.15.0

30 May 13:17
Compare
Choose a tag to compare
  • BackupManager::index() and BackupManager::rotate() methods have been deprecated and will be removed in a future
    release. At this point, the entire BackupManager class is considered deprecated and will be removed;
  • the BackupExport::rotate() method has been deprecated and will be removed in a future release;
  • the DatabaseBackup.chmod configuration is deprecated and will be removed in a future release;
  • the IndexCommand had been deprecated and was removed;
  • the --rotate option of ExportCommand had been deprecated and was removed;
  • the magic method AbstractBackupUtility::__get() had been deprecated and has been removed;
  • BackupTrait had been deprecated and has been removed;
  • AbstractBackupUtility::getDriver() had been deprecated and has been removed.

What's Changed

  • deprecated BackupManager::rotate() and updated related tests and do… by @mirko-pagliai in #196

Full Changelog: 2.14.4...2.15.0

2.14.4

30 May 09:54
Compare
Choose a tag to compare

Important

If there are no particular needs (e.g. bug fixes, vulnerability fixes, etc.), this will be the last release of the 2.14 branch.

  • the IndexCommand has been deprecated and will be removed in a future release. Instead, use the commands available to
    your system. For example, for Unix you might use ls -g -A -t -r backups/ (and ls --help for any help);
  • the --rotate option of ExportCommand has been deprecated and will be removed in a future release;
  • all links to the wiki have been removed (which, remember, has been replaced by the docs/ folder inside the branch,
    since version 2.14.3).

What's Changed

Full Changelog: 2.14.3...2.14.4

3.0.0-beta1

27 May 11:01
Compare
Choose a tag to compare
3.0.0-beta1 Pre-release
Pre-release

What's Changed

Full Changelog: https://github.com/mirko-pagliai/cakephp-database-backup/commits/3.0.0-beta1

2.14.3

21 May 14:13
df0db6f
Compare
Choose a tag to compare
  • the Plugin class no longer implements the console() method (which described the available commands), leaving the
    application to take care of auto-discovering them;
  • the AbstractBackupUtility::__call() method now also supports uppercase named properties (bug fixed). This provides
    the getConnection() magic method;
  • AbstractBackupUtility::makeAbsoluteFilename() has become makeAbsolutePath() and Command::makeRelativeFilename()
    has become makeRelativePath();
  • the signature of AbstractBackupUtility::__call() method has changed (from
    __call(string $name, array $arguments = []): mixed to __call(string $method, array $args): mixed);
  • increased use of fake backup files for testing, where there is no need to use real backups for testing;
  • the entire wiki has been copied to the docs/ directory. This choice was made to allow the maintenance of information related to old versions (i.e. the branch you are viewing/using).

What's Changed

Full Changelog: 2.14.2...2.14.3

2.14.2

29 Apr 10:04
207207c
Compare
Choose a tag to compare
  • the constructor method AbstractBackupUtility now accepts $Connection as an optional argument, as string (e.g.
    default or test) or a ConnectionInterface instance. This means that by instantiating BackupExport or
    BackupImport (which extend AbstractBackupUtility) it is possible to set a connection beyond the default one;
  • ExportCommand and ImportCommand now accept the --connection option to set a connection other than the default;
  • due to the two new introductions just described, the DatabaseBackup.connection configuration name is deprecated
    and will be removed in a later release;
  • configuration names DatabaseBackup.mysql, DatabaseBackup.postgres and DatabaseBackup.sqlite are now deprecated
    and will be removed in a future release (backwards compatibility will be maintained up to branch 2.15.x). Use the
    DatabaseBackup.Mysql, DatabaseBackup.Postgres and DatabaseBackup.Sqlite names instead in your bootstrap (the
    driver name begins with a capital letter);
  • removed from ExportCommand::buildOptionParser() the reference (as a helper) to the old send option, which was no
    longer present (it had been forgotten);
  • starting with CakePHP 5.2, returning values from event listeners/callbacks is deprecated.
    For this reason, the beforeExport() and beforeImport() event methods provided by AbstractExecutor,
    MysqlExecutor and SqliteExecutor no longer return a boolean. Optionally these methods can use the
    $Event->setResult() method to set a result. Currently, the void return type is not explicit to ensure backwards
    compatibility, it will be made explicit in a future release;
  • removed Psalm (for the same reasons given for CakePHP, see here).

What's Changed

Full Changelog: 2.14.1...2.14.2

2.14.1

15 Apr 15:55
ec7e8b3
Compare
Choose a tag to compare
  • many improvements for the AbstractExecutor abstract class;
  • method AbstractBackupUtility::getExecutor() now accepts the optional $Connection argument. The getConnection()
    method has been removed;
  • getExecutable(), getExportExecutable() and getImportExecutable() methods provided by AbstractExecutor have
    been renamed as getCommand(), getExportCommand() and getImportCommand(). This is because they never actually
    returned "executables", but rather commands. This makes their name clearer. For getExportExecutable() and
    getImportExecutable() methods backwards compatibility is ensured via the magic method _call() (with deprecation);
  • significant improvement for SqlExecutor. Also, improved related tests;
  • the DriverTestCase abstract 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. The PostgresExecutorTest test
    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 UsesClass attribute and remove the old @uses tag;
  • updated for cakedc/cakephp-phpstan to ^4.0 (and so phpstan/phpstan to 2.1.8)

What's Changed

Full Changelog: 2.14.0...2.14.1

2.14.0

20 Mar 17:09
fb20c2a
Compare
Choose a tag to compare

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 allows BackupExport and BackupImport to access the
    property via the magic methods getX() (be careful not to confuse the getCompression() method, which now returns
    the $compression property of BackupExport, with the old method provided by BackupTrait, which had been
    deprecated and has now been removed);
  • class DatabaseBackup\Driver\AbstractDriver has become DatabaseBackup\Executor\AbstractExecutor, class
    DatabaseBackup\Driver\Mysql has become DatabaseBackup\Executor\MysqlExecutor, class DatabaseBackup\Driver\Postgres
    has become DatabaseBackup\Executor\PostgresExecutor and class DatabaseBackup\Driver\Sqlite has 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 the Executor instance (old Driver classes now renamed)
    according to the connection;
  • passing the $compression argument as a string or null to BackupExport::compression() had been deprecated and has
    been removed (backwards compatibility removed);
  • the BackupManager::index methods no longer returns, in the array for each file, the filename key;
  • the BackupExport::filename() and BackupImport::filename() methods now throw an IOException exception (rather
    than a LogicException) if the target (directory) is not writable/the filename already exists/the filename is not
    readable;
  • the BackupExport::export() and BackupImport::import() methods now throw a RuntimeException exception (rather
    than a LogicException) when export/import fails;
  • the BackupImport::import() methods now throws a BadMethodCallException exception (rather than a LogicException)
    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 (hence MysqlExecutorTest) 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, RotateCommand and SendCommand classes had been deprecated and have been removed;
  • the getConnection() and getDriverName() methods provided by BackupTrait are deprecated and will be removed in a
    future release. The entire BackupTrait trait is now deprecated and will be removed in a future release;
  • getAbsolutePath(), getCompression(), getExtension() and getValidCompressions() methods provided by
    BackupTrait had 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, the BackupManager::send() method (and, consequently, the internal BackupManager::getEmailInstance()
    method), the BackupExport::send() method and the send option for the ExportCommand have been removed;
  • the delete() and deleteAll() methods provided by BackupManager had been deprecated and have been removed;
  • the rtr() global function had been deprecated and has been removed.

What's Changed

Full Changelog: 2.13.6...2.14.0

2.13.6

13 Mar 17:17
d0d5299
Compare
Choose a tag to compare

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 Driver classes (through the AbstractDriver class) have $Connection as their constructor argument, and
    therefore as their property. This argument is automatically passed by the AbstractBackupUtility::getDriver() method
    (which was already happening previously, but without any consequences).

What's Changed

Full Changelog: 2.13.5...2.13.6

2.13.5

12 Mar 15:59
4028a9a
Compare
Choose a tag to compare

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