Sfoglia il codice sorgente

Changing prefixing substitution method

ahwelp 2 anni fa
parent
commit
edf7974a4f
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      src/Schema/Wrapper.php

+ 3 - 1
src/Schema/Wrapper.php

@@ -86,7 +86,9 @@ class Wrapper
     {
         $instance = self::getInstance();
         $prefix = $instance->_adapter->getConnection()->prefix;
-        $sql = preg_replace('/{.*?}/', "$prefix$1", $sql);
+        $sql = preg_replace_callback('/{.*?}/', function($match) use ($prefix){
+            return str_replace('}', '', str_replace('{', $prefix, $match[0]));
+        } , $sql);
         $instance->_driver->exec($sql);
     }