Skip to content

Commit

Permalink
Replace preg_replace with basename in SchemaShell
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiupruteanu committed May 11, 2015
1 parent 4b3386c commit a55685c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Console/Command/SchemaShell.php
Expand Up @@ -158,7 +158,7 @@ public function generate() {
}

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();

Expand Down Expand Up @@ -285,7 +285,7 @@ protected function _loadSchema() {
'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';
}

Expand Down

0 comments on commit a55685c

Please sign in to comment.