Skip to content

Refactor dba_(p)open() to be more sensible #7610

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

Merged
merged 2 commits into from
Nov 6, 2021
Merged

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Oct 22, 2021

Actually use ZPP
Throw ValueErrors for invalid values

@Girgias Girgias force-pushed the dba-open branch 4 times, most recently from b877791 to 51eeaf4 Compare October 24, 2021 22:18
@cmb69
Copy link
Member

cmb69 commented Oct 27, 2021

Hmm, not sure if we can do that for BC reasons; I guess there may be custom handlers out there.

nikic added a commit that referenced this pull request Nov 3, 2021
This should address the octal issue encountered in #7610.
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks fine

@nikic
Copy link
Member

nikic commented Nov 3, 2021

Hmm, not sure if we can do that for BC reasons; I guess there may be custom handlers out there.

It doesn't look like it's possible to register a custom handler, the list is hardcoded.

@cmb69
Copy link
Member

cmb69 commented Nov 3, 2021

It doesn't look like it's possible to register a custom handler, the list is hardcoded.

I can imagine that some customize this. However, if we document the change, we should be good.

@Girgias
Copy link
Member Author

Girgias commented Nov 3, 2021

I've tested on a couple more drivers, and found a memory leak in the TokyoCabinet driver which I need to backport to 7.4 and above.

The only drivers I haven't tested the changes on now are dbm, ndmb, db2, db3, and qdbm, mainly as according to the PHP docs (which who knows if are accurate) these drivers conflict between each other and gdbm.

@nikic
Copy link
Member

nikic commented Nov 3, 2021

Maybe we can enable more dba handlers in CI (the ones that don't conflict)?

@Girgias
Copy link
Member Author

Girgias commented Nov 3, 2021

Maybe we can enable more dba handlers in CI (the ones that don't conflict)?

I'll to figure this out, need to find the Ubuntu dependencies as I'm running on Fedora. Will make this as a separate PR I think

Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
@Girgias Girgias merged commit 7db32ad into php:master Nov 6, 2021
@Girgias Girgias deleted the dba-open branch November 6, 2021 23:09
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

Successfully merging this pull request may close these issues.

3 participants