Symfony doesn’t need any introduction because of its renowned market values and features in the web application area. Now with the advance of technology we do have a new term with Symfony, which is Symfony Flex. But before knowing Symfony Flex, let’s discuss a little about what Symfony is?
Symfony is a blend of open source technology and a set of reusable PHP components/libraries, in short, it is everything one need to establish their online web application. And on top of everything it is free of cost, not only this, it is so flexible with its features that it almost gives a full control over the configuration: as from the directory structure of the program to foreign libraries, almost everything can be customized.
So, now the question has left behind is, if the Symfony is so versatile with its terms then why we need Symfony Flex? To answer this question, let’s have a look at what Symfony Flex actually does.
Usage of Symfony Flex and how it works:
Symfony Flex is not a new version of Symfony, but a part of Symfony Flex. It is more like a new way to manage and install Symfony applications like a tool to improve the process of Symfony Installation. Symfony Flex is made to cut the bundles and other dependencies with the capability to run for Symfony 3.3 and higher versions.
How exactly Symfony Flex works:
In technical terms Symfony Flex is a Composer plugin used to modify the commands like require, update and remove. Apart from these commands Flex “recipe” is an important part in commanding and file directions.
In Symfony it is run with composer command and Symfony Flex makes the commands more easier to proceed e.g. Symfony Flex is installing a command to execute composer require, then it makes the request to the Symfony Flex server before installing the package. In this scenario two conditions will apply.
- If there is no such file exists, then server will not return any command and installation package will follow the usual steps on Composer;
- If there will be specific package with information then Flex will Run a file called “recipe”.
- After that, the application uses this function to decide about package like, which package to install and, which one is going to be an automated one after the installation.
To remember there is: “aliases”, “bundles”, “env” and “copy-from-recipe”. Let’s discuss them in detail:
Aliases: The aliases represent packages and commands with short and easy names, which become easier to remember.
Bundles: Bundles represent about their environment like, in which environment the bundle will be enabled automatically. Symfony bundled with many other tools to help in development testing, debugging and documentation of the project.
Env: In this scenario env allows Flex to add new environment variable in the applications.
Copy-from-recipe: This option is super cool like one can easily copy files and directions into their application for further use.
These all wonderful “recipes” are commonly stored in two main public repositories, which are as: Main recipe repository and Contrib recipe repository.
Now, how one can use the Symfony Flex in new application
With the release of symfony’s “skeleton” project in new applications, the main benefit for this new “skeleton” is, Symfony Flex is already included as a dependency. So users just need to install the new Symfony Flex and run the following command.
$ composer create-project symfony/skeleton my-project
Recommended: In new applications after the release of symfony 3.3 users are recommended to use the Composer create-project command for more ease.
Now the achievements and changes occurred due to Symfony in technology:
There are many news like, due to Symfony market has changed a lot for example.
Drupal 8, phpB and other big technologies has made their components incorporate with Symfony.
Meetic the world’s most renowned dating website has used Symfony for most of their logics and implementations for backend.
Symfony has also been used in many other open source applications as Silex and Laravel as well.
Due to Symfony many giant platforms have changed their language to Symfony e.g. wiki-database video game website GiantBomb.com has converted from Django to Symfony in 2013.
I think these figures are qualified enough to give a prescribed knowledge about Symfony. And Symfony has indeed been a great platform for big projects and startups too. With their easy to remember components it’s even more easier to record and test for developers.