PHP Framework Migration - From Legacy To Symfony - SMILE
PHP Framework Migration - From Legacy To Symfony - SMILE
PHP
framework
migration:
from legacy
to Symfony
How to migrate safely from a PHP legacy
application or an unmaintained PHP
Framework app to Symfony?
INTRODUCTION
Today, every business is partly or fully online. Web platforms play a key role for companies to create deeper and more
profitable relations with their customers. To remain competitive in their markets, companies set ever-increasing web
development deadline targets and quality requirements. A faster time to market is critical to business success.
However, with the accelerated technological progress witnessed in recent years, the arrival of new tools and methods,
the challenges of developing a quality web application and to deliver it on time have never been so complex.
Your customers are not interested in the issues you have with infrastructure or outdated PHP systems, they want
digital products and services that work 24/7 exactly to their needs. A slow website, security breaches or stranded
development will drive your customers away.
In addition, we will also highlight the various ways in which SensioLabs can make your migration go as smoothly as
possible. As an accessible introduction, this whitepaper will point you to all the in-depth how-to’s and documentation
needed to safely migrate to Symfony.
3 | 24
1. The PHP landscape
Originally intended to be a scripting tool by its creator, Rasmus Lerdorf in 1994, PHP soon evolved into a full-fledged
programming language to facilitate better interaction with databases and servers. Today, PHP can be used in all
major operating systems, including Windows, Mac OS, UNIX, Linux, and platform powerhouses such as WordPress,
Facebook, Amazon, Google and PayPal.
Frameworks, work
When considering frameworks, two main questions stand out:
● Why use frameworks? Providing the basic structure to build web apps, PHP frameworks help save time by
structuring code and re-using standard modules. Through the provision of pre-packaged, interoperable modules that
can be used repeatedly, businesses can leverage Rapid Application Development with more flexibility, fewer errors
and greater productivity.
● Who are frameworks for? Frameworks are for businesses or individuals that require the integration of functional
software components, both with each other and into existing ecosystems. They are invaluable for developers of all
skill levels to minimize repetitive coding, speed up web development processes, and ensure error-free coding.
So, how do people choose a framework? Selecting a framework depends on individual business requirements. Each
comes with its respective pros and cons, and picking between them depends on project needs, scalability potential
and technical prowess of those charged with implementation.
While at a glance these may appear to be valid reasons for sticking to outdated PHP, in truth it may mean your
business could stay stagnant and be at risk of missing key innovations.
5 | 24
PHP frameworks in 2021
PHP has come a long way. Now, in version 8 (as of December 2020) , the consistent release cycle has made sure that
it remains relevant in today’s digital world. With 78.9% of all websites with a server-side programming language using
PHP, it seems that it is here to stay.
2020 has been far from a typical year. The COVID-19 pandemic has changed the world as we know it, affecting more
than 190 countries and their respective economies. While the negative effects of the pandemic are clear from many
perspectives, the impact on the technological world has been substantial in surprising ways.
● COVID-19 accelerated the company digital communications strategy by a global average of 6 years. (Twilio)
● Digital adoption in Europe jumped from 81% to 95%. (McKinsey Digital)
6% of UK enterprise decision-makers believe the pandemic sped up their company’s digital transformation. (Twilio)
●9
● Almost all global companies (95%) are seeking new ways of engaging customers as a result of COVID-19. (Twilio)
● 92% of UK businesses say their organization is very or somewhat likely to expand digital communication
channels as the world reopens. (Twilio)
● Almost four in five (77%) of UK respondents say that COVID-19 increased their budget for digital
transformation. (Twilio)
● Over 70% of respondents said they expected to continue using digital services with the same frequency as they
do now, or even more often. (McKinsey Digital)
PHP offers many pre-built elements that can be reused, tweaked and scaled, so there is no need for custom software
solutions and long lead times. Through the use of PHP frameworks and the associated benefits of an open community
and active support network, even those without ample funds have a good chance to survive and thrive. For companies
using legacy PHP the migration to new frameworks is essential now.
2. Business is personal
Nobody wants to feel like a support ticket or a ‘dear x’ in an email. By demonstrating a genuine understanding of their
end-users through PHP frameworks and scripts, businesses can retain and grow their market share. What is more, 77%
of people are more likely to recommend a brand to family and friends following a positive, personalized experience.
5. UX must be exceptional
The best UX goes unseen – users only notice when something goes wrong. A laggy website or poor mobile experience
can quickly turn advocates into detractors. For instance, 57% of users won’t recommend a business with poor mobile
implementation, and 87% think that mobile experiences should match or exceed that of what is available on desktop.
By employing purpose-built PHP frameworks, UX expectations can be met without the need to create solutions from
scratch. And, with passionate communities behind their creation, these frameworks are more likely to be stable,
responsive and efficient.
7 | 24
2. The need to change your
PHP legacy now
It is likely that an overwhelming proportion of the world’s software runs on legacy code that has
been passed from developer to developer. Dealing with legacy code is an everyday reality for many,
but there comes a point where quick fixes and digital Band-Aids can only get you so far.
Together with limited functionality, the problem with legacy code is that it gets increasingly difficult to predict outcomes
when something is changed. Even the smallest tweaks can cause an unforeseen domino effect, turning a minor
problem into a much larger one.
1. Things don’t improve. Developing new features or fixing bugs is not cost-effective. Instead, you and your
end-users will just have to live with how things are.
2. There is no innovation. Instead of fixing current bugs, innovating and planning new functionality, your
developers’ time is spent on maintaining the uptime of existing code.
3. Your product or service stays behind. Increasing the scope of your offering is made difficult or impossible
due to the current solution.
4. Help is not coming. Your existing setup is too old, cross-wired or obscure to get help from the PHP community
when you need it.
5. There is no guide anymore. Documentation for the implementation, use and troubleshooting of your current
code or framework can no longer be found internally or externally.
6. New plugins don’t work. Most, if not all new plugins are not compatible with your PHP version and either
cause problems, or don’t install at all.
7. Productivity suffers. Working around annoying bugs and issues is affecting productivity and making simple
tasks unnecessarily laborious.
8. No support. Your software version is no longer supported by the original developers, meaning that when you
have issues, you’re on your own.
9. So. Slow. Performance is laggy or unresponsive, causing frustration and bad experiences for both end-users
and developers.
10. No trust in the system. You simply can’t depend on your system and are constantly worried about crashes
and freezes.
If any of these signs look familiar, you may be in dire straits and migrating to a modern framework should be on top of
your digital agenda right now. Fortunately, there are several frameworks you can successfully migrate to, one of which
being Symfony.
What is Symfony?
Symfony is an open-source PHP framework that speeds up the creation and maintenance of web applications by
eliminating repetitive coding tasks. It is used to build robust applications for enterprises and individuals, giving
developers full control over the configuration. With over 9 million daily downloads, it is one of the most widely-used
frameworks in the world.
9 | 24
Why do people use Symfony?
Symfony offers a stable work environment that is lauded for its flexibility, power, user-friendliness and active
community of over 600,000 developers in 120 countries. Completely free and open-source, Symfony allows users of
all skill ranges to create web applications based on pre-made frameworks that save time and provide quality. Symfony
also positions itself as a philosophy that promotes professionalism, best practice, standardization and interoperability
of applications.
1. It is open-source. Having been released under the MIT license, Symfony is open-source. This means that it is free
to redistribute and modify as needed, with no permissions needed.
2. There is a highly active community. With large numbers of daily comments and interactions on GitHub and other
platforms, Symfony is one of the most discussed and used frameworks in the world.
3. Encourages best practice. As it is always current, developers using Symfony can stay on top of the latest
object-oriented design patterns such as service-oriented architectures, dependency injections, interface
abstractions and more.
4. Easy to debug. With a built-in toolbar called the Web Debug Toolbar, Symfony helps developers debug
applications during development. The toolbar can also be augmented with new panels for further functionality.
5. Fast and flexible. Symfony components are quick and easy to download, with a directory structure that is easily
abstracted and decoupled. This makes it easier to implement in large projects that need flexibility.
6. Modularity. The modular structure of Symfony allows users to build applications, step by step. This also means
that they can be swapped in and out as needed.
7. Readiness. Symfony gives users a large number of applications, straight out of the box. This saves time and
provides highly stable solutions with very little time investment.
8. Excellent documentation. Each release of Symfony comes with robust and detailed documentation to help with
all matters around implementation, usage and operation.
9. Better hiring potential. Users of Symfony are in demand due to its prolific, powerful and flexible nature. The wider
community also attracts high-level programmers looking to push their skills to the next level.
10. Community-tested. Each Symfony package is tested by a large number of developers immediately after release,
resulting in significantly higher chances of bug discovery and squashing.
11. Active communication. As a highly active framework, users of Symfony are highly informed about current trends
and upcoming releases.
12. Happy end-customers. At the bottom line, it is all about serving the customer with meaningful experiences that
help improve their work and lives. With security, reliability and speed covered, Symfony ensures your
end-customers are happy with your services and digital products.
11 | 24
3. Migrating to Symfony: setting the
new horizon
At first, migrating your framework may seem daunting, but when you make the choice for Symfony,
both your business and daily work will be simplified. More than a modern PHP framework, Symfony
is also a philosophy to guide and a community to support you.
In the previous chapter, we looked over the various reasons for considering Symfony for your migration from legacy.
Now, it is time for a deep dive into the basics. How does this particular PHP framework work and what sets it apart
from other PHP frameworks?
The following four basics go into more detail on how Symfony makes web development easier.
An international community of developers, users, and companies backs up Symfony all over the world to further
develop the framework through their experience. They can add their own modules and share knowledge on Slack,
Stack Overflow, hundreds of blogs, tutorials for all levels and various forums. This leads to ongoing innovation and
a certain strive for excellence in the Symfony community. For instance, the idea for the dependency injector was
borrowed from the Java world and adapted to PHP.
When starting with Symfony, you have a wealth of learning to choose from, based on your level of understanding.
There is extensive literature devoted to Symfony, including books written by the founder of the Symfony project
himself, Fabien Potencier.
1. Full Stack (complete version): for developing a complex application that requires many functionalities.
2. Brick by brick: for building your framework according to the functionalities as needed.
3. Microframework: as a standalone, to develop only a specific functionality in one of your projects. Ideal for using
certain pieces of software building blocks, such as the dependency injector, translations management or forms
management. You can do this without having to redevelop everything and without installing the entire framework.
Symfony also takes care of unpleasant tasks such as the development of minor functionalities, instead allowing you
to focus on the actual highlights. Symfony comes with tools designed to make the developer’s life easier, such as the
Web Debug Toolbar as well as native support for development environments, native security and detailed error pages.
13 | 24
‘Symfony is for developers today and tomorrow,
because it is made for developers, by developers.’
● Every time a new development is made in an ongoing legacy project, it becomes less and less sustainable in
terms of time and costs. It is like feeding a monster that gets bigger and bigger.
● And, when your new projects follow high-quality practices, why would you also have an ongoing project where these
standards are not applied? The lack of coherence stiffens innovation and frankly, makes your work less enjoyable.
As a framework made by developers for developers, Symfony wants to make web development easy to create robust
enterprise applications that delight customers. It does this in a way that acknowledges legacy code and provides
several solutions that address key challenges by ensuring quality, performance and productivity.
The signs for the accumulation of technical debt in chapter two are all too familiar for developers working with legacy.
You’re confronted with slowness, security flaws, multiplication of bugs and a lack of guarantee on non-regression.
Your progress can be suddenly undone by hidden flaws in the coding. Because code quality is essential to sustainable
development, Symfony comes with tools to easily choose a unified, measurable and comparable metric to ensure
rigorous monitoring of a project’s overall quality.
SymfonyInsight is a SaaS tool that boots your Symfony application, inspects its containers and gives you advanced
reports on your project quality. It is aimed to detect security risks, suggest possible corrective measures and improve
quality by respecting Symfony’s development guidelines. It does so by inspecting the heart of the PHP code and
providing an in-depth diagnostic on code quality.
Based on more than 100 rules that cover maintainability, scalability and quality, SymfonyInsight can detect problems
and errors on a daily, continuous basis. This ensures the assessment of technical debt over time, improves code
quality and improves developer skills by enabling self-correction.
SymfonyInsight is a paid service that can be integrated into GitHub, GitLab or BitBucket with a few clicks. It gives
you cost estimates for correcting problems and comes with a collaborative workspace and educational tutorials to
understand and assimilate good practices. SymfonyInsight also saves valuable time by reducing proof-reading efforts
by lead developers and provides a great way to train and help onboard junior staff.
Performance is a hygiene factor required to remain competitive today, and to be able to optimize the performance
of your code, you need to be able to measure it. Blackfire is a SaaS tool designed for PHP code performance
management throughout its whole life cycle, measuring the resource consumption of the code at the level of functions/
methods calls.
With intuitive navigation through call graphs or temporal representations of resource consumption, developers get
a complete view of its behavior. They can see and understand how Wall-time, CPU time, I/O time, memory, network
calls, HTTP and SQL are used. Blackfire highlights slowdowns and helps developers to easily verify and validate the
impact of their changes at each iteration.
Blackfire seamlessly integrates into any existing toolset and process and is designed for production, but can also be
used in development, testing and staging. Developers gain speed in experimenting and validating their improvements
when using Blackfire on their machines, where they are able to test performance before going into production.
Created specifically to help developers working on Symfony, SymfonyCloud is a PaaS (Platform as a Service) that is
perfectly adapted for the infrastructure of PHP and Symfony. It is designed to automate the deployment of a complete
Symfony infrastructure, covering PHP to database, search and performance.
Getting a project up and running takes only a few seconds with SymfonyCloud. Thanks to the Git integration and
Ceph layering technology, it is possible to go from dev to staging and production and back, in a matter of minutes.
SymfonyCloud fully supports DevOps and continuous deployment and integrates SymfonyInsight and Blackfire.
SymfonyCloud can also perform complete snapshots of an application, its software infrastructure and associated
databases. With this major feature, the development team can reproduce an identical production system to provide more
reliable testing capabilities, allowing the launch of several development and test projects in parallel on the same application.
15 | 24
The integration of Git processes and its revolutionary file system makes it possible to deploy up to 7 times more often
and increase the development team’s overall productivity by 30%. At the same time, SymfonyCloud reduces overall
hosting costs by 60%.
For understanding the impact of using Symfony completely, here is how different roles may benefit:
The why for legacy migration is clear. Once you decide to replace your legacy PHP with a modern framework, the approach
comes next. The first step is to perform a code quality audit to determine the most appropriate type of migration.
If the code is burdened by heavy technical debt and if there is no active development, a direct migration from scratch is
considered to be better. However, when a temporary shutdown needs to be avoided, like with an e-commerce website,
the development of a new application while maintaining the legacy is recommended. Generally, gradual migration is
better than one-shot migrations for several reasons: issues occur gradually instead of all at once, rolling backward is a
possibility, and there is more time to improve the application with new features instead of only reproducing it.
Realizing that each legacy migration project comes with its technical debt, team, architecture, product backlog and
more, SensioLabs offers various services and solutions to meet your specific requirements.
Migration workshop
When you have an existing application built with another technology and you want to learn how to move to Symfony,
this migration workshop offers an excellent starting point. First off, it helps you to consider between a gradual
migration and the one-shot, ‘big bang’ migration. The workshop gives analysis and audit of your application, and helps
to identify and prioritize the principal components to migrate. As a result, you will learn how to design an environment
of coexistence for two apps, define your migration roadmap, evaluate costs and prevent risks.
Progressive Migration
After you make the choice for a gradual migration to Symfony, this migration service offers you step-by-step support
to execute your migration project faster and cleaner. Included are training, technical support, audit and analysis, code
review, recommendations, implementation of repository and management tools, regular team follow-ups and reporting.
As a whole, it will give your developers everything needed to improve their skills through best development practices to
make the migration a full success.
Expertise Solutions
Since every application and project is different, SensioLabs offers a selection of professional solutions and
prepackaged custom-made services that focus on the start, design, build and run phase.
17 | 24
The building blocks of success
As any CTO or business leader will tell you, success is never a clear-cut path. The road is often long, messy and
twisted, which calls for breaking down the overall vision into smaller milestones. By reaching these smaller targets,
you will be more able to hit the quick wins before reaching the ultimate goal.
Symfony provides you with all the building blocks to build your long-term success with digital experiences that your
customers will appreciate and value.
The following blocks are the foundation for success in PHP development:
Technology
Your technical architecture needs to meet the business requirements of today and tomorrow. The big challenge,
however, is that those requirements are shaped by the customer’s needs and expectations. These are evolving faster
and faster as technology adoption accelerates, which means that your reactions must be agile, instead of pe-planned.
As a result, today’s PHP frameworks must be highly flexible, time-saving, reliable and mature, easy to work with,
high-performing and above all: secure. While that may seem like a lot to ask, SensioLabs’ range of products aims
to meet all these requirements.
Open-source
Symfony The PHP framework you are reading about in this whitepaper used by approximately 12% of all the
websites worldwide, directly or indirectly.
Twig A strong and extensible, native PHP template engine used in Symfony and Silex. It improves the
readability of HTML code with less complicated syntax than standard PHP, and has a sandbox mode to
secure applications.
People
Technology today powers your business operations, the products and services it sells, and the way it interacts with
target audiences. In this digital world, software excellence fuels business performance. Which means that, more than
ever, your development team is responsible for delivering your company’s success. Empowering your developers is
what will help to set your company apart from your competitors.
SensioLabs acknowledges the leading role of the developer. In fact, Fabien Potencier, the CEO and co-founder of
SensioLabs, is a passionate developer himself. To get the most out of your development team that uses Symfony,
consider the following solutions for a proven and solid approach.
This ensures long-term application stability and maintainability and also increases the potential to produce quality
code. Additionally, the coach is able to support several projects with different development teams within the same
company, harmonizing the quality and tools used.
19 | 24
Strengthening your technical team
Finding all the skills and knowledge required for each project in-house is becoming more and more difficult, where
using external resources on short-term placements is sometimes the only way to complete the work. To meet the
needs for specific technical skills, SensioLabs selects and evaluates the best available profiles from a wide network of
partners and freelance developers.
At the same time, there is a clear need in the market to achieve technical and business success. To help ensure that
success, SensioLabs offers consultancy, expertise, services, training and technical assistance. Whether you need
advanced expertise, consulting on your project or qualified staff for implementation, SensioLabs stands by your side
to ensure that your Symfony project succeeds. Especially when dealing with legacy code and looking to migrate safely,
SensioLabs is your best ally to smoothen the migration into the future.
Development
For any major or minor version, the full development period lasts six months and is divided into two phases.
The development phase lasts four months and serves to add new features and enhance existing ones. Then, the next
two months consist of a stabilization phase in which bugs are fixed, the release is prepared and time is given for the
whole Symfony ecosystem to catch up.
Deprecated features will trigger deprecation notices at run-time that can be seen in the Web Debug Toolbar, or after
running your tests. This allows you to update your code little-by-little, ensuring your final upgrade is easy and safe.
To learn exactly how deprecations are handled in Symfony, read the conventions document here.
21 | 24
You are your customers’ success
It is the era of the customer. Cloud and AI are increasingly ubiquitous, IoT is well underway and easy UI interfaces and
optimal digital interactions are a given. The customer of today wants to feel valued and appreciated, and will not stay
around to wait for you to address your technical challenges. For matching those customer expectations, the choice for
a modern PHP framework is essential.
With technology leading the way in business innovation, the adoption of it in your organization should be high on your
agenda. Web development has never been more important, creating new challenges in finding the best architecture
choices for delivering products and services. It calls for a culture of innovation, not just a technological solution.
Once your developers can create their applications in an efficient, quick and pleasant way, you can focus on customer
needs in a whole new way. Symfony makes it easy to align web development with your business goals and create
meaningful digital experiences that set you apart from the competition.
If you’re still using legacy PHP and are ready to migrate to a modern PHP framework safely and smoothly, talk to us
about Symfony. Together we can bring digital harmony to your organization and align your company’s success to that
of your customers’.
SensioLabs University
train your teams with the creator of the Symfony Framework
university.sensiolabs.com
Contact us:
[email protected]
[email protected]
SensioLabs offers consultancy, expertise, services, training and support tailored to enhance developers’
effectiveness, to ensure the success of web application development projects and to support the creation
of a competent technical team.
SensioLabs operates in a further 20 countries through its own offices and an extensive network of more
than 50 certified and affiliated partners. A company recognized internationally for its innovations in its
market, SensioLabs boasts over 100 employees and consultants.
About Smile
Since the beginning of 2019, Smile has been a majority shareholder in SensioLabs. As a European
market leader in digital open-source with a presence in 7 countries, Smile shares the same values and
ambitions as SensioLabs.
Each year, some 1,700 committed personnel contribute to many hundreds of strategic digital projects for
large corporate clients in France and Europe, based on the most innovative solutions and concepts.
Fully proficient in the best products, components and open-source frameworks combined with an
in-depth understanding of the major business challenges, Smile offers its clients the support they require
at every stage of their digital transformation via four vertical offerings (Digital/E-business, Business Apps,
Infrastructure and Embedded/IoT) and a complete range of integrated services (consultancy, digital
agency, training, development & integration, maintenance and outsourcing).