Developers Club geek daily blog

Symfony2 Voters and Doctrine Filters on guards of safety

1 year, 3 months ago
Everything began when I customized a security system of one CRM. As it often happens, in it there were users with the different permission access levels to a specification (we will call them entities). They had an identical type of the main grid, customizability of access to entities was necessary. At first I thought of ACL, but …

Read more »

We implement Bootstrap 3 Datepicker in SonataAdminBundle

1 year, 3 months ago
In this small note I will tell about how to connect convenient datepicker in Symfony adminka. By default datepicker in SonataAdminBundle looks so:

And we will turn it into convenient and beautiful kontrola:

Those who else suffer with inconvenient datepicker-ohm, welcome under kat.

There is a ready solution, dmkuznetsov thanks

Read more »

Symfony2 multi-factor authorization by means of the certificate

1 year, 4 months ago
It will be a question of Symfony2-CertAuthBundle — the bandl for a popular freymork of Symfony2 which allows to implement easily two-factor authentication on the basis of x509 of certificates of clients.

Sometimes basic authentication in the form of a form of login has not enough reliably to defend the project.

Someone can spot, prosnifit, by any other method to get login the password, well or just to crack the website and to get access to all uchetka.

For those who consider that its project needs safer method of protection welcome under kat.

Read more »


1 year, 5 months ago
With approach of Web 3.0 approaches of API first and Linked Data begin to be used more and more actively (or something like Sematic Web). In this regard readers are offered to get acquainted with a framework for convenient creation of API based on schemes of the answers collected on with generation in the form of JSON-LD,

It is the shortened version of the tutorial Api-platform

Read more »

Hexagonal architecture

1 year, 5 months ago
On recent Laracon NYC I read the paper on hexagonal architecture. In spite of the fact that I received positive reaction of listeners, it seems to me that there were people who would like to gain a little more complete idea of what is it. Certainly, with examples. It is my attempt to expand that report.

  1. Video from the report
  2. Slides

In my opinion, this architecture is an excellent example of how the structure of the application has to be created. Moreover, when I wrote the projects on Laravel, I, even without knowing it, quite often used the ideas mortgaged at the heart of hexagonal architecture.

Being one of options puff architecture, hexagonal means separation of the application into the separate conceptual layers having a different zone of responsibility and also regulates how they are connected with each other. Dealing with this type of architecture, we can also understand as, why, and why at an application programming interfaces are used.

Hexagonal architecture, not new development approach using frameworks. On the contrary, it only generalization "the best the practician" — the practician new and old. I enveloped these words in quotes that people did not perceive them absolutely literally. The best practicians who work for me can not work for you — everything depends on a task and the pursued purposes.

This type of architecture adheres to classical ideas with which developers at application design come up: separation of an application code from a framework. Let our application form in itself, but not based on a framework, using the last only as the tool for a solution of some tasks of our application.

Read more »

Puli: Resource management in php applications

1 year, 5 months ago
imagePuli — is the tool allowing to manage universally resources in php applications. The main goal of the project — to standardize such concepts as bundle, plugin, module for different libraries and fraymvorok in one common independent decision.

What's the problem?

Sometimes, you perhaps received the file, using constant __ DIR __:

echo file_get_contents(__DIR__.'/../../res/views/index.html.twig');

Read more »

Silex skeleton + Gulp + LiveReload

1 year, 5 months ago

Hello all! Probably, all heard about remarkable framework of Silex, and some, and me including, it already has managed to be fallen in love. The main highlight of microframeworks in their simplicity. Has downloaded, has configured and it is possible to work. Also it would be absolutely good to have certain preparation which would be started "on time - two", in couple of teams to get rid of the repeating actions, thereby saving the time. Plus to everything, it would be absolutely good, to have onboard Gulp and Bower from NodeJS. It is thought — it is made. It is interesting to whom to look that at me it has turned out, welcome under kat …

Read more »

PHP and realpath_cache

1 year, 6 months ago
From the translator: dealing the other day with error, the arisen ambassador deploya service, has encountered this remarkable article about the mechanism of caching of the file statuses in PHP. I offer community transfer.

Whether you heard about PHP-functions realpath_cache_get() and realpath_cache_size()? And can be about parameters realpath_cache_size and realpath_cache_ttl in php.ini?

Cache realpath — quite important PHP mechanism which needs to be meant. Especially, when it is necessary to work with symbolical links, for example, at warm the project. Setup of caching of realpath can influence considerably high-speed performance of the server and loading on disk server subsystems. This parameter has been entered in version 5.1 when the first PHP-frameworks have started appearing.

Further we will understand as all this works under cowl and as with it to live. Under cat there are a lot of links to source codes.

Read more »

Asynchronous execution of PHP script on subprocesses

1 year, 6 months ago

Good afternoon, respected to the habrovchena.

Today I would like to talk about such nontrivial things as asynchronous (parallel) calculations in the PHP language.
PHP in itself — is scripting language which never and did not apply for multithreading. But the farther in the wood, especially serious problems face developers, and the more it is necessary "to be perverted" with pykhy because many companies simply are afraid to migrate on the programming language which was more adapted for these tasks and do not want. Therefore, it is necessary to work with that give.
Details under cat …

Read more »

Unevident problems with high-speed performance in Doctrine connected with hydration of objects

1 year, 8 months ago
Recently I have implemented the API functions in the project with Symfony2 backend, ispolzushchy Doctrine as ORM.

And, as it sometimes happens, exercise speed not quite suited me. On simple request the answer was generated already 7,2 sec.

The first assumption, some heavy requests somewhere are started. But through profayler it is not visible anything of that kind that could
to suggest idea of where the problem has disappeared. There is a bit too much SQL queries, but all fast, and their general runtime of only 223 milliseconds.

Read more »