While testing a Symfony web application in production environment (--env=prod) I encountered an odd exception which more or less was triggered with each request: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: Compile Error: require(): Failed opening required 'var/cache/prod/doctrine/orm/Proxies/__CG__some-file.php' (include_path='.:/usr/share/php7:/usr/share/php') at vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 223…
Symfony authentication redirect after each request
While testing a Symfony web application on the production environment (--env=prod) I encountered an odd situation which basically redirected me to the authentication route (/login) after each request. Here is how it goes: you pass the security authentication login which…
Converting MySQL to PostgreSQL
Although both the MySQL and PostgreSQL implement the ANSI SQL language there are some differences in their CREATE statement syntax as well as their supported data types. This makes almost impossible converting MySQL to PostgreSQL server (or vice-versa) by generating…
Use Composer without SSH access
If you have to deploy a PHP application to a remote web hosting server where you do not have access to a terminal like environment, then it seems that the only remaining deployment option is the File Transfer Protocol. You…
JavaScript chunked upload
One things you may encounter as a web developer is to write a code that uploads a file from the end-user's browser (the front-end) to the application server (back-end). If you are using PHP as a back-end scripting language then…
Automatic update for non WordPress hosted plugins
Writing a simple WordPress plugin is straightforward. All you need is a trivial PHP file with an WordPress plugin specific header. If you want to make its source code public and/or to share it with others then hosting the plugin…
Backup your WordPress site
Many of us have a web log where we share with others our thoughts, experiences or ideas. One of those CMS that aids in blog editing is the ubiquitous WordPress. It has a market share of 59% within the Content…
PHP file dependencies tree
Sometimes you have a large PHP project and you want to get its big picture (like bird's eye view). You are not interested in how many classes/functions does it have and how are they related to each other. Instead you…
Dijkstra shortest path algorithm
One of the greatest mathematicians and computer scientist we were contemporary with was Edsger W. Dijkstra. Among many of his contributions to these fields he let us a wonderful simple algorithm which helps us finding the shortest path between two…
List of distances between cities
As a programmer sometimes you need to a list of distances between cities for a predefined set of cities or any possible location around the world. Where to find such a list? How big is it? Is it available for…