Doc #66190 [Opn->Nab]: Instructions to register PHP as interpreter for associated scripts needs fix
| From: | cmb@php.net | Date: | Sat, 18 Jun 2016 11:25:41 +0000 |
| Subject: | Doc #66190 [Opn->Nab]: Instructions to register PHP as interpreter for associated scripts needs fix | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13553@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66190&edit=1
ID: 66190
Updated by: cmb@php.net
Reported by: anrdaemon at yandex dot ru
Summary: Instructions to register PHP as interpreter for
associated scripts needs fix
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
When I do a
ftype /? on Windows 10, I see the following example:
| ASSOC .pl=PerlSkript
| FTYPE PerlSkript=perl.exe %1 %*
So it's rather unlikely that this will break sometimes.
> The "%~2" notation is CMD (and more specifically - CMD batch
> file) specific.
In this case it is specific to ftype:
| %~ n is replaced with all of the remaining parameters, starting
| with the nth parameter, where n can be any number from 2 to 9.
So the usage appears to be correct.
> I suggest using PHPScript for file type name [â¦]
It seems to me that PHPScript is obsolete, anyway.
Previous Comments:
------------------------------------------------------------------------
[2013-11-28 09:28:31] anrdaemon at yandex dot ru
Description:
------------
---
From manual page: http://www.php.net/install.windows.commandline
---
First, the order in which extension is registered is illogical, it only works because CMD does not
check the presence of a file type, when adding an association.
But you MUST NOT rely on bugs.
You should create a file type first, then associate extensions with it.
Second, the suggested file type command prevent execution of a script with more than one argument
(if at all functional - on my installation, it passing literal "%~2" to executing script).
It must be changed to something like
ftype phpfile="C:\PHP5\php.exe" -f "%1" -- %*
to make it work with any number of arguments.
The "%~2" notation is CMD (and more specifically - CMD batch file) specific. When
executing file type association, CMD is NOT used.
And third, I suggest using PHPScript for file type name, the same name used in PECL ActiveScript
SAPI, to keep all associations in one place.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66190&edit=1