@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

setup warning for mysql with default boolean syntax

Summary: Ref: T6747 add a setup warning if mysql is configured with the default boolean syntax

Test Plan: Run setup checks with default mysql config and then add the desired config option, restart and check again.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Maniphest Tasks: T6747

Differential Revision: https://secure.phabricator.com/D11030

authored by

Fabian Stelzer and committed by
epriestley
853ce5e9 340373f7

+35
+35
src/applications/config/check/PhabricatorSetupCheckMySQL.php
··· 226 226 } 227 227 } 228 228 229 + $bool_syntax = self::loadRawConfigValue('ft_boolean_syntax'); 230 + if ($bool_syntax != ' |-><()~*:""&^') { 231 + if (!PhabricatorDefaultSearchEngineSelector::shouldUseElasticSearch()) { 232 + 233 + $summary = pht( 234 + 'MySQL is configured to search on fulltext indexes using "OR" by '. 235 + 'default. Using "AND" is usually the desired behaviour.'); 236 + 237 + $message = pht( 238 + "Your MySQL instance is configured to use the default Boolean ". 239 + "search syntax when using fulltext indexes. This means searching ". 240 + "for 'search words' will yield the query 'search OR words' ". 241 + "instead of the desired 'search AND words'.\n\n". 242 + "This might produce unexpected search results. \n\n". 243 + "You can change this setting to a more sensible default. ". 244 + "Alternatively, you can ignore this warning if ". 245 + "using 'OR' is the desired behaviour. If you later plan ". 246 + "to configure ElasticSearch, you can also ignore this warning: ". 247 + "only MySQL fulltext search is affected.\n\n". 248 + "To change this setting, add this to your %s file ". 249 + "(in the %s section) and then restart %s:\n\n". 250 + "%s\n", 251 + phutil_tag('tt', array(), 'my.cnf'), 252 + phutil_tag('tt', array(), '[mysqld]'), 253 + phutil_tag('tt', array(), 'mysqld'), 254 + phutil_tag('pre', array(), 'ft_boolean_syntax=\' |-><()~*:""&^\'')); 255 + 256 + $this->newIssue('mysql.ft_boolean_syntax') 257 + ->setName(pht('MySQL is Using the Default Boolean Syntax')) 258 + ->setSummary($summary) 259 + ->setMessage($message) 260 + ->addMySQLConfig('ft_boolean_syntax'); 261 + } 262 + } 263 + 229 264 $innodb_pool = self::loadRawConfigValue('innodb_buffer_pool_size'); 230 265 $innodb_bytes = phutil_parse_bytes($innodb_pool); 231 266 $innodb_readable = phutil_format_bytes($innodb_bytes);