File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -483,10 +483,32 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and
483
483
However, it is possible to pass a callback to the ``start ``, ``run `` or ``mustRun ``
484
484
methods to handle process output in a streaming fashion.
485
485
486
+
487
+ Finding an Executable
488
+ ---------------------
489
+
490
+ The Process Component component provides a utility class called
491
+ :class: `Symfony\\ Component\\ Process\\ ExecutableFinder ` which finds
492
+ and returns the absolute path of an executable::
493
+
494
+ use Symfony\Component\Process\ExecutableFinder;
495
+
496
+ $executableFinder = new ExecutableFinder();
497
+ $chromedriverPath = $executableFinder->find('chromedriver');
498
+ // $chromedriverPath = '/usr/local/bin/chromedriver' (the result will be different on your computer)
499
+
500
+ The :method: `Symfony\C omponent\P rocess\E xecutableFinder::find ` method also takes extra parameters to specify a default value
501
+ to return and extra directories where to look for the executable::
502
+
503
+ use Symfony\Component\Process\ExecutableFinder;
504
+
505
+ $executableFinder = new ExecutableFinder();
506
+ $chromedriverPath = $executableFinder->find('chromedriver', '/path/to/chromedriver', ['local-bin/']);
507
+
486
508
Finding the Executable PHP Binary
487
509
---------------------------------
488
510
489
- This component also provides a utility class called
511
+ This component also provides a special utility class called
490
512
:class: `Symfony\\ Component\\ Process\\ PhpExecutableFinder ` which returns the
491
513
absolute path of the executable PHP binary available on your server::
492
514
You can’t perform that action at this time.
0 commit comments