belowaverage-org / phonebook

🔎 A fast, tag based, flat file, PHP Phone Book.
https://belowaverage.org/software/phonebook/
GNU General Public License v3.0
9 stars 1 forks source link

can you add support for mysql please ? #25

Closed yoooby closed 3 years ago

krisdb2009 commented 3 years ago

When you start the container, a database config file will be generated.

When generating a new Medoo class, you should be able to swap out the sqlite config for a config of your choice.

https://medoo.in/api/new

Keep in mind that the ./api/?db admin database config web page will no longer function. You may also need to generate the database schema yourself in MySQL.

Most of the schema is generated in this file:

https://github.com/belowaverage-org/phonebook/blob/master/api/reqs/database.run.php

<?php
if(!isset($singlePointEntry)){http_response_code(403);exit;}
/* PhoneBook database settings */
$dbConfig = array(
    \'insertLoopLimit\' => 100 //Determines how many rows can be inserted at a time before the Phone Book API will start splitting the database calls.
);
/* Database connection settings */
require_once(\'./reqs/medoo.lib.php\');
use Medoo\Medoo;
$db = new Medoo([
    \'database_type\' => \'sqlite\',
    \'database_file\' => \'../data/db/database.sqlite3\'
]);
/* Database technology specific settings */
$db->query(\'PRAGMA foreign_keys = ON;\');
?>