Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are symfony bridges, bundles and vendor?

Tags:

symfony

What does the bundle, vendor and bridge of Symfony mean?

like image 242
Manish Basdeo Avatar asked Aug 09 '12 17:08

Manish Basdeo


People also ask

What is a Symfony bridge?

A bridge is a set of classes that aims at extending a library into Symfony2. A bridge is part of the core.

What are Symfony bundles?

A Symfony bundle is a collection of files and folders organized in a specific structure. The bundles are modeled in such a way that it can be reused in multiple applications. The main application itself is packaged as a bundle and it is generally called AppBundle.


1 Answers

Vendor

In general, vendor are the dependencies of your project (aka third party libraries). It's the same meaning in Symfony2.

Bundle

From the documentation about bundles:

A bundle is a directory that has a well-defined structure and can host anything from classes to controllers and web resources.

In other words, it's a part of your application which owns a logic (controllers, views, models). Bundles can also wrap a library. For example, the BazingaGeocoderBundle wraps the Geocoder library. It provides Symfony2 oriented features to ease the use of a library in a Symfony2 project. Also, it can be a glue between components.

Bridge

A bridge is a set of classes that aims at extending a library into Symfony2. A bridge is part of the core. You can find a bridge for the third libraries that could be in the core (Twig, Doctrine, Propel, Monolog, etc.). If you don't want to use Doctrine as ORM, then you don't care about the EntityType. That's why this class is in the bridge.

To sum up, a bridge extends some components and a bundle adds features to the application.

like image 195
William Durand Avatar answered Oct 22 '22 01:10

William Durand