Software development, agile methodologies and open source projects.
Category Archive — "php"
- Creating a content-based Error Handler for Zend Expressive
The other day I was working on a Zend Expressive application I'm currently building. The application includes a REST API among other things, but it also has some endpoints which render HTML.
In one of my tests of the REST API I saw that when an error occurs (404, 405 or 500), I ...
- Project Scalability with Zend Expressive
This article was first published in Zend Developer Zone
I've been working with some different frameworks lately. One of them is Zend Expressive, and I've come to the conclusion that I don't need to choose between different frameworks; depending on the project, Expressive a...
- Dispatch REST-like requests with a single controller class in Zend Expressive
I was digging into Zend Expressive and how to use controllers that allow me to share dependencies between different routes, instead of having to use different middlewares every time.
Abdul wrote a great article on this subject that you can find here, which also became part of Ex...
- Using ServiceManager 3 lazy services to improve your PHP application performance
Performance is an important subject when a project grows.
There are some good practices that make projects more maintainable, like dependency injection, however, creating all the objects at the beginning of the request could reduce the application performance.
If some of the cr...
- Improving Zend\ServiceManager workflow with annotations
Everyone who regularly visits my blog knows that I'm an absolute fan of the Zend\ServiceManager component.
It is always my choice to deal with dependency injection in any kind of project, more now that v3 has been released, which is faster and has a better public API.
- Improve dependency injection in PHP apps with Zend Framework plugin managers
I have spoken many times at this blog about dependency injection, and how the ZF2 ServiceManager is one of the best tools to solve it.
You can read these related articles to know more:
How to properly use the Zend framework 2 service manager as a dependency injection container
- Using UUID identifiers for databases in PHP projects with Doctrine
It's well known that using autoincrement identifiers for resources in a public API is not a very good idea, since you are exposing too much information about the size of your database and your business in general.
The PHP community is recommending to better use UUIDs these days,...
- My first approach to Zend Expressive
One of the trending topics in the PHP world nowadays is the one about microframeworks. It started some years ago with Slim and Silex, but recently it has been an explossion of new microframeworks.
First, Slim's team announced the third version of its own framework, which impleme...
- Working with sub-namespaced modules in Zend Framework 2 the right way
About a year ago I wrote two articles discussing the best way to work with modules with sub-namespaces in Zend Framework 2.
Here you can find Part 1 and Part 2
The solution provided in those articles was functional, but it introduced some new problems to deal with. It happens t...
- Working with custom column types in Doctrine. Enums.
Doctrine is currently the most used ORM in PHP. It makes it very easy to work with databases in an object oriented way.
It comes with a set of built-in column types that map database types with PHP types. For example, the datetime column type, persists the value of an entity col...