Page MenuHomePhabricator

Deprecate "PhutilExecPassthru->execute()" in favor of "resolve()"
ClosedPublic

Authored by epriestley on Jul 21 2021, 5:11 PM.
Tags
None
Referenced Files
F18199979: D21705.diff
Mon, Aug 18, 3:34 AM
F18106584: D21705.id.diff
Sun, Aug 10, 11:09 PM
F18023244: D21705.id.diff
Sat, Aug 2, 8:52 PM
F17885462: D21705.id51693.diff
Tue, Jul 29, 12:23 AM
F17738057: D21705.id51691.diff
Sun, Jul 20, 10:36 PM
F17708939: D21705.id51691.diff
Jul 17 2025, 3:21 AM
F17628415: D21705.diff
Jul 10 2025, 7:29 AM
Unknown Object (File)
Jul 1 2025, 7:00 PM
Subscribers
None

Details

Summary

Fixes T13660. See also D21703. The most desirable modern API here is "resolve()", so deprecate the similar "execute()".

Test Plan
  • Grepped for callsites.
  • Ran arc patch --trace in a Git working copy and saw the updated "git apply" in the trace output.
  • Used this test script (changing the method and the command invoked) to confirm that success and error behavior is identical in "resolve()" and "execute()", except that "execute()" now emits a deprecation warning:
<?php

require_once 'support/init/init-script.php';


$err = id(new PhutilExecPassthru('lsx'))->execute();
var_dump($err);

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cspeckmim added inline comments.
src/future/exec/PhutilExecPassthru.php
13–14

lol

34

If this is called from Phabricator then this would go into server logs, but where do logs go on Arcanist? The console?

This revision is now accepted and ready to land.Jul 21 2021, 5:17 PM
src/future/exec/PhutilExecPassthru.php
34

Yeah, here's test.php running ls with execute():

$ php -f test.php                         
[2021-07-21 10:01:26] PHLOG: 'The "execute()" method of "PhutilExecPassthru" is deprecated and calls should be replaced with "resolve()". See T13660.' at [/Users/epriestley/dev/core/lib/arcanist/src/future/exec/PhutilExecPassthru.php:36]
LICENSE		NOTICE		README.md	bin		externals	resources	scripts		src		support		test.php
int(0)

It seems pretty unlikely that anyone is calling execute() and I'm usually not too dainty about breaking almost-certainly-only-internal APIs, but it was in the docblock.