Laravel 5.1 : Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found - laravel-5.1

I'm using laravel 5.1 , I'm trying to do a migrate:refresh, I get an error :
Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found in
../vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php
[Symfony\Component\Debug\Exception\FatalErrorException] Class
'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found
Doctrine/dbal is already required in my composer.json
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"Doctrine/dbal": "^2.5"
}
So I want to ask what is wrong in my laravel project.

From the official docs:
Before modifying a column, be sure to add the doctrine/dbal dependency
to your composer.json file. The Doctrine DBAL library is used to
determine the current state of the column and create the SQL queries
needed to make the specified adjustments to the column:
composer require doctrine/dbal

What worked for me is to delete the database.sqlite file and create an empty one.
I know this is not the best solution, but it fixed the issue in my use case.

Just a heads up, on Laravel 5.4 (paired with doctrine/dbal#^2.5 package), using the Blueprint::dropColumn() method works like a charm on SQLite databases. No Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found errors thrown.

Doctrine/dbal version 3 doesn't have Doctrine\DBAL\Driver\PDOSqlite\Driver class.
Make sure you are using doctrine/dbal version 2.
If you have version 3, you should remove it
composer remove doctrine/dbal
And then to install the version 2
composer require doctrine/dbal:2.13
Visit this link to see all available versions: https://packagist.org/packages/doctrine/dbal

Related

name 'package_name' is not defined (did you mean 'PACKAGE_NAME'?)

I'm using bazel 0.24.0 to build an existing bzazel project.
After reading the bazel document , I change "PACKAGE_NAME" to "package_name()".
The following problem shows
"name 'package_name' is not defined (did you mean 'PACKAGE_NAME'?)" .
Also , "PACKAGE_NAME" is not working by showing the errors:
The value 'PACKAGE_NAME' has been removed in favor of 'package_name()', please use the latter (https://docs.bazel.build/versions/master/skylark/lib/native.html#package_name).
Aare there any solution?
You must use native.package_name(), not package_name.
Also note that the documentation is versioned. You are looking at the master version, but I think you want the 0.24.0 docs: https://docs.bazel.build/versions/0.24.0/skylark/lib/native.html#package_name

How to use ros::pluginlib to load multi-library

I am trying to use ros::pluginlib to load a plugin called A_Plugin which has been registered to ROS Package System correctly. One thing to note is that A_Plugin depends on Opensplice DDS, and it need to link the DDS libraries "libddskernel.so" ,"libdcpsisocpp.so". In CmakeLists.txt file, I write like this:
```
add_library(A_Plugin
src/aplugin.cpp
)
target_link_libraries(A_Plugin
$ENV{OSPL_HOME}/lib/libddskernel.so
$ENV{OSPL_HOME}/lib/libdcpsisocpp.so
)
```
It can be registered to ROS package system correctly, but when I use pluginlib::ClassLoader to load A_plugin, I got the following errors:terminate called after throwing an instance of 'pluginlib::CreateClassException'what(): MultiLibraryClassLoader: Could not create object of class type test::A_Plugin as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary(). How can I solve this problem? Thanks!
I had a similar problem, turns out I was missing the plugin class declaration in the *.cpp file. I included it and it worked fine. The declaration should be something like:
PLUGINLIB_DECLARE_CLASS(rqt_example_cpp, MyPlugin, rqt_example_cpp::MyPlugin, rqt_gui_cpp::Plugin)
This can be seen in the example from the rqt tutorial github repo, line 62:
https://github.com/lucasw/rqt_mypkg/blob/master/rqt_example_cpp/src/rqt_example_cpp/my_plugin.cpp

zend framework 2 : A plugin by the name "getServiceLocator" was not found

I am new to ZF2.
Today I was trying to implement a simple database operation. I was referring to https://framework.zend.com/manual/2.4/en/user-guide/database-and-models.html.
But I am getting following error
A plugin by the name "getServiceLocator" was not found in the plugin manager Zend\Mvc\Controller\PluginManager
What am I missing ?
Just a note: ZF2 is warning since a long time now about the depreciation of the use of $this->getServiceLocator() in the code and so we should respect it.
But still some of us have projects already developed with old code and we can't change all that now so had to find this solution.
Try adding "zendframework/zend-mvc": "2.6.3" to the composer.json file under require list like the following:
"require": {
....
"zendframework/zendframework": "~2.5",
"zendframework/zend-mvc": "2.6.3",
....
}
This will allow you to make use of the $this->getServiceLocator() in the controller.
What this does is - even if the framework version gets on updating, the zend-mvc will always remain old in you code and support the use of $this->getServiceLocator().
I know that most of them won't like this usage but it will definitly helps those who have got no way to upgrade/modify their code.
I hope it helps someone.

How to add custom fields in ZFC-user module for zend 2 without doctrine?

I have tried using creating a different module and attaching the ZfcUser\Form\Register over init method. But it wasn't working.
I want to add few custom fields, with changing any thing in the vendor dir, as is it not a good practice. I also tried using user_entity_class ,creating a custom 'User' class, but it was creating some route issue in other modules, with zfc-user , I'm also using zfc-admin and zfc-adminuser, the error was coming in zfc-adminuser, Couldn't found the class was the error.
Thanks in advance.
Well there are some issue regarding the overriding of the module ZFC-User, But still you can overwrite it manually.
One way I have used is a bit old fashioned but working. What I have done is I have copied complete module the to module folder. Then pointing the form towards to my module where the changes are required, rest all are pointed to default.With this you can update your module. Make sure you point the user_entity_class to your module something like this:
'user_entity_class' => 'MyZfcUser\Entity\User',
you can find this in config\autoload\zfcuser.global.php

ZF2 : How do i include the Zend_Acl component into my custom built php app?

I'm trying to use the Zend/Permissions/Acl/Acl class into my custom built php application but I cannot get past encountering this error :
Fatal error: Class 'Zend\Permissions\Acl\Acl' not found in /users/myuser/htdocs/test/index.php on line 9
Here is a screenshot of my file system organization and my php code I'm using.
I copied the Acl initialization code from the documentation here : http://framework.zend.com/manual/2.1/en/modules/zend.permissions.acl.intro.html
I'm new to Zend framework but would really like to start using the Acl class. Please help.
use is not a replacement for require, you will need an autoloader so that the files will be included. Have a look at the StandardAutoloader of ZF 2.
On a separate note: it's safer to use absolute paths in the include path:
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . __DIR__ . '/libraries');

Resources