Releases: mirko-pagliai/cakephp-database-backup
3.0.0-RC1
2.15.0
BackupManager::index()
andBackupManager::rotate()
methods have been deprecated and will be removed in a future
release. At this point, the entireBackupManager
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 ofExportCommand
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
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 usels -g -A -t -r backups/
(andls --help
for any help); - the
--rotate
option ofExportCommand
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 version2.14.3
).
What's Changed
- 2.14.x develop by @mirko-pagliai in #195
Full Changelog: 2.14.3...2.14.4
3.0.0-beta1
What's Changed
- 3.0.x ci by @mirko-pagliai in #171
- added windows tests by @mirko-pagliai in #172
- 3.0.x ci code coverage by @mirko-pagliai in #173
- 3.0.x ci phpcs and phpstan by @mirko-pagliai in #174
- 3.0.x prefer lowest by @mirko-pagliai in #180
- updated by @mirko-pagliai in #184
- 3.0.x windows by @mirko-pagliai in #185
- 3.0.x mysql by @mirko-pagliai in #186
- 3.0.x ci tests by @mirko-pagliai in #188
- tests for postgres by @mirko-pagliai in #189
- fixed for windows by @mirko-pagliai in #190
- 3.0.x ci by @mirko-pagliai in #191
Full Changelog: https://github.com/mirko-pagliai/cakephp-database-backup/commits/3.0.0-beta1
2.14.3
- the
Plugin
class no longer implements theconsole()
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
thegetConnection()
magic method; AbstractBackupUtility::makeAbsoluteFilename()
has becomemakeAbsolutePath()
andCommand::makeRelativeFilename()
has becomemakeRelativePath()
;- 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
- 2.14.x develop by @mirko-pagliai in #170
- the
Plugin
class no longer implements theconsole()
method (which… by @mirko-pagliai in #175 - 2.14.x develop by @mirko-pagliai in #179
- 2.14.x develop by @mirko-pagliai in #181
- 2.14.x wiki by @mirko-pagliai in #182
- 2.14.x develop by @mirko-pagliai in #183
Full Changelog: 2.14.2...2.14.3
2.14.2
- the constructor method
AbstractBackupUtility
now accepts$Connection
as an optional argument, as string (e.g.
default
ortest
) or aConnectionInterface
instance. This means that by instantiatingBackupExport
or
BackupImport
(which extendAbstractBackupUtility
) it is possible to set a connection beyond the default one; ExportCommand
andImportCommand
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
andDatabaseBackup.sqlite
are now deprecated
and will be removed in a future release (backwards compatibility will be maintained up to branch2.15.x
). Use the
DatabaseBackup.Mysql
,DatabaseBackup.Postgres
andDatabaseBackup.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 oldsend
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, thebeforeExport()
andbeforeImport()
event methods provided byAbstractExecutor
,
MysqlExecutor
andSqliteExecutor
no longer return a boolean. Optionally these methods can use the
$Event->setResult()
method to set a result. Currently, thevoid
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
- configuration names
DatabaseBackup.mysql
,DatabaseBackup.postgres
… by @mirko-pagliai in #160 - 2.14.x connection by @mirko-pagliai in #162
- removed Psalm (for the same reasons given for CakePHP, see [here](htt… by @mirko-pagliai in #165
- fixed deprecations by @mirko-pagliai in #167
- 2.14.x develop by @mirko-pagliai in #168
Full Changelog: 2.14.1...2.14.2
2.14.1
- many improvements for the
AbstractExecutor
abstract class; - method
AbstractBackupUtility::getExecutor()
now accepts the optional$Connection
argument. ThegetConnection()
method has been removed; getExecutable()
,getExportExecutable()
andgetImportExecutable()
methods provided byAbstractExecutor
have
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
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. ThePostgresExecutorTest
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 sophpstan/phpstan
to2.1.8
)
What's Changed
- updated for
cakedc/cakephp-phpstan
to^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
UsesClass
attribute 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 allowsBackupExport
andBackupImport
to access the
property via the magic methodsgetX()
(be careful not to confuse thegetCompression()
method, which now returns
the$compression
property ofBackupExport
, with the old method provided byBackupTrait
, which had been
deprecated and has now been removed); - class
DatabaseBackup\Driver\AbstractDriver
has becomeDatabaseBackup\Executor\AbstractExecutor
, class
DatabaseBackup\Driver\Mysql
has becomeDatabaseBackup\Executor\MysqlExecutor
, classDatabaseBackup\Driver\Postgres
has becomeDatabaseBackup\Executor\PostgresExecutor
and classDatabaseBackup\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 theExecutor
instance (oldDriver
classes now renamed)
according to the connection; - passing the
$compression
argument as a string ornull
toBackupExport::compression()
had been deprecated and has
been removed (backwards compatibility removed); - the
BackupManager::index
methods no longer returns, in the array for each file, thefilename
key; - the
BackupExport::filename()
andBackupImport::filename()
methods now throw anIOException
exception (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 aRuntimeException
exception (rather
than aLogicException
) when export/import fails; - the
BackupImport::import()
methods now throws aBadMethodCallException
exception (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
,RotateCommand
andSendCommand
classes had been deprecated and have been removed;- the
getConnection()
andgetDriverName()
methods provided byBackupTrait
are deprecated and will be removed in a
future release. The entireBackupTrait
trait is now deprecated and will be removed in a future release; getAbsolutePath()
,getCompression()
,getExtension()
andgetValidCompressions()
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, theBackupManager::send()
method (and, consequently, the internalBackupManager::getEmailInstance()
method), theBackupExport::send()
method and thesend
option for theExportCommand
have been removed; - the
delete()
anddeleteAll()
methods provided byBackupManager
had 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
Driver
classes (through theAbstractDriver
class) have$Connection
as 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\Compression
enum, with some methods useful for the complete management of compressions; - the
BackupExport::compression()
method now accepts aCompression
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, aInvalidArgumentException
exception is thrown; - the
BackupManager::index()
method now returns, in the array for each file, aCompression
enum value for the
compression
key (rather than a string ornull
), the absolute path for thepath
key, and the basename for the
basename
key. Thefilename
key is still returned, but will be removed in version 2.14.0 (basename
is more
efficient). Theextension
key has already been removed, as it is now useless. TheIndexCommand
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 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
ExportCommand
andImportCommand
, all otherCommand
classes (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
Command
classes really need it; - the
BackupImport::filename()
method usesCompression
to check the validity of the file you want to import (so it
no longer checks its extension). This will throw aValueError
exception for invalid files; - the global test functions
createBackup()
andcreateSomeBackups()
are now methods of theTestCase
class (as they
should be). ThecreateBackup()
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 theBackupTrait::getAbsolutePath()
method is
now deprecated (see below), it provides theBackupExport
andBackupImport
classes (the only ones that really need
it) with a method to construct absolute paths; - added
OperationType
enum, which is used by theAbstractDriver::getExecutable()
private method; - the
AbstractDriver::getBinary()
method can now accept aCompression
value 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$rotate
value. 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_EXTENSIONS
constant no longer exists, as it is no longer needed due to theCompression
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, theExportCommand
class now uses theBackupManager::rotate()
method to continue supporting the--rotate
option; getAbsolutePath()
,getCompression()
,getExtension()
andgetValidCompressions()
methods provided by
BackupTrait
are deprecated. They will be removed in a future release;- the
delete()
anddeleteAll()
methods provided byBackupManager
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
- 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