All pages in tagged with #Silex

Using Symfony Console with Silex

Integrating console tools into your Silex project.

Tuesday Jul 1, 2014 — 3 minute read — 632 words

The Symonfy console component is a powerful, effective way to define and organize you’re project’s command line PHP scripts. Thankfully it’s quite easy to get it up and running. Installing the Provider It’s easy to install and register the console provider using the knplabs/console-service-provider package. Just this to your composer.json file: "require": { "knplabs/console-service-provider": "dev-master" } You can register the provider with the following lines of code. Obviously, you’ll need to update the, console.version, and console.project_director to match the appropriate values.

Read More

Testing with Silex and PHPUnit

Getting started with unit testing using PHPUnit in your Silex project.

Monday Jun 30, 2014 — 2 minute read — 370 words

This took a bit to figure out, so I’m posting it here in hopes it may be helpful. I use the Silex microframework a lot, and love it. Setting up testing, though, can be a bit tricky if you don’t know what to look for. First off, the docs on the Silex site are great. They will definitely get you started, but they seem to be missing a couple of critical explanations that may trip you up.

Read More