Closed ARC1450 closed 2 years ago
The certificate should be optionally since no everyone is using it. There's a mistake there. But the the reason for allowing the parameters for any of the parameters is to make the function generic and allow flexibility.
If you add an = ''
I presume your PHP 8 error is removed?
No clue. I forced a downgrade back to PHP 7.4 as I wasn't in the mood for the headache of troubleshooting and there were a couple of other deprecation errors (one was for flowview and I think another was for Cacti in general). :(
I would imagine just adding "@arg $port" to this list would help since it would make "$port" mandatory. I'm no PHP wiz, though.
@arg $host - the hostname of the database server, 'localhost' if the database server is running
on this machine
@arg $user - the username to connect to the database server as
@arg $pass - the password to connect to the database server with
@arg $db_name - the name of the database to connect to
@arg $db_type - the type of database server to connect to, only 'mysql' is currently supported
@arg $retries - the number a time the server should attempt to connect before failing
@arg $db_ssl - true or false, is the database using ssl
@arg $db_ssl_key - the path to the ssl key file
@arg $db_ssl_cert - the path to the ssl cert file
@arg $db_ssl_ca - the path to the ssl ca file
That is just the documentation of the function, not the actual parameters.
This is resolved from my perspective. I'll be making a change shortly for the $database_retries
setting.
On my Cacti 1.2.17 install, when Gentoo decided to upgrade to PHP 8.0.11, I started getting a lot of these deprecation errors in my logs:
2021/10/18 10:59:15 - ERROR PHP DEPRECATED in Plugin 'syslog': Required parameter $db_ssl_ca follows optional parameter $port in file: /var/www/localhost/htdocs/cacti/plugins/syslog/database.php on line: 38
When checking database.php, $port was in fact ahead of $db_ssl_ca in the argument list.
$port also is a statically defined argument which is a little weird considering the config file for the plugin has an variable that defines the DB port.