Questions tagged [symfony-components]

Symfony Components are standalone classes which implement common features. They are the foundation of the Symfony framework.

The Components

All components as of Symfony 2.3.0:

72 questions
1
vote
1 answer

Laravel Cannot declare class Symfony\Component\HttpFoundation\AcceptHeader, because the name is already in use

I just took a project from a couple of months ago which was made in Laravel. This project also utilizes Laravel Voyager - the admin panel package. After browsing to http://example.com/admin, I got this weird error which came out of nowhere and I'm…
aborted
  • 4,481
  • 14
  • 69
  • 132
1
vote
1 answer

How to load different configurations in the same file using different Configurations (ConfigurationInterface) in Symfony

I'm using the following Symfony components: "require": { "symfony/dependency-injection": "~3.0", "symfony/yaml": "~3.0", "symfony/config": "~3.0", "symfony/console": "~3.0", "symfony/validator": "~3.0", …
JorgeeFG
  • 5,651
  • 12
  • 59
  • 92
1
vote
2 answers

Symfony serializer doesn't work with --no-dev

I'm using symfony serializer. But if I install composer packages with --no-dev flag, it deserializes data that supposed to be array of objects in array of arrays instead. This is serialization: $result = $this->get('serializer')->deserialize( …
1
vote
1 answer

Default lifetime in Cache Component

I need configure default lifetime from cache Adapter, but something weird has been happening, the follows don't works!? :/ use Symfony\Component\Cache\Adapter\FilesystemAdapter; // in seconds; applied to cache items that don't define their own…
yceruto
  • 9,230
  • 5
  • 38
  • 65
1
vote
1 answer

For Symfony Validator Component is it possible to force validation to fail from a class that implements EventSubscriberInterface

I have the following code; public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add( $builder->create( 'href', 'url', $this->getOptionsForUrlWidget('Website…
Shaun
  • 167
  • 2
  • 7
1
vote
1 answer

How to parse arrays of arrays with symfony/config?

I want to parse a config of this structure: $config = [ 'streams' => [ 'foo' => [ [ 'id' => 'some-identifier', 'type' => 'a', ], [ 'id' =>…
zerkms
  • 249,484
  • 69
  • 436
  • 539
1
vote
2 answers

How to create a console command in Symfony2 application

I need to create a console command for a Symfony2 application and I read docs here and here though I am not sure what of those I should follow. So this is what I did. Create a file under /src/PDI/PDOneBundle/Console/PDOneSyncCommand.php Write this…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
1
vote
1 answer

How to set à priority for security Listeners?

I've a Sso authentication on my portal, which bypass the login form if a specific header is present into the request. When I try to impersonnate a user, the Symfony's Context Listener find the user and load it into security context, then my Sso…
Fractaliste
  • 5,777
  • 11
  • 42
  • 86
1
vote
3 answers

How to set-up a generic leveraged logging using Monolog?

I am writting a console application with Symfony2 components, and I want to add distinct logging channels for my services, my commands and so on. The problem: to create a new channel requires to create a new instance of Monolog, and I don't really…
Alain Tiemblo
  • 36,099
  • 17
  • 121
  • 153
1
vote
1 answer

Laravel Composer installation

I have recently had to to reinstall XP since doing so I am unable to get composer to install laravel it fails at "-Installing symfony/finder (v2.4.4)" and I get an error exception "ZipArchive::extractTo(): File exists" I have tried to install…
Artful_dodger
  • 698
  • 2
  • 7
  • 26
1
vote
2 answers

Symfony2 components, loading controllers

I am using routing component to load controllers, and if i use just $routes->add( 'index', new Route('/', array('_controller' => 'indexAction')) ); my "project" perfectly loads indexAction function, but if i try something like…
Itsmeromka
  • 3,621
  • 9
  • 46
  • 79
1
vote
1 answer

Goutte - TLSv1 protocol version error

I'm using Goutte to get a page on a web server using an SSL certificate. Whenever I try to get this page the the following exception is thrown: Uncaught exception 'Guzzle\\Http\\Exception\\CurlException' with message '[curl] 35: error:1407742E:SSL…
Onema
  • 7,331
  • 12
  • 66
  • 102
1
vote
3 answers

Symfony2: Inserting collection form data

There is a one-to-one relationship between User and Company entity. When initializing (creating) the user's company, userID should be bind to Company user field as a foreign key. But instead of that, i get this error message: Property "id" is not…
123dcck
  • 236
  • 1
  • 4
  • 18
1
vote
1 answer

How to propely configure SecurityProvider in Silex?

I'm trying to use Symfony's Security component that is incorporated in Silex PHP framework. Unfortunately, I can't get anywhere with Silex documentation since it only lists some requirements, not giving any full working example. There is a list of…
lilly
  • 661
  • 1
  • 7
  • 17
1
vote
1 answer

Symfony2 standalone Form component v2.3 - setting up a form

This is the same question asked here: Symfony2 standalone form component - setting up a form. The answer to this question seems to fully address the issue. Unfortunately back when this question was asked the version of the form component was 2.0.x,…
Onema
  • 7,331
  • 12
  • 66
  • 102