Update project based on Symfony 2.0 to Symfony 2.2 - php

I am trying to update my project written in Symfony 2.0 into Symfony 2.2.
Moving source codes into 2.2 project ended with config.yml and security.yml incompatibiliy.
Is there way how to properly migrate Symfony 2.0 project into Symfony 2.2?

It better to wait until Symfony 2.3 before migrating. It will be released somewhere in May. It's the first LTS (Long Time Support) release, meaning that it's maintained for three years. So: You don't have to worry about BC breaks for 3 years!
For the migrating of Symfony 2.0 to 2.3: There is nothing you can do. Read the UPGRADE-*.md files (which are stored in the root of the symfony/symfony package) and fix anything that is in their in your code. Every BC break that's important for normal users will be put in those UPGRADE files.
If you can't solve it after the fixing everything in the UPGRADE files, you should take a look at the CHANGELOG.md files in the root of the package (e.g. the symfony/security package). Try to find something that is changed and cause your code to break.
Finally, if you don't get your script working, there are a lot of active Symfony2 users who are waiting to help you. Take a look at the community page and find your place to ask questions.

Related

How to update a legacy concrete5 package

A long long time ago, I've developed a concrete5 package for concrete5 <= 5.6 for a small non-profit organization. Now, because it has never been upgraded, there are some issues that I can't easily fix, related to the old PHP version. Therefore, I'd like to migrate the web site to a new installation of concrete5 version 8. However, for a fresh install of the latest concrete5, of course my old plugin no longer works. What are the steps to update a legacy concrete5 package to work under the newer concrete5 versions? I couldn't find any info or guides online unfortunately. I have looked at the new documentation on how to develop a package for concrete5 8, but found it very scant. I've changed the namespace of my controller for example, but this is not enough to let the package function. Any insights would be greatly appreciated!
Edit: the code is here
The folder and file structure is mostly the same. YOu have to use namespacing in your classes now. Package controllers have changed a bit in what they extend I think. BLocks are mostly the same. Using JS and CSS assets still works the old way if you prefer but there's a new and better way with asset management.
Feel free to contact me by PM on the concrete5 website my username is mnakalay. There you can tell me more about your package and what it contains (blocks, attributes...) and I can give you a few pointers

Symfony Native Debian

I installed symfony 2.8 on debian 9. Using native packages from the link repository.
Debian9 Package Symfony
Installed several components that use symfony, for example doctrine, twig, asset, etc.
In debian they were divided between /var/lib/dpkg and /usr/share folders.
In /var/lib/dpkg it is displayed that in the info folder are the .list of each component.
Result folder info
I searched for related information to make a "hello world" by displaying the native symfony and it's really little or nothing I got.
I have used and implemented projects in symfony in a traditional way with versions 2.8, 3.x. And I really can't emulate it with the native, as you would normally work.
Has anyone managed to deploy symfony natively?
Any help or tip will be welcome.
Thank you in advance.
Package from debian seems to install symfony 2.8 and the docs for this are:
https://symfony.com/doc/2.8/best_practices/creating-the-project.html
Simply by using:
symfony new blog
this should generate a basic app for you and then you should run
php app/console server:run
and if you visit http://localhost:8000/ in your browser you should see your app according to
https://symfony.com/doc/2.8/setup.html

How to update CakePHP?

I have to update CakePHP from current, outdated version (2.7.7) to latest on 2 branch, because of PHP7 support.
While I've done numerous framework upgrades before, I found book.cakephp.org a more than a cryptic about key things which I ask here:
can it be done by replacing directoris
which directories are intended to be replaced (never edit dirs, like system in Codeigniter)
which directories are partially replaced if any
is there SQL commands that should be run?
is there other commands that should be run?
Any clue is appreciated, but 2 and 3 are of most value I guess. Thanks in advance.
Depending on how you've installed CakePHP, you either use composer to update the CakePHP core dependency:
$ composer update
or require a specific constraint/version if your current constraint doesn't allow upgrading:
$ composer require cakephp/cakephp:^2.10.3
If you're not using composer (I'd suggest to switch to using it), then you download the latest release package manually, and completely replace the /lib/Cake directory. With respect to the core, the upgrade is then complete.
Then read the migration guides to figure the possible changes that you have to apply to your application code or database schemas, and also compare the "application template" changes (/app/) to your local application and apply changes in case necessary. After this, run your test suite to ensure that everything works as expected.
With that being said, the upgrade from 2.7 to the latest 2.10 should be pretty easy, as it is said to be fully API compatible.
I recommend you to use composer to manage your framework and extensions.
With composer installed, it would be much easier to update. If you decide to use composer, let me know if you need any more help by installation, setup or update.

Symfony downgrade from 3.2 to 2.8 lts

I have started with symfony 3.2 project, then changed version in composer to 2.8 (which is long term support).
Problem is that folders structure still remains 3.2 project. Is there any way to change (not manually) folders structure to 2.8?
Of course you can downgrade. You might choose the old Symfony2 directory structure (deprecated) or keeping the current Symfony3 structure.
In either ways, please take a look at How to Override Symfony's Directory Structure.
Using the Symfony3 directory structure
If you choose to use the Symfony3 structure, it's easy as following up this article about upgrading from Symfony2 to Symfony3's directory structure.
Using the Symfony2 directory structure
First you'll have to rename and move some files (like var/cache/, var/logs/, etc.). Afterwards you'll have to change the autoloading file in app/autoload.php (formerly var/autoload.php which you must move too).
Basically it's the same in reverse order like upgrading from Symfony2 to Symfony3 (mentioned above).
Please be aware that Symfony 3.4 (next LTS) will be released in November 2017, so in my opinion it's not worth to downgrade, and then re-upgrade. Upgrading from 3.2 to 3.4 will be small and fast, Upgrading from 2.8 to 3.4 could be much more to do ...

How to run multiple versions of Symfony PHP Framework

I have several web projects built with Symfony v1.0, but I am excited by the new features in Symfony version 1.4 (Improved security, native email support and improved performance).
How can I continue to develop my 1.0 projects but also create a testing environment for version 1.4?
Guide to Installing Multiple versions of Symfony
Thankyou to Guillaume Flandre for pointing it out, there is a fantastic article written by eHabib on SymfonyNerds.com - http://symfonynerds.com/blog/?p=123
Here is the basic outline, read the whole article here.
Step 1 - Un-install Symfony via PEAR
Step 2 - Setup a structure for Symfony: Install symfony in /usr/share/php/symfony
Step 3 - Checkout each Symfony version you need
Use SVN checkout to grab each Symfony version. Put these in a different folder under the base Symfony directory.
Step 4 - Create symbolic links for each version
Create and test symlinks for each version of Symfony. Lets place these in the standard bin directory
Step 5 - Creating a new project
Use the relevant Symfony command. For example, to create a Symfony 1.0 project:
sudo symfony10 init-project test1
sudo symfony11 generate:project test11
sudo symfony12 generate:project test12
Step 6 - Check in the project Config to ensure its picked up the right version.
This link should be useful: http://symfonynerds.com/blog/?p=123
It points to an article named: Your complete guide to running multiple Symfony versions on the same environment
It's fairly easy to do.
As also said in the article, I define it in lib/vendor as svn:externals: symfony http://svn.symfony-project.com/branches/1.2
So there's no symfony to be installed on the server at all and you can use as many versions without influence on other apps.

Categories