Replace preg_replace with basename in SchemaShell

This commit is contained in:
ovidiupruteanu 2015-05-11 14:52:31 +03:00
parent 4b3386c16f
commit a55685c278

View file

@ -158,7 +158,7 @@ class SchemaShell extends AppShell {
}
if ($snapshot === true) {
$fileName = preg_replace('`\.php$`', '', $this->params['file'], 1);
$fileName = basename($this->params['file'], '.php');
$Folder = new Folder($this->Schema->path);
$result = $Folder->read();
@ -285,7 +285,7 @@ class SchemaShell extends AppShell {
'connection' => $this->params['connection'],
);
if (!empty($this->params['snapshot'])) {
$fileName = preg_replace('`\.php$`', '', $this->Schema->file, 1);
$fileName = basename($this->Schema->file, '.php');
$options['file'] = $fileName . '_' . $this->params['snapshot'] . '.php';
}