use Knp\Provider\ConsoleServiceProvider; $app->register(new ConsoleServiceProvider(), array( ‘console.name’ => ‘ConsoleApp’, ‘console.version’ => ‘1.0.0’, ‘console.project_directory’ => __DIR__ . ‘/..’ )); Good writeup and code by Ken, a former student of mine. Using ConsoleServiceProvider with Silex → Want to start developing with Silex? Then check out my freely available course materials on the subject.
Tag Archives: php
Run a PHP script as a service/daemon using start-stop-daemon
In a recent project I needed to permanently run a PHP CLI script; it needed to run as a service/daemon. A few Google search coupons later I got my answer: use start-stop-daemon to make it work. To not manually type in those lengthy commands it’s possible to wrap these in a handy little script, as …
Continue reading “Run a PHP script as a service/daemon using start-stop-daemon”
PHP is meant to die
PHP is meant to die. It doesn’t mean that it will disappear into nothingness, it just means that your PHP code can’t run forever; The core PHP feature follows the most simple programming workflow: get input data, process it, display the output, and die. … If you want to keep [PHP] processes running forever they …
PuPHPet – A simple GUI to set up virtual machines for PHP development
WordPress < 3.6.1 PHP Object Injection
WordPress 3.6.1 contains a PHP Object Injection Vulnerability Fix, detected by one of my former students. He also made an extensive writeup about it: Let’s recap: maybe_serialized(‘i:1;<funkycharacterhere>’) is inserted to the database. As WordPress does not see this as a serialized string (because it doesn’t end in ; or }), this will result in i:1;. …
bramus/router Updates
It’s been 4 months since I released bramus/router, the lightweight and object oriented PHP Router I wrote. Since then a few new features worth mentioning were added. Subrouting Support It’s now possible to mount several routes onto a base route. Think of creating a /movies route on which you attach a callable which in its …
lessphp
LESS Compiler written in PHP. Usage is simple: <?php require “lessc.inc.php”; $less = new lessc; echo $less->compile(“.block { padding: 3 + 4px }”); Of course one can take files as input too (define a 2nd argument to cache on disk): <?php echo $less->compileFile(“input.less”); Also ships with an extra shell executable script plessc $ plessc input.less …
PHP PaaS
Great to see that Google App Engine and Engine Yard now both support PHP (v5.4) on their cloud platforms too. GAE could use some more loaded extensions, but it’s a good start. Google App Engine for PHP →Google App Engine: PHP: Getting Started →Google App Engine: PHP: Detailed Documentation → Google App Engine for PHP …
bramus/router — A lightweight and simple object oriented PHP Router
For one of the courses I teach I was in need of a PHP Router. Having explored the available routers out there I found they either were: Outdated Not object oriented(sorry Klein (which has been updated by now, but wasn’t at the time)) Rather bad at the separation of concerns(sorry Ham & Klein; a router …
Continue reading “bramus/router — A lightweight and simple object oriented PHP Router”
Silex Code Fiddles/Examples
For the course Webscripting2 I’m lecturing at ikdoeict.be/KaHo Sint-Lieven, we’re working with Silex. Next to the slidedeck explaining Silex, all examples are freely available on GitHub (links at the bottom of this post) The collection of examples start with the very basics of Silex and introduce more routing options and services as they continue. Basic:The …