Symfony2 Solarium Class 'Solarium_Plugin_Abstract' not found - symfony

I am using https://github.com/nelmio/NelmioSolariumBundle and I am trying to conect with solarium y my symfony2 application.
I have installed solarium with the composer.json but then I get
Class 'Solarium_Plugin_Abstract' not found in .../vendor/bundles/Nelmio/SolariumBundle/Logger.php on line 12
I don't understand why in the Logger there is:
use Solarium_Plugin_Abstract
But in the folders I find:
myproject/vendor/solarium/library/Solarium/Plugin/Abstract.php
I have declared in my autoload.php
'Solarium' => DIR.'/../vendor/solarium/library',
Should't be: use Solarium/Pluguin/Abstract ?
What I am doing wrong?

Related

symfony fatal error after removing bundle

I created a bundle named UserBundle and when I needed to remove it I did this exacly :
Unregister the Bundle in the AppKernel
Remove Bundle Configuration
2.1 Remove Bundle Routing
2.2 Remove Bundle Configuration
Remove the Bundle from the Filesystem
3.1 Remove Bundle Assets
Remove Integration in other Bundles
but when I try to exec soms command this is what I Get :
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in #UserBundle/Resources/config/s
ervices.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml"). Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered an
d loaded in the application kernel class. If the bundle is registered, make sure the bundle path "#UserBundle/Resources/config/services.yml" is not empty.
[InvalidArgumentException]
Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command:
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in #UserBundle/Resources/config/services.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml").
Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "#UserBundle/Resources/config/services.yml" is not empty.
When I Refresh the server 'http://127.0.0.1/mt/web/' I get :
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?' in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:198 Stack trace: #0 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(232): Symfony\Component\HttpKernel\Kernel->getBundle('UserBundle', false) #1 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Config\FileLocator.php(51): Symfony\Component\HttpKernel\Kernel->locateResource('#UserBundle/Res...', NULL, false) #2 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(147): Symfony\Component\HttpKernel\Config\FileLocator->locate('#UserBundle/Res...', 'C:\xampp\htdocs...', false) #3 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(101): Symfony\Component\Config\Loader\FileLoader-> in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php on line 179
In C:\xampp\htdocs\MT\app\config\config.yml you may have something like:
imports:
- { resource: #UserBundle/Resources/config/services.yml }
and possibly a configuration section related to the user bundle, i.e.
user_bundle:
...
You have to manually remove both to make everything working again.
Can you check if you use this bundle in app/config/service.yml
If it's not working, try to search with your IDE (integrated development environment) your bundle inside your project. If you find some results, just remove them.
Clear the cache
Try to clear cache manually by removing those folders : "var\cache\dev" and "var\cache\prod" for Symfony 3.x or "app\cache\dev" and "app\cache\prod" for Symfony 2.x .

Creating vendor bundle in symfony2 and deploying it via composer

I'm trying to create my first vendor bundle. I have found a lot of informations in this question but i'm stuck.
My github repository is available here :
https://github.com/vtedesco/Peary
I have registered it in composer :
https://packagist.org/packages/vted/peary
In another project I have installed it via the command composer require vted/peary, files are correctly visible under my directory vendors/vted/peary.
But when it try to add it in AppKernel.php like this:
$bundles = array(
...
new Vted\PearyBundle\VtedPearyBundle(),
...
);
I get the following error :
ClassNotFoundException in AppKernel.php line 24:
Attempted to load class "VtedPearyBundle" from namespace "Vted\PearyBundle".
Did you forget a "use" statement for "Vted\PearyBundle\VtedPearyBundle"?
I think it's maybe a naming issue somewhere but I can't find it. The VtedPearyBundle.php class look good for me.
Your current bundle structure is more suitable for the psr-4 autoloader:
{
"autoload" : {
"psr-4" : {
"Vted\\PearyBundle\\" : ""
}
}
}
Alternatively, you can use the target-dir with psr-0. However, the psr-4 autoloader is preferred.

`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.

not installing HWIOAuthBundle in symfony 2

When I try to install HWIOAuthBundle I get the following error:
Fatal error: Class 'hwi\oauthbundle\HWI\Bundle\OAuthBundle' not found in C:\xampp\htdocs\prjectName\app\AppKernel.php on line 24
I have reference to documentation, after running the composer , i do get hwi package downloded with path as C:\xampp\htdocs\prjectName\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle but when i include it in the AppKernel.php file as
24th line of AppKernel.php is:
new hwi\oauth-bundle\HWI\Bundle\OAuthBundle(),
As the doccumentation says you should register this bundle to appKernel.php by adding
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
instead of
new hwi\oauth-bundle\HWI\Bundle\OAuthBundle(),
The path added to the appKernel.php is not the exact path of the bundle where it is added but the namespace + class name of the main bundle's class (which extends Bundle).

Symfony 2: LiipDoctrineCacheBundle not found in AppKernel

I've installed this bundle LiipDoctrineCacheBundle in vendor\bundles\ folder of my website.
Then, as usual, I added in autoload.php a new entry in the array namespace:
'Liip' => __DIR__.'/../vendor/bundles',
And I registered this new bundle in the bundles' array of AppKernel.php:
new Liip\DoctrineCacheBundle\LiipDoctrineCacheBundle(),
But weirdly I get this error message:
Fatal error: Class 'liip\DoctrineCacheBundle\LiipDoctrineCacheBundle' not found in C:\workspace\LHN\app\AppKernel.php on line 26
It's like if Symfony cannot retrieve the bundle in the nameSpace...
So I've tried by changing the case of the bundle key: 'Liip'==> 'liip'
And I've also tried with the fully path location:
__DIR__.'/../vendor/bundles' ==> C:\workspace\mySite\vendor\bundles
Any idea?
Thks
Symfony: 2.0.9
Liip bundle: master
You are probably using the wrong name for the bundle class.
i think it should be
new Liip\LiipDoctrineCacheBundle\LiipDoctrineCacheBundle()
or
new liip\LiipDoctrineCacheBundle\LiipDoctrineCacheBundle()
not sure if the first "L" is capital or not in your vendor/bundles/ source
Thanks to Laurynas's comment I understood my problem: the source bundle path was wrong
vendor\bundles\liip\LiipDoctrineCacheBundle
instead of
vendor\bundles\Liip\DoctrineCacheBundle
The origin of this issue is that I made a mistake in the deps file (where the git location, the version and the target directory are defined) by setting the target property to /bundles/liip/LiipDoctrineCacheBundle instead of to /bundles/Liip/DoctrineCacheBundle.
My bad... ;-)
Correct dep block:
[LiipDoctrineCacheBundle]
git=https://github.com/liip/LiipDoctrineCacheBundle.git
target=/bundles/Liip/DoctrineCacheBundle
version=master

Resources