![]() |
How to use Database as standalone plugin - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to use Database as standalone plugin (/showthread.php?tid=62293) |
How to use Database as standalone plugin - Sasha - 06-29-2015 I would like to use CI active record functionality in my new project. Which files I need in order to make it fully functional (without the whole CI framework)? RE: How to use Database as standalone plugin - mwhitney - 06-29-2015 You're going to have to start with the database directory and either analyze the requirements or add files to fix errors as you go. Since it wasn't designed to work outside of CI, I don't know if you'll find anyone who can tell you definitively how to get it working on its own. For a start, though: - Unless you modify the scripts, BASEPATH will need to be defined to load any of the classes - You'll probably need to create replacements for show_error(), log_message(), load_class, and some of the other functions in /core/Common.php and CI's loader - DB is going to look for the config file and expect APPPATH to be defined - CI_DB_driver's display_error() method uses load_class to pull in the Lang and Exceptions classes. If you don't create replacements, you'll run into things like Lang->load() calling get_instance() to access the loader and Exceptions->show_error() looking for templates in the application errors directory. RE: How to use Database as standalone plugin - skunkbad - 06-29-2015 Although in alpha, and not a 100% conversion, I've been working on this: https://bitbucket.org/skunkbad/breakout-db It does require that you use a PSR-4 type autoloader, but some simple instructions are provided in the readme. Please, as this project is in alpha, submit issues or bug reports through the repo. *** Using Breakout DB is currently as easy as using this for your index.php: PHP Code: <?php RE: How to use Database as standalone plugin - kenjis - 06-29-2015 I've never used, but there are some. https://github.com/fengkaijia/codeigniter-database-standalone https://github.com/evolutionscript/codeigniter-database-standalone |