leaseweblabs.com leaseweblabs.com

How to create JWT authentication with API Platform

As the title suggests, in this blog we will together create a simple JWT authentication using API Platform and LexikJWTAuthenticationBundle. And of course, also using our lovely Doctrine User Provider. Motivation There too many tutorials online about symfony with JWT, and also some about the API Platform. But most of them are too short or missing certain things, which is unhelpful. It can also be confusing for developers when the...

leaseweblabs.com leaseweblabs.com

Creating a simple REST API in PHP

I’m the author of php-crud-api and I want to share the core of the application with you. It includes routing a JSON REST request, converting it into SQL, executing it and giving a meaningful response. I tried to write the application as short as possible and came up with these 65 lines of code: <?php // get the HTTP method, path and body of the request $method = $_SERVER['REQUEST_METHOD']; $request = explode('/',...

leaseweblabs.com leaseweblabs.com

Meta-programming: automate software creation

The secret to success in the business software field is to automate the software creation process. If you do so, you gain a big advantage as you have to program or customize less software than your competition. I have identified three types of meta-programming. 1) Abstract the subject You can create software that sells “cars” that has, for instance, a table with “occasions”, containing columns for “brand” and...

leaseweblabs.com leaseweblabs.com

Limit concurrent PHP requests using Memcache

When you run a website you may want to use nginx reverse proxy to cache some of your static assets and also to limit the amount of connections per client IP to each of your applications. Some good modules for nginx are: ngx_http_limit_conn_module ngx_http_limit_req_module Many people are not running a webfarm, but they still want to protect themselves against scrapers and hackers that may slow the website (or even make it...

leaseweblabs.com leaseweblabs.com

When (not why) “Agile” and especially Scrum are terrible

This article is a response to “Why ‘Agile’ and especially Scrum are terrible” as posted on Michael O. Church’s blog. He is not so much attacking the agile manifesto, as he he is attacking the reality of “agile”, the way it portraits itself and the excesses. If you read the comments on Reddit then you find that there are two camps: scrum advocates and scrum haters. The haters complain how scrum leads to bad behavior and...

leaseweblabs.com leaseweblabs.com

Heka monolog decoder

This post is about how to use heka to give your symfony 2 application logs the care they deserve. Application logs are very important for the quality of the product or service you are offering. They help you find out what went wrong so you can explain and fix a bug that was reported recently. Or maybe to gather statistics to see how often a certain feature is used. For example how many bare metal reinstallation requests were issued...