Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a PDO instance ... error #1683

Closed
phili67 opened this issue Dec 12, 2020 · 6 comments
Closed

Get a PDO instance ... error #1683

phili67 opened this issue Dec 12, 2020 · 6 comments

Comments

@phili67
Copy link

phili67 commented Dec 12, 2020

@dereuromark i've never had this problem before, but since I upgrade from 2.0.0-alpha11 to dev-master, I get this error, each times I try to get an instance of pdo :

.... __construct() must be an instance of PDO, instance of Propel\Runtime\Connection\PdoConnection given.

So to extract the instance I use the code below

 // new way to manage events
        // we get the PDO for the Sabre connection from the Propel connection
        $pdo = Propel::getConnection();

        // We set the BackEnd for sabre Backends
        $calendarBackend = new CalDavPDO($pdo->getWrappedConnection());

CalDavPDO is a class that use sabre.io

Could you give me an advice to solve the problem ?

Thank's a lot and sorry for my poor english level.

@dereuromark
Copy link
Contributor

dereuromark commented Dec 14, 2020

2.0.0-alpha11...master

-class StatementWrapper extends PDOStatement implements IteratorAggregate
+class StatementWrapper implements StatementInterface, IteratorAggregate

You will see that in order to be PHP8 ready, the next release will have to use an interface contract and proxy into PDO classes instead of just extending them.
This can have some minor BC breaking impact for e.g. your use case.
Are you able to fix up your code accordingly?

@phili67
Copy link
Author

phili67 commented Dec 21, 2020

@dereuromark No I can make it work completely.
How could I get the pdo interface, I always find problems by mixing sabre pdo code with propel.
I can make it work, but sometimes I've to mix sabre code with propel code and the code isn't synchronized between the two interfaces.

@dereuromark
Copy link
Contributor

Do you have any suggestions or a PR on what could be improved here?
We plan to do a final release soon.

@phili67
Copy link
Author

phili67 commented Jan 12, 2021

I finally find a "workaround" and it's working, but I'm not really satisfied with this solution.

@dereuromark
Copy link
Contributor

Do you want to elaborate a bit more?
Or shall we close this topic then?

@dereuromark
Copy link
Contributor

Since there is no further regression or php8 issues, I will close this now
The changelog will outline the changes regarding this BC breaking topic on release then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants