Circuit MakerFast, intuitive, standardized code generation |
![]() Download |
![]() FSQ Standard |
![]() Installation |
![]() Demo |
![]() Contact |
m_user_select.all does exactly what it sounds like. So does m_user_delete.byIdDownload
SVN Repository:http://sha.nnoncarey.com/svn/circuitmaker/
Latest two code revisions in zipped form:
circuitmaker-rev-42.zip
circuitmaker-rev-42.tar.gz
circuitmaker-rev-41.zip
circuitmaker-rev-41.tar.gz
Installation
- Required: PHP 4* or 5, and a fresh PHP Fusebox 5* application with accompanying database.
- Download the latest version and unzip the files to a new folder on the server which runs your new Fusebox site, or (if you use SVN) add trunk as a svn:externals property to a subdirectory of your application. Until you learn more you should use Circuit Maker on a new project, because it will overwrite pre-existing files!
- Give PHP write access to your application's directory, so that circuit and fuseaction template files can be generated.
- Copy "includes/ORIGINALconfig.inc.php" and rename it to "config.inc.php", and then customize the constants contained therein. Correct configuration is important, but if you configure something wrong the first time you can always correct it and regenerate your circuit to overwrite the bad files.
Usage
We encourage you to check out the demo or run the Selenium Tests on it. You can view the output of the Circuit Maker demo on the demo Fusebox site. It has a database set up, but the only table in the database is called "meow".
Next, visit your newly extracted and configured Circuit Maker with your web browser. Circuit Maker generates an MVC trio for one database table at a time, so you will need to provide the name of the table. We suggest your table names be singular. Circuit Maker assumes the primary key of your table is tablename_id. In addition it assumes that the results of queries to the database are returned in an row-number (integer) indexed array of column-name (string) indexed arrays. In other words, in an array like $result[3]['user_name'] Follow the hints on the screen to fill out the fields, and make sure that the output folder is pointed to the root of your Fusebox application. You have the option of generating all CRUD fuseactions for the table: list, add, edit, and remove. In addition, you can choose to generate only the model (without the control and view) for each of the CRUD functions: select, insert, update, and delete. This is useful if the table will never be edited by the user, but you still need the model fuseactions for use inside the application.
Finally, submit the form. Circuitmaker will generate several files (depending upon the options you chose) and display the results. Please note that pre-existing files will be overwritten, so be careful! Copy and paste the generated fusebox.xml code into your application's fusebox.xml so that your newly generated circuits will show up.
If your Fusebox site and database is running and everything is configured properly then some features, such as list and delete, work immediately. Other features, such as the create/edit form, require your attention before they can function.
What Now?
This tool has come a long way since we put our hands on it back in February of 2007. Since then, Roy Kolak and I have rewritten most of it, adding MVC support, object oriented code, templates of common CRUD screens, and support for the Fusebox Smart Query standard that we developed. We also had to add an abstraction layer for the incompatible DOM XML and DOM libraries that PHP 4 and 5 (respectively) use.
Next, we plan to improve the forms generated off the database tables by using PHP Form Generator.
If you use Fusebox 4, hope is not lost! The only difference is that Fusebox 5 changed the $myFusebox into an object instead of an array. Until I create a better solution, all you need to do is edit the generated m_select postfuseaction or change the relevant commented lines in Circuit Maker's actProcessRequest.php (search for "myFusebox").
If you would like to help out or provide feedback, contact us at circuitmaker-dev|nnoncarey.com (replace bar with @). For example, we would like someone to double check whether it still works in PHP4. It was started on PHP4, but the DOM abstraction was coded in a PHP5 environment, so we could really use some volunteer testing!




