mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 05:39:10 +02:00
Merge pull request #4675 from kinglozzer/pulls/checktable
Only notify users about PDO native mode once
This commit is contained in:
commit
193fc9e469
@ -125,9 +125,16 @@ class MySQLSchemaManager extends DBSchemaManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function checkAndRepairTable($tableName) {
|
public function checkAndRepairTable($tableName) {
|
||||||
|
// Flag to ensure we only send the warning about PDO + native mode once
|
||||||
|
static $pdo_warning_sent = false;
|
||||||
|
|
||||||
// If running PDO and not in emulated mode, check table will fail
|
// If running PDO and not in emulated mode, check table will fail
|
||||||
if($this->database->getConnector() instanceof PDOConnector && !PDOConnector::is_emulate_prepare()) {
|
if($this->database->getConnector() instanceof PDOConnector && !PDOConnector::is_emulate_prepare()) {
|
||||||
$this->alterationMessage('CHECK TABLE command disabled for PDO in native mode', 'notice');
|
if (!$pdo_warning_sent) {
|
||||||
|
$this->alterationMessage('CHECK TABLE command disabled for PDO in native mode', 'notice');
|
||||||
|
$pdo_warning_sent = true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user