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 @@ -498,10 +498,32 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and
498
498
However, it is possible to pass a callback to the ``start ``, ``run `` or ``mustRun ``
499
499
methods to handle process output in a streaming fashion.
500
500
501
+
502
+ Finding an Executable
503
+ ---------------------
504
+
505
+ The Process component provides a utility class called
506
+ :class: `Symfony\\ Component\\ Process\\ ExecutableFinder ` which finds
507
+ and returns the absolute path of an executable::
508
+
509
+ use Symfony\Component\Process\ExecutableFinder;
510
+
511
+ $executableFinder = new ExecutableFinder();
512
+ $chromedriverPath = $executableFinder->find('chromedriver');
513
+ // $chromedriverPath = '/usr/local/bin/chromedriver' (the result will be different on your computer)
514
+
515
+ The :method: `Symfony\\ Component\\ Process\\ ExecutableFinder::find ` method also takes extra parameters to specify a default value
516
+ to return and extra directories where to look for the executable::
517
+
518
+ use Symfony\Component\Process\ExecutableFinder;
519
+
520
+ $executableFinder = new ExecutableFinder();
521
+ $chromedriverPath = $executableFinder->find('chromedriver', '/path/to/chromedriver', ['local-bin/']);
522
+
501
523
Finding the Executable PHP Binary
502
524
---------------------------------
503
525
504
- This component also provides a utility class called
526
+ This component also provides a special utility class called
505
527
:class: `Symfony\\ Component\\ Process\\ PhpExecutableFinder ` which returns the
506
528
absolute path of the executable PHP binary available on your server::
507
529
You can’t perform that action at this time.
0 commit comments