React-PHP-V8Js

// the library $react_source = file_get_contents(‘/path/to/build/react.js’); // all custom code concatenated $app_source = file_get_contents(‘/path/to/custom/components.js’); $rjs = new ReactJS($react_source, $app_source); $rjs->setComponent(‘MyComponent’, array( ‘any’: 1, ‘props’: 2)); /// … // print rendered markup echo ‘<div id="here">’ . $rjs->getMarkup() . ‘</div>’; React-PHP-V8Js is an experimental library that uses the power of Facebook’s React library to render UI components […]

Using ConsoleServiceProvider with Silex

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.

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 […]

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 […]