Symfony2 without Doctrine - php

How can I install symfony2 without Doctrine?
I have tried removing the package using composer and uninstalling the bundle manually but I get errors always.
My application is going to get the data from a Restful WS, so I don't need Doctrine at all.

Create a Symfony Standard Edition project with the Symfony installer:
symfony new symfony-se
Remove the doctrine/doctrine-bundle and doctrine/orm from your composer.json.
Remove the DoctrineBundle from a list of registered bundles in AppKernel.
Remove the doctrine configuration from the app/config/config.yml. You can also remove database related entries from the app/config/parameters.yml.dist.
Run composer update.
Note that you'll still find some of the doctrine packages installed. For example the doctrine/annotations library is used by Symfony to parse annotations. Doctrine is not only an ORM.

Related

Doctrine getRepository call cannot find class following composer update

I have run a composer update on my Symfony 4.4 project and ran into an issue that will run throughout my project.
The following line:
$this->stadiumEntity = $this->getDoctrine()->getRepository('AppBundle:Stadium')
errors with:
Class AppBundle:Stadium does not exist
When I change it to the following it works, however there is clear some BC break in either Symfony itself or more likely one of the Doctrine packages. I just can't determine which one.
$this->stadiumEntity = $this->getDoctrine()->getRepository(Stadium::class)
I thought the issue was in doctrine/persistence, however the getRepository method hasn't really changed in 3 years.
composer show | grep doctrine
doctrine/annotations 1.13.2 Docblock Annotations Parser
doctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers...
doctrine/collections 1.6.8 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common 3.3.0 PHP Doctrine Common project is a library that provides additional functionality that other Doctri...
doctrine/data-fixtures 1.5.3 Data Fixtures for all Doctrine Object Managers
doctrine/dbal 2.13.9 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspecti...
doctrine/deprecations v0.5.3 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable...
doctrine/doctrine-bundle 2.6.3 Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle 3.4.2 Symfony DoctrineFixturesBundle
doctrine/doctrine-migrations-bundle 3.0.3 Symfony DoctrineMigrationsBundle
doctrine/event-manager 1.1.1 The Doctrine Event Manager is a simple PHP event system that was built to be used with the variou...
doctrine/inflector 2.0.4 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to up...
doctrine/instantiator 1.4.1 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer 1.2.3 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations 3.4.2 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction...
doctrine/orm 2.12.2 Object-Relational-Mapper for PHP
doctrine/persistence 3.0.2 The Doctrine Persistence project is a set of shared interfaces and functionality that the differe...
doctrine/sql-formatter 1.1.2 a PHP SQL highlighting library

symfony/skeleton and symfony/website-skeleton

At https://symfony.com/doc/current/setup.html you are instructed to run:
composer create-project symfony/website-skeleton my-project
whereas at http://symfony.com/doc/current/quick_tour/the_big_picture.html you are instructed to run:
composer create-project symfony/skeleton quick_tour
I have just done both. Using symfony/website-skeleton I got an error message in the browser: No route found for "GET /"
With symfony/skeleton I did get a Welcome to Symfony 4.0.4 page.
What are the differences between the two and why would you use one rather than the other?
The new symfony edition (Symfony 4) is "bundle less".
Symfony core team decided to not provide the Symfony Standard Edition for Symfony 4.0 that means when you run composer create-project symfony/skeleton you download the minimum package to start an application and you have to download the over packages needed and you need to explicitly add all the dependencies you want to depend on (twig, routing...) look here for other package .
But it could be difficult for new comers and the Symfony core team dediced to provide an edition with the minimum common Symfony features.
You get it with composer create-project symfony/website-skeleton.
You have more explanation here
Came here as a result of a similar search, but was more interested in what's under the hood.
Not to take away from the accepted answer, but for those who, like me, were after something more detailed, you can look at the package details in packagist and reviewing the dependencies noted in the requires and requires dev sub-sections:
https://packagist.org/packages/symfony/website-skeleton
Includes: framework, framework extra, console, asset, security, validator twig, doctrine, http client, serialiser, yaml, dotenv, flex, form and validator packages among others.
https://packagist.org/packages/symfony/skeleton
Includes: console, dotenv, flex, platform and yaml only.
Seems like a no brainer, but if you came here looking for it, it's there.

FOSElasticaBundle for symfony 3?

I'm looking to integrate the FOSElasticaBundle into my symfony 3 project. Currently this bundle doesn't support symfony 3. I was ondering what I could do to still implement it?
Seems is not yet tagged a valid release for using it via packagist. See this issue on github.
The release dev-master / 3.2.x-dev seems already compliant with symfony3.
I successfully installed this bundle on a symfony3 installation with the command :
composer require friendsofsymfony/elastica-bundle dev-master
Hope this help

FOSUserBundle for symfony 2.4.3

I want to start a new project on symfony 2.4.3 and I need the functionality of the fosuserbundle. My Problem: On their github (https://github.com/FriendsOfSymfony/FOSUserBundle) in the documentation they recommand 2.1.x.
Here , a user says you should install fosuserbundle manually but this question is for symfony 2.3.
Can I use the bundle on my version of symfony? If yes, can I install it with composer? If no, are there any similar bundles that I can use instead?
Thanks in advance
This version of the bundle requires Symfony 2.1+. If you are using Symfony 2.0.x, please use the 1.2.x releases of the bundle.
From their docs. 2.1+ means, 2.1, 2.2, 2.3, 2.4, ... 2.n So 2.3 is perfectly valid.
Moreover, Composer handles the dependencies for you, so just require it and run composer update, if the Symfony version is not supported the command fails and you know it doesn't support your current version, if it succeeds everything is working perfectly.

How to install SonataAdminBundle on Wamp?

I am try to install Sonata Admin Bundle on WAMP . To begin, add the dependent bundles to the vendor/bundles directory. Add the following lines to the file deps.
[SonatajQueryBundle]
git=http://github.com/sonata-project/SonatajQueryBundle.git
target=/bundles/Sonata/jQueryBundle
[SonataUserBundle]
git=http://github.com/sonata-project/SonataUserBundle.git
target=/bundles/Sonata/UserBundle
[SonataAdminBundle]
git=http://github.com/sonata-project/SonataAdminBundle.git
target=/bundles/Sonata/AdminBundle
[KnpMenuBundle]
git=https://github.com/KnpLabs/KnpMenuBundle.git
target=/bundles/Knp/Bundle/MenuBundle
[KnpMenu]
git=https://github.com/KnpLabs/KnpMenu.git
target=/knp/menu
[SonataDoctrineORMAdminBundle]
git=http://github.com/sonata-project/SonataDoctrineORMAdminBundle.git
target=/bundles/Sonata/DoctrineORMAdminBundle
Now problem in install these bundle in vendor. I run this commend php bin/vendors install but it's show Try to run ./bin/vendors install --reinstall
Is there something wrong with my Bundle. I am really not sure what to do about this. Please help.
I appreciate all the help.
Thanks!
You might be using incompatible versions of Symfony and SonataAdminBundle.
Also, you might be missing SonataBlockBundle and SonataCacheBundle which are required with the latest versions of SonataAdminBundle (have a look at the SonataAdmin installation reference). Symfony, SonataAdminBundle and Doctrine2 only work together in specific combinations.
Suggestion: Try the relevant instructions in this tutorial, or better yet, clone this repository and configure it according to the instructions.
You'll have a working install, to which you can then add your existing bundle.

Categories