MGB Scaffolder Version 2.1.3 Released

Thursday, September 22, 2011 @ 8:19 pm

It’s been a few months since the last release of MBG Scaffolder as I’ve had other ongoing projects and distractions. There have been several more updates behind the scenes in this latest release to include a few bug fixes as well. One of the biggest additions to the 2.1.3 release is that internal linking between tables is now supported. This means that a record id that references a value from a separate look-up table will now show up as a link if auto-joining is enabled. This allows you to easily jump into a reference record to make changes if required. The addition of this feature caused a temporary sorting bug that has also now been fixed in this version. As usual, you can download the latest release using the link below.

Download the latest release here!

MBG Scaffolder 2.1.0 Now Available

Friday, November 26, 2010 @ 7:58 pm

Even though the last release was less than a week ago, I’ve been using MBG Scaffolder recently on another project and I discovered a few things that were lacking. The Insert Plus feature allows users to duplicate data from a record insertion and use that data to repopulate a new set of form fields. This is a very handy feature if you want to insert multiple records where the majority of the fields have the same value. But I recently found that this wasn’t enough.

My current project had me wanting the option to duplicate data for an existing record (vs. a new record). So the 2.1.0 release now includes a Record Duplication feature that makes this possible. Just click the pencil icon to modify the record you wish to duplicate and click the “copy” button at the bottom of the form. This will automatically generate a new record creation form with all the fields pre-populated with the previous record’s data.

There were also a few minor bugs that I discovered from several releases ago that have now been fixed in this latest release.

  • Fixed a bug where users were returned to page one of the results, regardless of where the original record was listed (page two or higher)
  • Fixed a bug that wouldn’t allow users to deselect all options under Advanced > SQL Field Select in order to show all fields again
  • Fixed a bug where multi-select form fields were not pre-populated after an Insert Plus or a Record Copy

Also, SQL queries are no longer displayed by default. I found this to be a bit annoying when using the utility for longer sessions since some of the queries were long and I was forced to scroll down after after update. So I set this option to disabled by default so it doesn’t display after a session reset. It can easily be re-enabled under the Options tab though if you prefer.

Download the latest release here!

MBG Scaffolder 2.0.9 Released

Tuesday, November 23, 2010 @ 11:19 pm

This is just a quick update to let everyone know that a new version of MBG Scaffolder is available for download. There are no major feature updates in this release, but there were a few languishing bugs that I felt the need to address. Some of the changes included:

End Users:

  • Datetime fields no longer auto-populate with today’s date if set to allow nulls in the database
  • Datetime fields that do not allow nulls will still auto-populate with existing data or today’s date
  • Datetime fields that do not allow nulls will require a valid date prior to form submission
  • Calendar pop-up for datetime fields now has a “clear” button so that existing dates can be removed from a field
  • Empty datetime fields that allow nulls will automatically insert a null in that field when the form is submitted
  • Read-only table parameter is now set to blank in downloadable version.
  • Prior versions contained multiple table names that may have resulted in access denied errors if local table names were the same.

Developers Only:

  • Updated build file to include help documentation and procedural guidance.
  • Updated call status file so end users will be properly notified when a new release is available.
  • Moved the features list, blocked files list and general help docs from flat files into database for speedier retrieval during builds.
  • Compiled multiple classes into a single bundled class file to help reduce file count and locate individual classes more quickly.
  • Began work on minimized code base for release that just contains just the bare essential PHP classes with no HTML added.
  • Added a function to maxify existing minified releases if end users need to make changes (not yet released).

Well that’s about it for now. Check out the latest version here. As always, please let me know if you notice any new bugs or problems with the code.

Happy CRUDding!

MBG Scaffolder: Now Offering Thumbnail Generation On-The-Fly

Monday, January 4, 2010 @ 10:37 am

This is just a quick note for all the MBG Scaffolder users.  Version 2.0.6 has just been released with a variety of bug fixes and updates.  But the most prominent feature now available is the option of generating image thumbnails during file uploads.  I had planned to add this option in at some distant point in the future.  But the upgrade happened sooner than later because I required this feature for another project I’m working on at the moment.  So as users, you can just sit back and reap the rewards!

I still have to update the help documentation and the feature list but using the thumbnail generator is pretty simple.  There’s a new option available under the Files tab now with a list of image sizes from which to select.  Currently, you can choose up to 12 different options ranging from 75×75 pixels to 1600×1200 pixels.  I guess the larger images are technically not thumbnails but you get the idea.  If nothing is selected from this list, no thumbnails are created.  Removing an uploaded file from an existing record will automatically remove any related thumbnails too, making it super simple to use this feature.

If you still don’t know what MBG Scaffolder is all about, check out the introductory post for all the details.  If you just want the latest version available, you can download it here.  Again thanks for testing and all the constructive feedback.  Every bit helps me to improve the end product.

Cheers,

Jeff @ Meta Beta Geek

PHP Best Practices: Resources for Coding Standards

Friday, January 1, 2010 @ 12:12 pm

Having worked within a variety of different programming languages, I realize that there are obvious syntactic differences from one language to the next.  By the variance is not just with syntax.  Standards for variable and function declaration differ quite a bit as well.  Even within a single language, opinions vary as to which standards are considered best practice.  Since I have every intention of releasing my code to the open source community, I’d like to develop a standard coding format that conforms as much to the normal standards as possible.

My second official release is a PHP-MySQL scaffolding utility known as MBG Scaffolder.  The downloadable version of this software consists of a single file where all comments and excess white space have been removed.  This assists end-users because the download size is smaller and the utility takes less time to load when in use.  The obvious disadvantage to this format is that it’s not entirely user-friendly and certainly doesn’t lend itself to future development by outside programmers.  So the next step in this process is to release a non-minified version of the code with white space and full comments intact.

The current MBG Scaffolder package does include end-user help documentation.  These docs are designed to assist users with learning the ins and outs of the web interface only.  End users are typically not concerned with how back-end code works, only that it does so without errors.  But the current release of this package is decidedly lacking in useable developer documentation.  I hope to remedy this in future releases to make it easier for other developers to utilize this package and even recommend changes to help grow and improve the code base.

With that in mind, I’m interested to know if there’s a single resource available (hard copy or online), that outlines universal coding standards for PHP developers.  I’m putting this out to the rest of the development community in hopes of getting some useful feedback.  My specific focus at the moment is on comments within my code since I’m trying to assist developers as much as possible.  From my brief research, it seems that many developers follow the JavaDocs example for commenting.  But is the norm for the majority of developers?  If not, what are some other recommended styles for commenting within PHP?

UPDATE:

In my brief research I came across several good resources that may assist other PHP developers out there.  On the PHP.net site, under the Pear Manual, there is a great document that outlines sample comments that they recommend for all PHP code.  As I noted previously, these standards are based on JavaDocs standards with only a few exceptions.  I discovered another well-versed set of standards written by Fredrik Kristiansen of DB MediaLab in Norway.  His version appears to be a PHP-based translation of standards based on Todd Hoff’s C++ coding standards.  Another possible resource for developers is the standards written for working within the Zend PHP framework.  However, these docs appear to be somewhat Zend-specific and are a bit more stringent in what is and is not considered acceptable.  But as a loose guide it might prove useful.

Sticking with the first resource under the Pear manual, PHP offers a piece of software that will automatically parse your source code and effectively output a working manual based on the comments within the code.  The format for comments must comply with pre-established standards though so this won’t work with just any code.  The software is known as phpDocumentor and is available for free to any developers who wish to use it.  There are probably other good resources for coding practices to be found.  These are just a few of the ones I discovered that seemed to conform to the standards I’ve seen in the past.  Feel free to leave feedback on other good resources if you know of any others.

Category PHP | Comments (0)

MBG Scaffolder: Everything You’ve Ever Wanted in a PHP Scaffolding Package

Friday, December 18, 2009 @ 8:29 am

stag-scaffoldingThe MBG Scaffolder package is an open source PHP scaffolding utility designed and modeled (loosely) after the Ruby On Rails scaffolding concept.  Born out of necessity, MBG Scaffolder provided a front-end web interface for quickly manipulating data within MySQL databases.  The first iteration covered the basics, allowing record creation, retrieval, updating and deletion.  It also allowed for automatic table joins using referential rules within the database.  But it was still pretty limited.

About a month ago, MBG Scaffolder underwent a major revamp, gaining a whole lot of additional features in the process.  Effectively reborn, the second iteration of this package exists entirely in a single, mini-fied file of less than 200 kilobytes.  Using MBG Scaffolder is as easy as placing the file in any web-accessible directory and loading the page from a web browser.  The package is written using PHP and Javascript so the web server must have built-in support for PHP (version 5.x or higher) and the client must have Javascript enabled.  Other than that, there are virtually no other dependencies.

For those who are new to the MBG Scaffolder package, consider the following:

Have you ever wanted to join a field containing comma-separated values (record ids) to the records that correspond to those values in a lookup table?  Known as a CSV field type, the option to join lookup tables with comma-separated values is now available, but only using MBG Scaffolder.  Want the ability to control input based on a pre-established list of values from an Enum field type?   New drop list options for all lookup tables, as well as Enum and Set field types are now available, providing users with a friendly list of pre-validated options.  Need to test database performance on a large scale but lack the necessary data?  The new Bulk Insert feature gives developers the ability to insert anywhere from 5 to 10,000 random and data-type specific records in mere seconds.  Tired of filling out the same form field information for dozens of records?  Using the MBG Scaffolder’s Insert Plus One option means you only fill the form out one time for as many records as you need.  Check out the complete list of new features (below) for more details.

In case you missed it, the MBG Scaffolder package also includes built-in help documentation.  I tried to make using the class as intuitive as possible, but I also realize that there may be questions regarding specific features.  If you run into any problems, feel free to leave me feedback using the Comment form, or check for answers within the help docs themselves.  And don’t forget that a good number of the front-end features, such as field labels, buttons, and even some of the more commonly seen errors, offer built-in help links to assist users in getting started.  So if you’re dumbstruck by a particular feature, try looking for a helpful link nearby.

The MBG Scaffolder package is now fully available for download here.  You can also test out a live demo of the most recent version using the credentials that follow.  Tables without a primary or unique key are now fully accessible in a read-only format.  The Blogs and Comments tables are fully modifiable so feel free to add, update and remove records.  The Bulk Insert feature makes it really easy to add records back in for testing.  The remaining tables are locked down since they are the referential tables used to feed the primary tables.  Also, just for the record, I’m not trying to recreate PHPMyAdmin so there are currently no plans for database structure (tables, fields, etc) manipulation at the moment.  This tool is designed strictly with CRUD in mind.

The demo requires the following info:

Server: scaffold
Username: scaffold
Password: scaffold

The server name field supports fully-qualified domain names, so you can conceivably connect up with any DNS-registered MySQL server and play around.  Just be aware that there is no SSL or SSH option yet.  So it works similar to PHPMyAdmin in that respect (credentials are passed unencrypted).  I hope to add an option for SSH some time in the future but this will increase the file footprint dramatically so it’s on hold for now.  Also, the regular expression matching for SQL terms in both queries and records is still in need of tweaking but I’m getting there.  Most everything else should be relatively bug-free.  Please let me know if you come across any issues or have any suggestions for features, etc.

Active Record Highlighting Visually identifies the last record modified by a user
API Interface Easy class instantiation makes for quick access to all public variables and functions
Auto-Generated Form Fields Builds complete entry forms based on database specifications and field types
Auto-Generated Select Lists Converts all reference tables, enums, sets, and boolean field types to user-friendly drop lists
Auto-Join Disabler Provides users with the ability to enable / disable individual auto-join policies based on field type
Bulk-Insert Option Allows developers to test database or front-end performance using randomly generated type-consistent values
Client-Side Validation Enforces data type matching and non-null field types - alerts and highlights any form fields with errors
Controlled Access Uses built-in MySQL permissions to control access to databases and tables
CSV Field Type Support Provides users with the ability to automatically join a character field with comma-separated-values to corresponding records within a lookup table
Data Exporting Capture all records from a table based on specific query criteria and save them to a Microsoft Excel spreadsheet for further analysis.
Data Type Matching Ensures that values entered are correct based on the field type selected
Date Time Calendar Eliminates formatting errors during date time field insertion and modification
Error Reporting Tracks and reports on any internal object errors as well as MySQL errors and warnings
Extensive Field Types Supports bigint, bit, bool, boolean, char, datetime, decimal, double, enum, float, int, longtext, mediumint, numeric, set, smallint, text, timestamp, tinyint, tinytext, and varchar
File Upload Support Allows users to upload one or more files within a single database table while capturing all the standard file data such as path, name, type, size, and file extension.
Flexible and Intuitive Works "auto-magically" out-of-the-box with most standard MySQL configurations.
Friendly GUI Simple 3-tab interface makes option selection quick and easy
Full Paging and Sorting Allows users to more easily work within larger tables and find the records they need
Help Docs Helpful documentation is automatically compiled into the tool to help acclimate new users
HTML Tag Stripper Allows or denies HTML tag support within field values during record inserts and updates
Individual Field Selection Gives users the ability to individually select one or more specific fields from a table
Javascript Independent Minimal Javascript requirements means no dependency on additional Javascript frameworks or libraries
Location Independent Capable of accessing any local MySQL server with "localhost" or any remote server with a fully qualified domain name
Minimized Data Option Enforces min/max row height in record display to assist users in accessing individual records and data
Multi-Referential Lookup Support Allows multiple fields within a primary table to point to the same lookup table
No AJAX Complications Relies on standard HTML form submissions to reduce complexity and file footprint required
Query Generator Dynamic SQL queries based on user selections
Query Viewer Allows users to view the final SQL output
Record Duplication Duplicate an existing record in mere seconds using this feature.
Record Row Resizer Allows users to expand or contract records displayed through the web interface to more easily view the data within.
Records Per Page Option Allows users to select anywhere from 10 to 100 records at a time
Server-Side Validation Provides a fall-back with default null, blank or numeric values, in the event of client-side validation failure
Single File Format Releasable version is compiled and minified to reduce file size and make for easy deployment
Small Footprint Total disk space usage of less than 150 kilobytes
Software Update Notification Automatically checks for the latest version of the software and notifies developers when a newer version is available
Syntax Highlighting Color-coded SQL syntax makes it easier to distinguish reserved words within queries and field data
Table and Field List Generator Automatically provides users with a list of available resources on the server based on database permissions
User-Friendly Labels Converts upper case, lower case, camel case and underscores to human readable headers and select options
Where Clause Generator Allows users to specify an unlimited number of SQL query conditions using pre-validated values for all lookup tables, enum, set and datetime field types