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