From a55685c278ea2d7d035691be45534c68d41c6117 Mon Sep 17 00:00:00 2001 From: ovidiupruteanu Date: Mon, 11 May 2015 14:52:31 +0300 Subject: [PATCH] Replace preg_replace with basename in SchemaShell --- lib/Cake/Console/Command/SchemaShell.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index adb9ff4cd79..7648d924ab3 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -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(); @@ -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'; }