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

Convert resource to object in XML-RPC extension #5457

Closed
wants to merge 1 commit into from

Conversation

kocsismate
Copy link
Member

@kocsismate kocsismate commented Apr 25, 2020

There are 3 memory leaks indicated in ext/xmlrpc/tests/bug50285.phpt, but otherwise the tests already pass (locally). Will continue later :)

@@ -744,42 +785,31 @@ PHP_FUNCTION(xmlrpc_server_create)
}

if (USED_RET()) {
Copy link
Member Author

@kocsismate kocsismate Apr 25, 2020

Choose a reason for hiding this comment

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

Do we really need this check? If not, can the other usages be removed (from array.c for example)?

Copy link
Member

Choose a reason for hiding this comment

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

In this case, the USED_RET() check makes no sense. The ones in array.c are present because the functions both have a side-effect and a return value, and the check saves computing the return value if it isn't used.

Copy link
Member Author

Choose a reason for hiding this comment

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

I got rid of all the USED_RET() checks

* destroy_server_data(server);
*/
RETURN_BOOL(bSuccess == SUCCESS);
RETURN_TRUE;
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this stay?

@cmb69
Copy link
Member

cmb69 commented Apr 25, 2020

Thanks for working on this, but I think we should unbundle ext/xmlrpc for PHP 8, and if we do that it might be best to leave the extension as is.

@kocsismate
Copy link
Member Author

@cmb69 Can you suggest another extension instead that is worth the effort? ext/openssl, ext/sockets, or ext/fileinfo seem to be the most useful candidates for me, but my intention was to find a smaller target first. Do the sys* extensions fall in this category?

@cmb69
Copy link
Member

cmb69 commented Apr 25, 2020

Yes, certainly makes sense to start with a smaller extension first, but that might not be that simple, because anything that uses stream resources is better left alone for now, and xmlrpc doesn't seem the only extension which might better be unbundled (e.g. ext/ftp doesn't appear that useful anymore since it doesn't support SFTP, and it is barely maintained). The sys* extensions may be a reasonable start, but I barely know these since they're POSIX only.

@nikic
Copy link
Member

nikic commented Apr 25, 2020

Unbundling after object conversion should not be a problem. I think we should proceed under the assumption that all extensions are going to stay, because most likely, that is exactly what is going to happen.

If you're serious about unbundling something for PHP 8, please start an RFC asap. I think the only realistic candidates there are ext/xmlrpc and ext/imap though, because those depend on unmaintained libs. I doubt we're going to drop ext/ftp.

@kocsismate
Copy link
Member Author

Yeah, that would have been my next question if I see right that streams should be omitted? What makes them different? Or only the fact that they are much more wildly used?

@kocsismate
Copy link
Member Author

kocsismate commented Apr 25, 2020

And yes, I also agree with Nikita in this question. Although this extension seems pretty useless, its conversion wasn't a really big effort and yet, there will be one less BC break if we would be able to remove support for resources completely, let's say in PHP 9. 🤞

@cmb69
Copy link
Member

cmb69 commented Apr 25, 2020

Streams are special, because they are likely used by external extensions, and we may want to give the respective maintainers ample time to switch.

@kocsismate kocsismate force-pushed the xmlrpc-resource branch 4 times, most recently from ff36b77 to 0514c09 Compare April 30, 2020 09:25
@kocsismate
Copy link
Member Author

@nikic Can you please have a look at this before xml-rpc gets unbundled? :) I didn't noticed any complication, so I really hope there won't be too many issues with the implementation

@php-pulls php-pulls closed this in 256b7da May 13, 2020
@kocsismate kocsismate deleted the xmlrpc-resource branch May 13, 2020 12:50
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
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.

4 participants