57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
public function close(): void
{
parent::close();
self::$_instance = null;
}
/**
* Import a file containing SQL commands
* Allows to use the statement ".read other_file.sql" to load other files
* @param string $file Path to file containing SQL commands
* @return boolean
*/
public function import($file)
{
$sql = file_get_contents($file);
$dir = dirname($file);
$sql = preg_replace_callback('/^\.read (.+\.sql)$/m', function ($match) use ($dir) {
return file_get_contents($dir . DIRECTORY_SEPARATOR . $match[1]) . "\n";
}, $sql);
return $this->exec($sql);
}
public function beginSchemaUpdate()
{
$this->toggleForeignKeys(false);
$this->begin();
}
public function commitSchemaUpdate()
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
public function close(): void
{
parent::close();
self::$_instance = null;
}
public function beginSchemaUpdate()
{
$this->toggleForeignKeys(false);
$this->begin();
}
public function commitSchemaUpdate()
|