DB persistent connection

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
abs123
Registered User
Posts: 2
Joined: Wed Jul 18, 2018 8:29 pm

DB persistent connection

Post by abs123 » Wed Jul 18, 2018 8:40 pm

How can I enable persistent connection to the MySQL database on my phpBB 3.2.2?

As i can see on this wiki page, there is a 'Persistance' option, but I can't find the way to make my forum using it.

I have looked for a configuration option in the administration panel and in config.php, no success finding it.

abs123
Registered User
Posts: 2
Joined: Wed Jul 18, 2018 8:29 pm

Re: DB persistent connection

Post by abs123 » Fri Jul 20, 2018 5:45 am

Why it has been moved? Isn't persistent DB connection more like a big improvement and performance feature that should be there by default, rather than just a mod?

User avatar
Ger
Recognised Extension Developer
Posts: 1741
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: DB persistent connection

Post by Ger » Fri Jul 20, 2018 7:14 am

AFAIK, persistency is never used. Some DB classes support it in their methods like you describe, but it's always called like this:

Code: Select all

				$this->dbal_connection->sql_connect(
					$this->config_php_file->get('dbhost'),
					$this->config_php_file->get('dbuser'),
					$this->config_php_file->get('dbpasswd'),
					$this->config_php_file->get('dbname'),
					$this->config_php_file->get('dbport'),
					false,
					defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
				);
Thus, hardcoded as false.

Seems like in 3.2 it has always been this way: https://github.com/phpbb/phpbb-core/com ... a69c58e861
But looking further back it seems to be changed somewhere during the early 3.0 days.

I found a little discussion about it here: viewtopic.php?f=46&t=2166689

Seems like a thought-through but rather undocumented approach.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 18 guests