hyphenize the site name when doing a backup

This commit is contained in:
Andy Miller
2015-09-15 17:09:18 -06:00
parent 357ebbb6be
commit cfdead2bbf

View File

@@ -3,6 +3,7 @@ namespace Grav\Common\Backup;
use Grav\Common\GravTrait;
use Grav\Common\Filesystem\Folder;
use Grav\Common\Inflector;
/**
* The ZipBackup class lets you create simple zip-backups of a grav site
@@ -39,9 +40,11 @@ class ZipBackup
$name = self::getGrav()['config']->get('site.title', basename(GRAV_ROOT));
$inflector = new Inflector();
if (is_dir($destination)) {
$date = date('YmdHis', time());
$filename = $name . '-' . $date . '.zip';
$filename = $inflector->hyphenize($name) . '-' . $date . '.zip';
$destination = rtrim($destination, DS) . DS . $filename;
}