Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Thomas P Posted March 26, 2019 Posted March 26, 2019 Hi there, I noticed in our test environment that in contrast to all other settings in our conf_global.php file the setting for sql_utf8mb4 hast to be without tick mark. So this is wrong: $INFO['sql_utf8mb4'] = 'true'; It should be: $INFO['sql_utf8mb4'] = true; If using the first entry with the tick marks in place the Support tool within ACP states an error, that the DB is not configured correctly: Quote There are some changes we recommend that are not required: Your database is currently configured to use single-byte UTF-8 Encoding... Since our DB is configured using utf8mb4_unicode_ci I found that the conf_global setting isn't interpreted if set with ticks... Changing the setting to true without ticks and the message goes away, everything fine. Do you experience the same? How is your setting for sql_utf8mb4 set in your conf_global.php file? And last: Is this the only setting which must be set without ticks? Thanks, Thomas
opentype Posted March 26, 2019 Posted March 26, 2019 16 minutes ago, Thomas P said: Is this the only setting which must be set without ticks? 'this' is for strings only, e.g. “password ='something' ”. Values like “group = 4” or “condition = true” are not enclosed.
Thomas P Posted March 26, 2019 Author Posted March 26, 2019 Interesting, OK. So something like this is wrong and can be interpreted correctly ... or not depending on the setting: $INFO['member_group'] = '3'; (...) $INFO['use_apc'] = '0'; (...) $INFO['safe_mode'] = '0'; Thanks & Danke für den Hinweis, Thomas
bfarber Posted March 26, 2019 Posted March 26, 2019 You're getting into intricacies of PHP as a language, rather than things specific to our software. Strings must be enclosed in quotes (either single or double quotes, but it's worth noting that PHP code can be interpreted inside double quotes but not single quotes if you used a variable). Numbers (integers/floats) can be enclosed in quotes or not enclosed in quotes. Technically they shouldn't and don't need to be, however PHP is referred to as a "loosely typed language" which means that the underlying engine will convert the values as needed. 'true' and true, however, are two different things. The first is a string equal to "true" while the second is a boolean 1/0 yes/no true/false value, and should not be enclosed in quotes. (another special value is null (without quotes) which means "there is no value for this")
Thomas P Posted March 26, 2019 Author Posted March 26, 2019 Thanks for the explanation, makes sense: The entry true is not a text string. I am going to polish our config file before our upcoming upgrade accordingly. So all numbers(integers) go without single quotes, all strings (text) with single quotes, all instances of true shouldn't be read as string, but as booleans. I think the a.m. one is our only one.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.