Opened 13 years ago

Last modified 4 years ago

#29658 assigned enhancement

phpstylist should use MacPorts PHP — at Version 9

Reported by: face@… Owned by: rudloff@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch maintainer Cc: ryandesign@…
Port: phpstylist

Description (last modified by ryandesign (Ryan Carsten Schmidt))

phpstylist uses the Mac OS X version of PHP

The patch file (see Revision 79013, 314 bytes (checked in by ryandesign@…, 30 hours ago) adds

#!/usr/bin/php

to the code. Wouldn't it be more in keeping with MacPorts to make that

#!/usr/bin/env php

Change History (10)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Owner: changed from macports-tickets@… to rudloff@…

I thought about that. On the other hand, it apparently works with Mac OS X's version of PHP. Would bringing MacPorts PHP with all its dependencies add any value to phpstylist?

comment:2 Changed 13 years ago by rudloff@…

phpStylist requires PHP 4.4.2, so it works perfectly with /usr/bin/php (4.4.9).
Installing the php port and all its dependencies seems like overkill for such a small utility.

comment:3 Changed 13 years ago by face@…

fine by me - just noticed it and wondered why.

Seems odd that "installing the php port" would be overkill. Macports to get a php styling utility, but only using the Apple version of php.

comment:4 Changed 13 years ago by rudloff@…

Is there a way to use the port if it is installed and the Mac OS version if not ?

comment:5 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Yes; the proposal in the ticket description would do that (i.e. just change "#!/usr/bin/php" in the script to "#!/usr/bin/env php" without adding any dependency). Would that be beneficial? I'm worried it would introduce greater uncertainty. Currently, there are three possible PHP versions phpstylist in MacPorts might use: those provided by Snow Leopard, Leopard, and Tiger. If we let it use the php5 port, that makes two additional possible versions: those provided by php5 and php5-devel. Indeed, the greatest consistency can be had by requiring the use of MacPorts PHP, as is our usual policy, but I agree it is a heavy dependency, especially since by default it would bring apache2 with it.

comment:6 Changed 13 years ago by rudloff@…

phpStylist is not a very complex program and the readme says it has been tested with PHP from 4.4.2 to 5.2.2. I don't think letting people use a different version of PHP will cause problems. But if someone finds a problem with PHP 5.3, I don't mind writing a patch.

However, I totally understand if you want to add the php port as a dependency.

Changed 8 years ago by rudloff@…

Attachment: phpstylist.diff added

Patch

comment:7 Changed 8 years ago by rudloff@…

Here is a patch that adds php as a dependency and changes the shebang.

comment:8 Changed 8 years ago by mf2k (Frank Schima)

Keywords: haspatch maintainer added
Version: 1.9.2

comment:9 in reply to:  7 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

Replying to rudloff@…:

Here is a patch that adds php as a dependency and changes the shebang.

Does making this change fix some problem? Does using the OS X version of php no longer work, for example because newer versions of OS X include newer versions of php?

Since your proposed patch changes the files the port installs, the port's revision must be increased.

The patch is not correct: it adds a port:php52 dependency and changes the shebang line to "#!/usr/bin/env php", but the php52 port does not provide a program called php; it provides a program called php52. (This has changed in the years since this ticket was filed.) If you're declaring a hard dependency on the php52 port, then you should make sure the program installed by the php52 port is the one that gets used, by making the shebang line "#!${prefix}/bin/php52".

php52 is end of life, as is php53. If phpstylist will work with later versions of php, those should be used instead. But if not—if the whole purpose of this change is to prevent newer incompatible versions of php from being used by this 8-year-old software—then using php52 is fine.

Note: See TracTickets for help on using tickets.