Is there any tool that can analyze my PHP 5.3 source code and give me a list of things to fix to migrate to PHP 5.6? - static-analysis

I'm trying to find the safest way to go from 5.3 to 5.6 for a very large codebase. Doing everything manually will take a long time. Are there any tools that can analyze code statically and give a list of absolute minimum changes needed to go to 5.6?

Related

Convert pages from one PHP version to another PHP version

I work in a company, which has a product that runs in PHP 4.4.
Now the product is gaining importance for the company and obviously we want to port it to one of the latest PHP versions available.
In my young experience I've never had to migrate code between different versions and I wouldn't know how to go about it. How can I move?
Is it possible to use plugins to do this job?
There are thousands of files and folders to migrate.
The end result will be to have the whole project running with a version of PHP 8.
Thanks in advance for any help or advice you can provide.

How to fix when I update composer on laravel

I trying to run my laravel 5 project on laravel 8. When I am trying to update my laravel composer. I am fetching this kind of problem.
In order to have enough coverage on the updates and changes that you need you have to look at at least 2 parts.
PHP
There will be breaking changes to the languages and updates that you would need to make in order to ensure consistent behaviours across the PHP versions. The following link should have the relevant guides to help you with this.
E.g. https://www.php.net/manual/en/migration70.php
Laravel
Look at the /upgrade portion of the Laravel documentation. You should be able to find them at https://laravel.com/docs/{version}/upgrade
E.g. https://laravel.com/docs/5.1/upgrade
Given the large number of version jumps, you might want to consider re-writing the application in a fresh Laravel 9 (or latest) installation.
Best of luck!

Upgrading a laravel 5.4 project to laravel 7

Is it even worth it upgrading a laravel 5.4 project to laravel 7 which includes many packages ?
Do I have to upgrade it manually version after version or is there any tool that might help with the migration ?
Thank you for all the answers.
By upgrading one version at time, it will be easier to fix and change whats needs to be changed.
Here is how I did:
https://laravel.com/docs/5.5/upgrade
Follow the guide
Change the code
Test your code
https://laravel.com/docs/5.6/upgrade
Follow the guide
Change the code
Test your code
And so on.
Depends on the size of your project. Go to the github pages of your third party packages to check if they have updated as well. You can always change the package.
It will be a pain in the ass, but it's possible.
(Don't forget the php version.)
Good luck!

Upgrade laravel 3 to 5

I want to upgrade laravel version from 3.1 to 5.x. What steps I need to follow to do this?
Approach I found based on research is
Moving 3 to 4 first and then from 4 to 5.
Fresh installation of laravel 5 and change my code accordingly.
There is no easy way to upgrade Laravel 3 to any other Laravels. There are quite a bit bottle-necks there
1. Laravel 3 is based on Symphony2 and mostly influenced from Sphinx, on the other hand laravel4-5 is based on Symphony3.
2. Core Laravel3 is build on base level, so everything you build in your application folder builds up on top of Laravel instance, but Laravel4 and 5 are a composer package. So basically you are using these packages along with others to build your system.
3. Laravel3 has bundles and Laravel 4-5 has packages. Bundles has been deprecated quite long time ago and most of them are not being maintained anymore. Building process and structure is totally different than packages work.
and this list goes on and on.
Like I mentioned at the beginning there is easy way for it. By easy I meant running a script and everything is brand new.
From views to application, to schemas and Eloquent, many coding style and structure is changed in Laravel4. So long story short, there is no upgrade documentation for 3 to others because the only way to upgrade is rebuilding the application with new way. Even if you find a script to automate most of your code conversions, you still need to go through bundles and find right packages, add them to your composer and find old usages of them in your code to replace with new way.
The laravel docs give pretty good guides on how to upgrade (you first have to upgrade to 4, then to 5).
But since Laravel 5 is so different in every way, I wouldn't be surprised it's actually faster just to rewrite everything. At the very least it's safer and more optimized!

Laravel Download and Installation

I'm a webdeveloper and I'm starting a huge project requested by a company.
I'm trying to figure out if is best to use a PHP framework or not, and in case, which one.
I know Codeigniter, but I wanted to look around to see what's the best framework at the moment. I found out Laravel is trending at the top so I wanted to try it out.
Being used to Codeigniter I usually download the zip file with all the phps inside and start working. I'm trying to do the same with Laravel but I saw you are to download and use composer to install it.
I'm not really used to the Terminal and I wanted to ask if that's the only way of installing it or if there is a downloadable version as in Codeigniter, CakePHP, etc...
You can always download the ZIPped code directly from project's GitHub site. You can find the base application here: https://github.com/laravel/laravel - you'll find a link at the bottom of the right column. This code is what composer downloads when you use that to setup the application.
If you want to use Laravel you will have to use Composer as this is what the application uses to manage its dependencies. It's not hard, as you'll only need to run a few commands.
You can learn more about how to install and use composer in the docs: https://getcomposer.org/download/

Resources