[Solved] How to implement Medoo in Codeigniter v.3


As the Medoo php file is namespaced, uses use statements, and contains another class Raw you cannot load it as a library (at least not until CI4 rolls out). It would probably be the easiest to just require the file as necessary or to use composer to autoload it (which CI supports).

Otherwise you could just create a MY_Controller in application/core and require it at the top of the file e.g.:

require(APPPATH . 'third_party/Medoo.php');

class MY_Controller extends CI_Controller {


}

and then any controllers that need it should extend MY_Controller.


Alternatively, you can follow my answer here (technique to load namespaced libraries): How do I include the OOP “defiant randomdotorg” library in codeigniter?

1

solved How to implement Medoo in Codeigniter v.3