Anyone know of a good PHP ORM that DOES NOT use PDO?

前端 未结 1 398
面向向阳花
面向向阳花 2021-01-14 06:09

I\'m building a webapp for a department on a large college campus that will eventually be run on the enterprise servers ( I use the term \'enterprise\' loosely ).

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-14 06:48

    I suppose that every modern ORM relies on PDO as it's a standard database driver.

    If you have MySQLi extension enabled then you should be able to write your own PDO (IIRC MySQLi supports everything that PDO does).

    if (extension_loaded('pdo_mysql') == false) {
        class PDO {
            protected $connection;
    
            public function __construct($dsn, $username = null, $password = null, array $driver_options = array()) {
                $this->connection = new MySQLi(...);
            }
        }
    
        class PDOStatement { ... }
        class PDOException extends RuntimeException { ... }
    }
    

    You'll have to implement whole PDO API but at least it will works.

    0 讨论(0)
提交回复
热议问题