It is very "sportan" list of PHP functions for creating API service that using MySQL as data base.
Get current PDO connection. DB settings is stored in config.php file.
$sql = 'SELECT * FROM user';
$sth = db()->prepare($sql);
if ($sth->execute()) {
$response['result'] = $sth->fetchAll();
}Get config values for specific key. Config values is stored in config.php file. For local enviroment you can use config.local.php.
$dbConfig = config('db');
$allConfigs = config();Get current path of requested URL. Eg. for URL http://localhost/index.php/api currentPath() will be api.
$path = currentPath();