The New Myth family: SprintPHP Bonfire Practical CodeIgniter 3

New Myth Media Blog

Serving the New Myth Media Family.

Practical CodeIgniter 3 Released

My new book about making the most of CodeIgniter 3 is out!

Over the last week I've released two additional videos covering the Forge that should help you get up to speed on how to use it to dramatically increase your productivity.

Please, remember, the Forge generators simply generate code that functions as a starting point. They are not magical CRUD, so you can still customize the output (and should!) to meet your application's specific needs, but you'll shave hours of development time off of the typical application by using these.

On April 10th, CodeIgniter 2's EOL date was set for October 31st, 2015.

I was expecting the EOL date to be a little further out, but I think it's a workable timeframe for Bonfire. Given this, and having released Bonfire 0.7.2 (also on April 10th), I am expecting to spend the time until then working on issues with CI 3 support. Pull requests and issue reports will still be welcome for all areas of Bonfire, but I only expect to have one more release of Bonfire (0.7.3) with CI 2 support. After the EOL date (October 31st, 2015), CI 2 support in Bonfire is expected to be deprecated.

After the 0.7.3 release, I will bump the version to 0.8.0 (or should it be 1.0.0? I think that version number has some implications beyond what I wish to imply, but 0.7 to 0.8 doesn't seem like enough). At that time, I will start removing those CI2 compatibility measures which have the largest impact on performance (the most obvious of which would be to enforce the CI3 filename standards). I will also switch the default $system_path to load CI3, include CI3 in the download, and remove all CI2 files except those which have been modified for use in Bonfire. So, in the next version after 0.7.3, the process for using CI2 will be similar to the current process for using CI3: filenames will have to be fixed for CI3 compatibility, CI2 will have to be downloaded separately, and the $system_path will have to be changed to point to CI2.

As Sprint and Bonfire-Next mature, the direction of Bonfire will likely move towards creating an migration path to those platforms. For now, though, my priority is to ensure that Bonfire is still available on a stable, supported base for both existing sites (including my own) and new development.

-- Mat Whitney

With the recent release of CodeIgniter v3.0, it was only a matter of time before we could announce the release of Bonfire v0.7.2. While this version includes CI v2.2.1, it also supports v3.0, even on the same installation of Bonfire (though you must modify the $system_path in public/index.php to switch CodeIgniter versions). The documentation includes full details for installing CI3 in Bonfire and configuring your Bonfire application to work with CI3.

Please note that CI3 support is in the early stages. Everything appears to be working fine, but it has not been through extensive testing, yet.

In addition to CI3 support and the v2.2.1 upgrade, we have included:

  • a number of bug fixes
  • more/improved documentation
  • a driver system for the library which converts the docs
  • minor Profiler improvements
  • updated jwerty.js to v0.3.2
  • improved offline mode
  • improved HTTPS support
  • support for using language files from the official CI translations repository

Sprint got it's first video today.

In 7 short minutes I walk you through installing Sprint using Composer, provide a brief overview of all of the folders in the default install, and get your database setup and ready to go.

The is only the first in a number of planned videos intended to help you understand the concepts behind Sprint, not step you through copy-paste tutorials that only teach you steps. I'm a firm believer in understanding the concepts behind what you're trying to learn. From there, everything gets easier and it just becomes implementation details.

Whew! Sprint went Alpha on December 12 of 2014, about 3 months ago. And today, we've officially hit Beta status! There's been a TON of work in the last 3 months to create a product that helps you really speed your development time.

There's been a lot of new docs written, including a shiny new Simple Blog Tutorial that covers a lot of the best parts of Sprint in probably 30-40 minute tutorial. There's also been a lot of work under the hood, lots of bugs squashed, and some streamlining and fine-tuning to make it even nicer to use for you.

For API Builders

One of the biggest new features are some tools to quickly build up an API Server. Now, I understand this won't fit everyone's needs, but I think it covers enough basics that you can rapidly build on it and still save tons of time.

First is the ApiController, which contains enforces numerous restrictions (like AJAX-only, HTTPS-only, rate-limiting, IP black/white listing, etc), as well as a number of convenience methods that make returning the correct status code a no-brainer, like respondCreated, respondDeleted, failResourceExists, failResourceGone, and quite a few more.

The real time-saver here, though, is a set of Forge generators that will quickly build out the basic CRUD methods for a single resource for you, including simple API Blueprint doc files.

What's Next?

Over the next 3 months we will continue to squash bugs and refine the entire package, though we are pretty much on a feature freeze until the 1.0 release.

In the meantime, we will be working on a new website, with a number of short, succint video tutorials covering different aspects of the software. We actually have a designer who has offered up their services to help us out and that's exciting!

Sprint is just the first part in a new Bonfire family, so expect some really big things over the next year or so. I've got a road-map roughed in my mind and some very exciting aspects for the future of the project in mind. So, be sure to stay tuned!

Changes Since Alpha

(In no particular order)

  • AJAX features were removed. This framework shouldn't specify any form of front end code.
  • API Server Controller and other resources to make creating an API server pretty simple. Includes HTTP Basic and Digest Authentication.
  • Forge - API Install and API Scaffolds allow you to quickly create basic resources for your API.
  • Added Kint Debug Tools
  • Simple Build System in place - used when packaging up files for release, as well as after inital install and can easily be used by you.
  • Encryption key automatically set in config file during install if using composer create-project
  • Sample Data removed add added to it's own repo
  • Moved Docs to use phpLeague's CommonMark library. You'll only notice if you're using tables.
  • All main parts of Sprint should now be localised. Note, this does not include the generators which are still English-only
  • Stayed up to date with latest changes in CI 3
  • Additional Docs, including a new Simple Blog Tutorial that covers lots of ground.
  • New environment wrapper to restrict routes to only certain environments.
  • Additional tests written, though there's still lots more to write.
  • LocalAuthentication will automatically rehash passwords if the hash_cost changes.
  • New CLI tool to test system to determine appropriate hash_cost for password generation
  • FlatAuthentication updated to include "private permissions" which means it should meet all of the requirements of a Flat RBAC system.
  • Lots of bugs stomped