Call to undefined method registery::getInstance() opencart 3 installation issue
Closed this issue · 3 comments
Fatal error: Call to undefined method Registry::getInstance() in C:\Program Files (x86)\Ampps\www\common\carpet\system\library\db\QueryBuilder\Query.php on line 22
for moving on I have converted the static function table to non static
system/library/db.php
public function table($table) {return new db\QueryBuilder\Query($table,$this->db);}
I have changed the constructor in
system/library/db/QueryBuilder/Query.php
public function __construct($table,$db) {
$this->driver = $db;
$table = $this->addTable($table);
$this->setTable($table);
}
And using this with the instance $this->db instead of static call DB::
seems to work on opencart 3 for me
I believe the static use is unnecessary when we have $this->db already instantiated and available across controllers
Hello. Sorry for my late reaction, was super busy last month. I'm planning to make some updates for this query builder soon, make some enhancements and fixes. This issue also would be fixed. Thanks for you feedback!
Fixed it, there are few changes about installation, don't forget to check out readme.