Migrate Symfoy 2.0.15 app to newest release, the right way - php

I have a project (developed by others) running on Symfony 2.0.15 and I need to upgrade it to newest Symfony2 version cause I need to add some new code and it's been hard to get it done. I can't find enough information for this, can any give me some links or experiences around migration process? Will be fine to migrate directly from that version to 2.6.6 (stable) or 2.7 (beta)? What would you do and how?

You can add version 2.7 replace with 2.0.15 into composer.json. Then run the command php composer.phar install.
then your project will be upgraded to 2.7.
This link will be helpful for you
http://symfony.com/doc/current/cookbook/upgrading.html

Related

Cannot create a user in Voyager (laravel 6.x)

I've installed the admin package Voyager (without dummy data) on my Laravel project and when I want to create a user to access the admin panel with the following command: php artisan voyager:admin admin#admin.com --create, I get the following error:
After a little bit of searching, I found this link: https://github.com/the-control-group/voyager/issues/5082 => saying that this command does not work with PHP 7.4 and to make it work, I should either upgrade to PHP 7.4.1 or downgrade to PHP 7.3.
I'm using Wamp Server and decided to downgrade to PHP 7.3.12 since this version exists by default in C:\wamp64\bin\php
I have also edited composer.lock and composer.json in my project and then ran the command composer dump-autoload. But it still doesn't work. Am I missing something?
Had the same issue, upgraded to php 7.4.27 and it worked.

Yii2 composer upgrade not adding/updating files in project root?

I had an old Yii2 project that was built 2+ years ago on version 2.0.12, then left idle since around this time. Today I wanted to re-awaken this project and update it to the latest version
of Yii2 and all dependencies.
Reading the Upgrade notes here I saw that the following command will get me to the latest stable version:
composer require "yiisoft/yii2:~2.0.38" --update-with-dependencies
After this command succeeded I confirmed by running ./yii command in the project root that I am now on 2.0.38, however there are a few things missing. The main README.md remains the same as in version 2.0.12 and there are some files present in a clean build of 2.0.38 that remain missing from the root, e.g. Vagrantfile and docker-compose.yml.
Is there an undocumented step I am missing here to do this cleanly? Surely it's not down to manual intervention to go find/add these missing elements to fully upgrade?

Twig_Error_Runtime ; the "core" extension is not enabled ; symfony

I've inherited a Symfony/PHP web app codebase with zero documentation. I'm a nodejs dev so you can image the fun...! Anyway I'm getting there, my focus atm is to be able to run the project locally.
Here's the Symfony version:
Symfony version 2.7.16 - app/dev/debug
I've installed packages via composer install.
I can start the web app locally via CLI:
php app/console server:run
Server running on http://127.0.0.1:8000
Quit the server with CONTROL-C.
However when I try to access this URL I'm seeing the following error in browser. Have google'd around but couldn't work it out so am hoping someone here can point me in the right direction.
I think this is due to trying to run a new version of twig on an old version of Symfony
as you can see here: https://github.com/symfony/symfony/issues/20284
They mention something similar, perhaps try to include an older version of twig in composer?
composer require twig/twig 1.23

Installing Laravel 4.1 with Laravel Installer

I'm trying to install Laravel 4.1 using the Laravel installer but the docs isn't very descriptive.
Can someone please give a step by step guide on how to do this? I'm completely new to Laravel and PHP frameworks as a whole.
I'm on a Windows 7 machine running WAMP 2.2.
This information/answer isn't quite up to date anymore. The instructions here will install the latest version which is no longer 4.1. For those still wanting to install Laravel 4.1 (despite 4.2+ being out), use the following command.
composer create-project laravel/laravel project_name 4.1
You could replace the 4.1 with 4.0 or 4.2 depending on your situation.
Laravel 4.1 is handy if you aren't in control of your PHP version and you're stuck back on 5.3.7
Laravel 4.2 requires PHP 5.4.
When upgrading a project to a newer version of Laravel, be sure to review the release notes
Installing Laravel means simply downloading Laravel Application bootstrap, which has to be placed in your project directory. That application has a composer.json file, which will, after you run composer install command, download all necessary dependencies (including core framework).
That is one way. Another preferred way is directly through:
composer create-project laravel/laravel project_name
In both cases, you need to have composer installed on your machine. Composer is a modern PHP package manager, which has a ton of benefits (autoloading, custom commands...).
There is really no need for two downvotes, especially when this guy was reading documentation, which he couldn't understand. We were all installing Laravel for the first time.
If you want install laravel via Laravel Installer use this method:
First, open up command line. then enter:
composer global require "laravel/installer=~1.1"
Now go to:
C:\Users\ {User Name} \AppData\Roaming\Composer\vendor
Copy and paste vendor in your destination folder.
Now in your destination folder hold the shift key down and press right click and in opened navigation menu click on "open command window here" then enter command below:
laravel new your_project_destination
Ex:
laravel new laraveltest

Which version of gedmo should I specify for Doctrine 2.1.7 with symofny2.0.15?

My Bash refuse to process to a databse update since I've installed gedmo for S2.
I'm wondering if its because I've installed the wrong version of Gedmo.
I have Doctrine 2.1.7 and i need to install the 2.1.x version of gedmo-doctrine-extensions how can specify this to my deps file ?
For now I have
[gedmo-doctrine-extensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
But when trying to enter the doctrine:schema:update --force command, I have "Class 'Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator' not found in (my path)\vendor\gedmo-doctrine-extension\lib\Gedmo\Mapping\ExtensionMetadataFactory.php on line 170"
So i'm assuming it is due to the version of gedmo I use, Am I Right ?
I'm using 2.3.0 version for my project based on Symfony 2.0.15 and Doctrine 2.1.7
[gedmo-doctrine-extensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
version=v2.3.0
Anyhow you can look on http://github.com/l3pp4rd/DoctrineExtensions.git to see what version you want/need and add it into your deps file under version option.
P.S. I guess you already know, but when you add version info into your deps file, you need to run vendors script, or if you're using composer use it to update dependencies.

Categories