commit version 22.12.12447

This commit is contained in:
2023-01-01 22:36:12 -05:00
parent af1b03d79f
commit b948283a96
744 changed files with 620715 additions and 27381 deletions

View File

@ -0,0 +1,30 @@
<?php
/**
* @return null|PDO
*/
function weathermap_get_pdo()
{
// This is the Cacti standard settings
global $database_type, $database_default, $database_hostname, $database_username, $database_password;
global $config;
$cacti_version = $config["cacti_version"];
$host = $database_hostname;
$dbname = $database_default;
$user = $database_username;
$pass = $database_password;
$pdo = null;
try {
# MySQL with PDO_MYSQL
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}
return $pdo;
}