A simple tool built to help make field arrays for use in DBForge, on CodeIgniter projects.
DBForge Tool is a NW.js based tool built to help create table arrays to be used with the database forge (dbforge)
module on CodeIgniter. In essence, it just helps you build the fields array used when creating a table.
The reason I built this tool is because some code started to become really massive on some models to me (specially when I was using more than 4 tables), so I wanted a solution that would lessen the number of lines in the code and, also, let me backup all the table layouts into files (so I could just copy/paste'em, load and rebuild the tables whenever I wanted).
Bear in mind that I'm not a great coder, and this is just a simple tool built to my own needs, so things might require some extra coding for other solutions. The source code is commented as much as possible, but I might have left some things uncommented.
Use this at your own risk! ๐ ๐ฆ
You should use the binary release or run the source code with NW.js/Node Webkit. You can just run this as a web app, but you won't be able to save the generated data in a file.
When opening the app, you're presented with this screen:
After you've generated the code, this is an example implementation of what you can do with it:
// Reading the content
$file = file_get_contents( "data.dbforge" );
// Decode the JSON into an associative array
$file = json_decode( $file, true );
By doing this, you'll have an array containing some nested arrays and values. Each array has:
- 'title': a string containing the field name;
- 'value': an associative array with the field data values;
I've written a simple Gist, containing a dummy model to exemplify how you'd use this class, you can find it here: https://gist.github.com/yuigoto/f87acc9bea12d0a1a827072f0e1bbb15
See AUTHORS.md
for more information.
This project is licensed under the MIT License
. See LICENSE.md
for more details on the subjects of the license.
ยฉ2016-2020 Fabio Y. Goto