makinacorpus / DbToolsBundle

A PHP library to backup, restore and anonymize databases
https://dbtoolsbundle.readthedocs.io
MIT License
182 stars 15 forks source link

issue #12 - filename strategy #81

Closed pounard closed 9 months ago

pounard commented 9 months ago

Adds an interface:

interface FilenameStrategyInterface
{
    /**
     * Generate dump file name.
     */
    public function generateFilename(
        string $storageRootDir,
        string $connectionName = 'default',
        string $extension = 'sql',
        bool $anonymized = false
    ): string;
}

Configuration goes like this:

db_tools:
    # ...

    connections:
        default:
            filename_strategy: MakinaCorpus\DbToolsBundle\Filename\StupideTestingFilenameStrategy
        foo_connection:
            filename_strategy: "default" # can be "datetime"
        mysql:
            filename_strategy: ~

And documentation is missing, do not merge yet !

@SimonMellerin any opinions ?