php-casbin / dbal-adapter Goto Github PK
View Code? Open in Web Editor NEWDoctrine DBAL Adapter for Casbin, Casbin is a powerful and efficient open-source access control library.
License: Apache License 2.0
Doctrine DBAL Adapter for Casbin, Casbin is a powerful and efficient open-source access control library.
License: Apache License 2.0
There is a new version of dbal available and package need to be updated.
https://www.doctrine-project.org/2024/02/03/doctrine-orm-3-and-dbal-4-released.html
The file is src/Adapter.php,on Line 117, Thanks!
I get this error when trying to instantiate the Enforcer class using this adapter:
TypeError:
Argument 1 passed to CasbinAdapter\DBAL\Adapter::fetch() must be an instance of Doctrine\DBAL\Result, instance of Doctrine\DBAL\Driver\PDOStatement given, called in /<redacted>/vendor/casbin/dbal-adapter/src/Adapter.php on line 153
at /<redacted>/vendor/casbin/dbal-adapter/src/Adapter.php:495
at CasbinAdapter\DBAL\Adapter->fetch(object(PDOStatement))
(/<redacted>/vendor/casbin/dbal-adapter/src/Adapter.php:153)
at CasbinAdapter\DBAL\Adapter->loadPolicy(object(Model))
(/<redacted>/vendor/casbin/casbin/src/CoreEnforcer.php:363)
at Casbin\CoreEnforcer->loadPolicy()
(/<redacted>/vendor/casbin/casbin/src/CoreEnforcer.php:223)
at Casbin\CoreEnforcer->initWithModelAndAdapter(object(Model), object(Adapter))
(/<redacted>/vendor/casbin/casbin/src/CoreEnforcer.php:198)
at Casbin\CoreEnforcer->initWithAdapter('/<redacted>/permission_model.conf', object(Adapter))
(/<redacted>/vendor/casbin/casbin/src/CoreEnforcer.php:150)
at Casbin\CoreEnforcer->__construct('/<redacted>/resources/permission_model.conf', object(Adapter))
(/<redacted>/src/Utilities/Permission.php:52)
From the composer.json file in this library, Doctrine 2.9 and 3.0 are supported. I am using Doctrine 2.9.3.
Digging through the source code, it looks like the execute method from DBAL Query Builder (called on line 151 in Adapter.php) returns a ResultStatement
rather than the expected Result
object.
Passing an array of parameters instead of a Connection object in the constructor produces the same result. Am I doing something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.