mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Suggest STRICT_ALL_TABLES during setup. Improve dev-mode comments.
Summary: Suggest the MySQL mode STRICT_ALL_TABLES during setup if it is not set. Small improvement to the phabricator.developer-mode comments. Test Plan: Set the global sql_mode to include or exclude STRICT_ALL_TABLES and check for desired behavior. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4803
This commit is contained in:
parent
5a2be27045
commit
39afb3fedb
2 changed files with 16 additions and 1 deletions
|
@ -801,7 +801,8 @@ return array(
|
||||||
// Show stack traces when unhandled exceptions occur, force reloading of
|
// Show stack traces when unhandled exceptions occur, force reloading of
|
||||||
// static resources (skipping the cache), show an error callout if a page
|
// static resources (skipping the cache), show an error callout if a page
|
||||||
// generated PHP errors, warnings, or notices, force disk reads when
|
// generated PHP errors, warnings, or notices, force disk reads when
|
||||||
// reloading. This option should not be enabled in production.
|
// reloading, and generally make development easier. This option should not
|
||||||
|
// be enabled in production.
|
||||||
'phabricator.developer-mode' => false,
|
'phabricator.developer-mode' => false,
|
||||||
|
|
||||||
// When users write comments which have URIs, they'll be automatically linked
|
// When users write comments which have URIs, they'll be automatically linked
|
||||||
|
|
|
@ -65,6 +65,20 @@ final class PhabricatorSetupCheckDatabase extends PhabricatorSetupCheck {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {
|
||||||
|
$mode_string = queryfx_one($conn_raw, "SELECT @@sql_mode");
|
||||||
|
$modes = explode(',', $mode_string['@@sql_mode']);
|
||||||
|
if (!in_array('STRICT_ALL_TABLES', $modes)) {
|
||||||
|
$message = pht(
|
||||||
|
"The global sql_mode is not set to 'STRICT_ALL_TABLES'. It is ".
|
||||||
|
"recommended that you set this mode while developing Phabricator.");
|
||||||
|
|
||||||
|
$this->newIssue('mysql.mode')
|
||||||
|
->setName(pht('MySQL STRICT_ALL_TABLES mode not set.'))
|
||||||
|
->setMessage($message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$namespace = PhabricatorEnv::getEnvConfig('storage.default-namespace');
|
$namespace = PhabricatorEnv::getEnvConfig('storage.default-namespace');
|
||||||
|
|
||||||
$databases = queryfx_all($conn_raw, 'SHOW DATABASES');
|
$databases = queryfx_all($conn_raw, 'SHOW DATABASES');
|
||||||
|
|
Loading…
Reference in a new issue