2017-11-30 22:06:09 +01:00
|
|
|
<?php
|
2018-07-08 22:40:03 +02:00
|
|
|
require_once '../../api/config.php';
|
2018-11-29 17:35:14 +01:00
|
|
|
require_once '../../api/vendor/autoload.php';
|
2017-11-30 22:06:09 +01:00
|
|
|
|
2018-07-06 03:58:41 +02:00
|
|
|
$mysql_host = MYSQL_HOST;
|
|
|
|
$mysql_port = defined('MYSQL_PORT') ? MYSQL_PORT : '3306';
|
|
|
|
$mysql_user = MYSQL_USER;
|
|
|
|
$mysql_password = MYSQL_PASSWORD;
|
2018-07-08 22:40:03 +02:00
|
|
|
$mysql_db = MYSQL_DATABASE;
|
2017-11-30 22:06:09 +01:00
|
|
|
|
2018-07-06 03:58:41 +02:00
|
|
|
$mysql = new mysqli($mysql_host, $mysql_user, $mysql_password, $mysql_db, $mysql_port);
|
2017-11-30 22:06:09 +01:00
|
|
|
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
2018-11-29 17:35:14 +01:00
|
|
|
|
|
|
|
use RedBeanPHP\Facade as RedBean;
|
|
|
|
RedBean::setup('mysql:host='. $mysql_host . ';port=' . $mysql_port . ';dbname=' . $mysql_db , $mysql_user, $mysql_password);
|
|
|
|
RedBean::setAutoResolve(true);
|