PHP Multi-Datatabase Ideas

GarettM

Posting Freak
Aug 5, 2010
833
136
Hello i am making a Server statics script/web app

and i am gonna try to achieve multi-database extension support and here is my idea

Code:
Database/
Controller (Database Controller)
...
{$adapter/$extension.class.php}

and foreach class
PHP:
<?php
   
/**
  * Simple PHP Statics Project
  *
  * @author GarettMcCarty
  */

namespace Database;

class Base
{
    public function getFeild($feild)
    {
        // random markup function
        // this will communicate with Extender class
    }
    public function getSettings($id)
    {
        // random markup function
    }
}

// Adapter Class
// Holds Extension functions to communicate with  database
class Extender
{
    public function __construct()
    {
       
    }
    public function __destruct()
    {
       
    }
}

and the controller includes the database class and then forwards database calls to Base class

Is this a good way to achieve multi-database support? sorry if this post makes no sence
 

Users who are viewing this thread

Top