note 51359 deleted from features.commandline by cmb
| From: | cmb@php.net | Date: | Sun, 30 Jun 2019 09:53:43 +0000 |
| Subject: | note 51359 deleted from features.commandline by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211439@lists.php.net to get a copy of this message | ||
Note Submitter: merrittd at dhcmc dot com
----
Example 43-2 shows how to create a DOS batch file to run a PHP script form the command line using:
@c:\php\cli\php.exe script.php %1 %2 %3 %4
Here is an updated version of the DOS batch file:
@c:\php\cli\php.exe %~n0.php %*
This will run a PHP file (i.e. script.php) with the same base file name (i.e. script) as the DOS
batch file (i.e. script.bat) and pass all parameters (not just the first four as in example 43-2)
from the DOS batch file to the PHP file.
This way all you have to do is copy/rename the DOS batch file to match the name of your PHP script
file without ever having to actually modify the contents of the DOS batch file to match the file
name of the PHP script.