Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorMySQLSetupCheck.php
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if (!in_array('STRICT_ALL_TABLES', $modes)) { | ||||
'Without this mode enabled, MySQL will silently ignore some error '. | 'Without this mode enabled, MySQL will silently ignore some error '. | ||||
'conditions, including inserts which attempt to store more data in '. | 'conditions, including inserts which attempt to store more data in '. | ||||
'a column than actually fits. This behavior is usually undesirable '. | 'a column than actually fits. This behavior is usually undesirable '. | ||||
'and can lead to data corruption (by truncating multibyte characters '. | 'and can lead to data corruption (by truncating multibyte characters '. | ||||
'in the middle), data loss (by discarding the data which does not '. | 'in the middle), data loss (by discarding the data which does not '. | ||||
'fit into the column), or security concerns (for example, by '. | 'fit into the column), or security concerns (for example, by '. | ||||
'truncating keys or credentials).'. | 'truncating keys or credentials).'. | ||||
"\n\n". | "\n\n". | ||||
'Phabricator is developed and tested in "STRICT_ALL_TABLES" mode so '. | 'This software is developed and tested in "STRICT_ALL_TABLES" mode so '. | ||||
'you should normally never encounter these situations, but may run '. | 'you should normally never encounter these situations, but may run '. | ||||
'into them if you interact with the database directly, run '. | 'into them if you interact with the database directly, run '. | ||||
'third-party code, develop extensions, or just encounter a bug in '. | 'third-party code, develop extensions, or just encounter a bug in '. | ||||
'the software.'. | 'the software.'. | ||||
"\n\n". | "\n\n". | ||||
'Enabling "STRICT_ALL_TABLES" makes MySQL raise an explicit error '. | 'Enabling "STRICT_ALL_TABLES" makes MySQL raise an explicit error '. | ||||
'if one of these unusual situations does occur. This is a safer '. | 'if one of these unusual situations does occur. This is a safer '. | ||||
'behavior and prevents these situations from causing secret, subtle, '. | 'behavior and prevents these situations from causing secret, subtle, '. | ||||
'and potentially serious issues later on.'. | 'and potentially serious issues later on.'. | ||||
"\n\n". | "\n\n". | ||||
'You can find more information about this mode (and how to configure '. | 'You can find more information about this mode (and how to configure '. | ||||
'it) in the MySQL manual. Usually, it is sufficient to add this to '. | 'it) in the MySQL manual. Usually, it is sufficient to add this to '. | ||||
'your "my.cnf" file (in the "[mysqld]" section) and then '. | 'your "my.cnf" file (in the "[mysqld]" section) and then '. | ||||
'restart "mysqld":'. | 'restart "mysqld":'. | ||||
"\n\n". | "\n\n". | ||||
'%s'. | '%s'. | ||||
"\n". | "\n". | ||||
'Note that if you run other applications against the same database, '. | 'Note that if you run other applications against the same database, '. | ||||
'they may not work in strict mode.'. | 'they may not work in strict mode.'. | ||||
"\n\n". | "\n\n". | ||||
'If you can not or do not want to enable "STRICT_ALL_TABLES", you '. | 'If you can not or do not want to enable "STRICT_ALL_TABLES", you '. | ||||
'can safely ignore this warning. Phabricator will work correctly '. | 'can safely ignore this warning. This software will work correctly '. | ||||
'with this mode enabled or disabled.', | 'with this mode enabled or disabled.', | ||||
$host_name, | $host_name, | ||||
phutil_tag('pre', array(), 'sql_mode=STRICT_ALL_TABLES')); | phutil_tag('pre', array(), 'sql_mode=STRICT_ALL_TABLES')); | ||||
$this->newIssue('sql_mode.strict') | $this->newIssue('sql_mode.strict') | ||||
->setName(pht('MySQL %s Mode Not Set', 'STRICT_ALL_TABLES')) | ->setName(pht('MySQL %s Mode Not Set', 'STRICT_ALL_TABLES')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if ($is_myisam_fulltext) { | ||||
$summary = pht( | $summary = pht( | ||||
'MySQL (on host "%s") is using a default stopword file, which '. | 'MySQL (on host "%s") is using a default stopword file, which '. | ||||
'will prevent searching for many common words.', | 'will prevent searching for many common words.', | ||||
$host_name); | $host_name); | ||||
$message = pht( | $message = pht( | ||||
"Database host \"%s\" is using the builtin stopword file for ". | "Database host \"%s\" is using the builtin stopword file for ". | ||||
"building search indexes. This can make Phabricator's search ". | "building search indexes. This can make the search ". | ||||
"feature less useful.\n\n". | "feature less useful.\n\n". | ||||
"Stopwords are common words which are not indexed and thus can not ". | "Stopwords are common words which are not indexed and thus can not ". | ||||
"be searched for. The default stopword file has about 500 words, ". | "be searched for. The default stopword file has about 500 words, ". | ||||
"including various words which you are likely to wish to search ". | "including various words which you are likely to wish to search ". | ||||
"for, such as 'various', 'likely', 'wish', and 'zero'.\n\n". | "for, such as 'various', 'likely', 'wish', and 'zero'.\n\n". | ||||
"To make search more useful, you can use an alternate stopword ". | "To make search more useful, you can use an alternate stopword ". | ||||
"file with fewer words. Alternatively, if you aren't concerned ". | "file with fewer words. Alternatively, if you aren't concerned ". | ||||
"about searching for common words, you can ignore this warning. ". | "about searching for common words, you can ignore this warning. ". | ||||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | if ($innodb_bytes < $minimum_bytes) { | ||||
$host_name); | $host_name); | ||||
$message = pht( | $message = pht( | ||||
"Database host \"%s\" is configured with a very small %s (%s). ". | "Database host \"%s\" is configured with a very small %s (%s). ". | ||||
"This may cause poor database performance and lock exhaustion.\n\n". | "This may cause poor database performance and lock exhaustion.\n\n". | ||||
"There are no hard-and-fast rules to setting an appropriate value, ". | "There are no hard-and-fast rules to setting an appropriate value, ". | ||||
"but a reasonable starting point for a standard install is something ". | "but a reasonable starting point for a standard install is something ". | ||||
"like 40%% of the total memory on the machine. For example, if you ". | "like 40%% of the total memory on the machine. For example, if you ". | ||||
"have 4GB of RAM on the machine you have installed Phabricator on, ". | "have 4GB of RAM on the machine you have installed this software on, ". | ||||
"you might set this value to %s.\n\n". | "you might set this value to %s.\n\n". | ||||
"You can read more about this option in the MySQL documentation to ". | "You can read more about this option in the MySQL documentation to ". | ||||
"help you make a decision about how to configure it for your use ". | "help you make a decision about how to configure it for your use ". | ||||
"case. There are no concerns specific to Phabricator which make it ". | "case. There are no concerns specific to this software which make it ". | ||||
"different from normal workloads with respect to this setting.\n\n". | "different from normal workloads with respect to this setting.\n\n". | ||||
"To adjust the setting, add something like this to your %s file (in ". | "To adjust the setting, add something like this to your %s file (in ". | ||||
"the %s section), replacing %s with an appropriate value for your ". | "the %s section), replacing %s with an appropriate value for your ". | ||||
"host and use case. Then restart %s:\n\n". | "host and use case. Then restart %s:\n\n". | ||||
"%s\n". | "%s\n". | ||||
"If you're satisfied with the current setting, you can safely ". | "If you're satisfied with the current setting, you can safely ". | ||||
"ignore this setup warning.", | "ignore this setup warning.", | ||||
$host_name, | $host_name, | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0