can't install eventdispatcher2.8 on symfony 3.3 - symfony

i'm trying to install omnypay in symfony 3.3 and i found that i must install the
eventdispatcher:^2.8 before
using :
composer require symfony/event-dispatcher:^2.8
but i got error:
[InvalidArgumentException]
The service "resolve_controller_name_subscriber" must be public as event subscribers are lazy-loaded.
i changed the class (resolve_controller_name_subscriber) to be public and the problem is resolved but i'm not sure if this is the right way

Related

Keep getting error on Symfony after installing JsFormValidatorBundle

After installing JsFormValidatorBundle, I keep getting the error bellow when I try to open my page on localhost. I installed the bundle following the instruction on https://github.com/formapro/JsFormValidatorBundle, composer installed the bundle successfully. My Symfony version is the 2.8. And my composer is updated.
InvalidArgumentException in FormPass.php line 59:
Tagged form type extension must have the extended type configured using the extended_type/extended-type attribute, none was configured for the "fp_js_form_validator.extension" service.
I tried to add this information at app/config/services.yml, but did not work:
fp_js_form_validator.extension:
class: Fp\JsFormValidatorBundle\Form\Extension\FormExtension
tags:
- { name: form.type_extension, alias='form', extended_type: Symfony\Component\Form\Extension\Core\Type\FileType }
Thanks

`FeatureContext` context class not found and can not be used.

I'm new with symfony2 and i wnat to test my app using behat but when I followed the official install in this link http://docs.behat.org/en/latest/cookbooks/1.symfony2_integration.html#installing-and-enabling-symfony2-extension
i got this error :
[Behat\Behat\Context\Exception\ContextNotFoundException]
FeatureContext context class not found and can not be used.
it was just after the first line and when i ran the bin/behat command.
When using the Symfony2Extension, you are responsible for handling the autoloading. Make sure the FeatureContext class can be autoloaded by changing your composer.json autoload configuration and running composer dump-autoload.

upgrade from symfony 2.0 to 2.3

I already have running project which is in Symfony 2.0.10. But now I need to upgrade it to Symfony 2.3.I know there is need to change some code to compitable with latest version.Is there any command to upgrade? Or what is the exact procedure to upgrade? Is there any document available?.
Edit:
I put symfony 2.3 composer.json file and while doing php composer.phar update I got this error.
Problem 1
- symfony/symfony v2.3.1 requires symfony/icu >=1.0,<2.0 -> no matching package found.
- symfony/symfony v2.3.0 requires symfony/icu >=1.0,<2.0 -> no matching package found.
- Installation request for symfony/symfony 2.3.* -> satisfiable by symfony/symfony[v2.3.0, v2.3.1].
Edit 2:
First I got this error:
[InvalidArgumentException]
The dist file "app/config/parameters.yml.dist" does not exist. Check your dist-file config or create it.
so I created parameters.yml.dist file.
Now I'm getting
PHP Fatal error: Class 'Symfony\Component\ClassLoader\UniversalClassLoader' not found in /var/www/git/sample/app/autoload.php on line 6
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when generating the bootstrap file.
Upgrade information
Read the upgrade guides in symfony/symfony github repository:
Upgrade 2.1
Upgrade 2.2
Upgrade 2.3
Upgrade 2.4
Upgrade 2.5
Upgrade 2.6
Upgrade 2.7
Upgrade 3.0
There are also changelogs in the repository:
CHANGELOG-2.2
CHANGELOG-2.3
Backup your project!
Upgrading with composer
Get composer and put the symfony 2.3 standard edition's composer.json into your project root.
Now run composer update with your project's patch as working directory.
-> You will face some exceptions due to breaking changes exceptions. Google will help resolve those :)
Personal experience
In my legacy projects the most noticeable bc break from 2.0 to 2.1 was this one related to the form-builder because I had to update every form.
Before ( 2.0 )
use Symfony\Component\Form\FormBuilder;
public function buildForm(FormBuilder $builder, array $options)
After ( 2.1+ )
use Symfony\Component\Form\FormBuilderInterface;
public function buildForm(FormBuilderInterface $builder, array $options)
Upgrading is in general simple, as you only have to update the version constraints in your composer.json according to the standard distribution and issuing
php composer.phar update
But 2.3 has some backwards compatibility breaks. So read carefully every upgrade document for necessary code changes.
from 2.0 to 2.1
from 2.1 to 2.2
from 2.2 to 2.3

symfony2: Problems after installing PUGXMultiUserBundle

I have installed PUGXMultiUserBundle for using multi-users in my symfony project (buyers and sellers). After installing PUGXMultiUserBundle, I create the abstract class and the 2 entities that inherit the abstract class (Seller,Buyer).
When I try to update the database by running the command:
php app/console doctrine:schema:update --force
I have the following errors:
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The service definition "fos_user.registration.form.factory" does not exist.
How do I fix this issue?

Symfony2.1 SonataUserBundle ResourceBundle error

I have this problem with Symfony.
I now use SonataUserBundle and I have this error:
The locale resource bundle could not be loaded for locale "en"
(uncaught exception) at
[...]/vendor/symfony/symfony/src/Symfony/Component/Locale/Locale.php
line 16
I have intl installed.
I did some research on Internet, and find I had to do
php data-build.php 49
Which gives me this error:
PHP Fatal error: Class 'ResourceBundle' not found in [...]Symfony/vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/build-data.php on line 97
Have you tried reinstalling or updating composer? I know whenever I have problems with any third party vendors I'll delete my composer.lock file and update composer to generate a new one.

Resources