@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use `new FutureIterator` instead of `Futures`

Summary: Ref T6829. Deprecate the `Futures()` function.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6829

Differential Revision: https://secure.phabricator.com/D11077

+37 -19
+3 -1
scripts/symbols/generate_ctags_symbols.php
··· 30 30 $futures[$file] = ctags_get_parser_future($file); 31 31 } 32 32 33 - foreach (Futures($futures)->limit(8) as $file => $future) { 33 + $futures = id(new FutureIterator($futures)) 34 + ->limit(8); 35 + foreach ($futures as $file => $future) { 34 36 $tags = $future->resolve(); 35 37 $tags = explode("\n", $tags[1]); 36 38
+3 -1
scripts/symbols/generate_php_symbols.php
··· 23 23 $futures[$file] = xhpast_get_parser_future($data[$file]); 24 24 } 25 25 26 - foreach (Futures($futures)->limit(8) as $file => $future) { 26 + $futures = id(new FutureIterator($futures)) 27 + ->limit(8); 28 + foreach ($futures as $file => $future) { 27 29 $tree = XHPASTTree::newFromDataAndResolvedExecFuture( 28 30 $data[$file], 29 31 $future->resolve());
+1 -1
src/applications/differential/parser/DifferentialChangesetParser.php
··· 653 653 ); 654 654 655 655 $this->highlightErrors = false; 656 - foreach (Futures($futures) as $key => $future) { 656 + foreach (new FutureIterator($futures) as $key => $future) { 657 657 try { 658 658 try { 659 659 $highlighted = $future->resolve();
+3 -1
src/applications/diffusion/DiffusionLintSaveRunner.php
··· 250 250 251 251 $authors = array(); 252 252 253 - foreach (Futures($futures)->limit(8) as $path => $future) { 253 + $futures = id(new FutureIterator($futures)) 254 + ->limit(8); 255 + foreach ($futures as $path => $future) { 254 256 $queries[$path]->loadFileContentFromFuture($future); 255 257 list(, $rev_list, $blame_dict) = $queries[$path]->getBlameData(); 256 258 foreach (array_keys($this->blame[$path]) as $line) {
+1 -1
src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php
··· 129 129 ); 130 130 $futures = array_filter($futures); 131 131 132 - foreach (Futures($futures) as $key => $future) { 132 + foreach (new FutureIterator($futures) as $key => $future) { 133 133 $stdout = ''; 134 134 try { 135 135 list($stdout) = $future->resolvex();
+2 -1
src/applications/diffusion/conduit/DiffusionTagsQueryConduitAPIMethod.php
··· 129 129 $tag->getName()); 130 130 } 131 131 132 - Futures($futures)->resolveAll(); 132 + id(new FutureIterator($futures)) 133 + ->resolveAll(); 133 134 134 135 foreach ($tags as $key => $tag) { 135 136 $future = $futures[$key];
+3 -1
src/applications/diffusion/controller/DiffusionBrowseSearchController.php
··· 132 132 } 133 133 134 134 try { 135 - Futures($futures)->limit(8)->resolveAll(); 135 + id(new FutureIterator($futures)) 136 + ->limit(8) 137 + ->resolveAll(); 136 138 } catch (PhutilSyntaxHighlighterException $ex) {} 137 139 138 140 $rows = array();
+8 -4
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
··· 445 445 $ref_new); 446 446 } 447 447 448 - foreach (Futures($futures)->limit(8) as $key => $future) { 448 + $futures = id(new FutureIterator($futures)) 449 + ->limit(8); 450 + foreach ($futures as $key => $future) { 449 451 450 452 // If 'old' and 'new' have no common ancestors (for example, a force push 451 453 // which completely rewrites a ref), `git merge-base` will exit with ··· 554 556 } 555 557 556 558 $content_updates = array(); 557 - foreach (Futures($futures)->limit(8) as $key => $future) { 559 + $futures = id(new FutureIterator($futures)) 560 + ->limit(8); 561 + foreach ($futures as $key => $future) { 558 562 list($stdout) = $future->resolvex(); 559 563 560 564 if (!strlen(trim($stdout))) { ··· 709 713 710 714 // Resolve all of the futures now. We don't need the 'commits' future yet, 711 715 // but it simplifies the logic to just get it out of the way. 712 - foreach (Futures($futures) as $future) { 716 + foreach (new FutureIterator($futures) as $future) { 713 717 $future->resolve(); 714 718 } 715 719 ··· 782 786 } 783 787 784 788 $head_map = array(); 785 - foreach (Futures($dfutures) as $future_head => $dfuture) { 789 + foreach (new FutureIterator($dfutures) as $future_head => $dfuture) { 786 790 list($stdout) = $dfuture->resolvex(); 787 791 $descendant_heads = array_filter(explode("\1", $stdout)); 788 792 if ($descendant_heads) {
+1 -1
src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
··· 142 142 } 143 143 144 144 $results = array(); 145 - foreach (Futures($futures) as $ref => $future) { 145 + foreach (new FutureIterator($futures) as $ref => $future) { 146 146 try { 147 147 list($stdout) = $future->resolvex(); 148 148 } catch (CommandException $ex) {
+3 -1
src/applications/diviner/workflow/DivinerGenerateWorkflow.php
··· 333 333 $atom_cache = $this->getAtomCache(); 334 334 $bar = id(new PhutilConsoleProgressBar()) 335 335 ->setTotal(count($futures)); 336 - foreach (Futures($futures)->limit(4) as $key => $future) { 336 + $futures = id(new FutureIterator($futures)) 337 + ->limit(4); 338 + foreach ($futures as $key => $future) { 337 339 try { 338 340 $atoms = $future->resolveJSON(); 339 341
+1 -1
src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php
··· 70 70 71 71 $results = array(); 72 72 $failed = array(); 73 - foreach (Futures($futures) as $key => $future) { 73 + foreach (new FutureIterator($futures) as $key => $future) { 74 74 try { 75 75 $results[$key] = $future->resolve(); 76 76 } catch (Exception $ex) {
+1 -1
src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php
··· 57 57 58 58 $results = array(); 59 59 $failed = array(); 60 - foreach (Futures($futures) as $key => $future) { 60 + foreach (new FutureIterator($futures) as $key => $future) { 61 61 try { 62 62 $results[$key] = $future->resolveJSON(); 63 63 } catch (Exception $ex) {
+1 -1
src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
··· 234 234 HarbormasterBuildTarget $target, 235 235 Future $future) { 236 236 237 - $futures = Futures(array($future)); 237 + $futures = new FutureIterator(array($future)); 238 238 foreach ($futures->setUpdateInterval(5) as $key => $future) { 239 239 if ($future === null) { 240 240 $build->reload();
+1 -1
src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php
··· 65 65 $build_update = 5; 66 66 67 67 // Read the next amount of available output every second. 68 - $futures = Futures(array($future)); 68 + $futures = new FutureIterator(array($future)); 69 69 foreach ($futures->setUpdateInterval(1) as $key => $future_iter) { 70 70 if ($future_iter === null) { 71 71
+4 -1
src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php
··· 43 43 44 44 $bar = id(new PhutilConsoleProgressBar()) 45 45 ->setTotal(count($futures)); 46 - foreach (Futures($futures)->limit(8) as $full_path => $future) { 46 + 47 + $futures = id(new FutureIterator($futures)) 48 + ->limit(8); 49 + foreach ($futures as $full_path => $future) { 47 50 $bar->update(1); 48 51 49 52 $tree = XHPASTTree::newFromDataAndResolvedExecFuture(
+1 -1
src/infrastructure/lint/linter/PhabricatorJavelinLinter.php
··· 50 50 $futures[$path] = $future; 51 51 } 52 52 53 - foreach (Futures($futures)->limit(8) as $path => $future) { 53 + foreach (id(new FutureIterator($futures))->limit(8) as $path => $future) { 54 54 $this->symbols[$path] = $future->resolvex(); 55 55 } 56 56 }