File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/Illuminate/Database/Connectors Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ public function connect(array $config)
27
27
$ connection ->exec ("use ` {$ config ['database ' ]}`; " );
28
28
}
29
29
30
+ $ this ->configureIsolationLevel ($ connection , $ config );
31
+
30
32
$ this ->configureEncoding ($ connection , $ config );
31
33
32
34
// Next, we will check to see if a timezone has been specified in this config
@@ -44,7 +46,25 @@ public function connect(array $config)
44
46
*
45
47
* @param \PDO $connection
46
48
* @param array $config
47
- * @return void
49
+ * @return void|\PDO
50
+ */
51
+ protected function configureIsolationLevel ($ connection , array $ config )
52
+ {
53
+ if (! isset ($ config ['isolation_level ' ])) {
54
+ return $ connection ;
55
+ }
56
+
57
+ $ connection ->prepare (
58
+ "SET SESSION TRANSACTION ISOLATION LEVEL ' {$ config ['isolation_level ' ]}' "
59
+ )->execute ();
60
+ }
61
+
62
+ /**
63
+ * Set the connection character set and collation.
64
+ *
65
+ * @param \PDO $connection
66
+ * @param array $config
67
+ * @return void|\PDO
48
68
*/
49
69
protected function configureEncoding ($ connection , array $ config )
50
70
{
You can’t perform that action at this time.
0 commit comments