Skip to content

Phase 1 work to add PDO and move settings $config to the API.

Ryan Bonham requested to merge 149_api_pdo into main

This MR is the first step in addressing #149 to remove Adodb

  • Adds PDO Extension to compose
  • Adds PDO & PDO Mysql Extenstion test to installer.
  • Setups PDO Connection in OpenRealty\API namespace
  • Moves retrieval of $config to a new SettingsApi
  • Updates Installer to write DB Settings to a ini file in the api folder.
  • Update All API Commands to accept the PDO dbh as at construction.
  • Update All API Commands to accept setings at construction.
  • Update all Open-Realty Classes to accept Settings at construction.
  • Remove all references to global $config.
  • Update all OpenRealty Classes to accept PDO dbh at construction
  • Update all API Calls to pass in PDO db and Settings.
  • Update Hooks to get passed $dbh and $config (This is done, but not correctly needs rework before merging. Should pass by class construct instead of each function.)
  • Update Addons to get passed $dbh and $config

Phase 2

  • Replace all uses of adodb in API with PDO
    • LogApi
    • BlogAPi
    • ListingApi
    • FieldsApi
    • MediaApi
    • PageApi
    • PClassApi
    • SettingsApi
    • TwitterApi
    • UserApi

Phase 3

  • Work to replace all non API calls to database with API calls.
  • Remove Adodb

Extras (Test feasibility)

  • Consolidate index.php, ajax.php, admin/index.php, admin/ajax.php, aand pingback.php into a single file..
Edited by Ryan Bonham

Merge request reports