Linked by Thom Holwerda on Tue 19th May 2009 21:03 UTC
General Development Learn how to better integrate scripts with command-line tools. Examine using shell_exec(), exec(), passthru(), and system(); safely passing information to the command line; and safely retrieving information from it. See how to integrate closely with underlying shell commands and folding any return values into your interfaces and processes.
Order by: Score:
Suggustions for improvement
by Bill Shooter of Bul on Wed 20th May 2009 05:50 UTC
Bill Shooter of Bul
Member since:

I don't want to be overly harsh in my criticism, but this is fairly basic. The whole article could be compressed to ;) You can call commands line programs and out put them to a web site with php See for details )I know someone at ibm decided it was worthy of publishing on developer works, so I can hardly criticize Osnews for linking.

Its true some people might not realize it, or even think about it as a possibility. Maybe it would be a good idea to categorize articles like this by language or development type ( Php, web development, shell scripting) that would make finding it easier. OSNews could be more than just news about OS es. It could be news about OSes, how to build them, the applications that run on them, and take over the world. The one stop shop for world domination.

Reply Score: 1

RE: Suggustions for improvement
by zegenie on Wed 20th May 2009 06:10 UTC in reply to "Suggustions for improvement"
zegenie Member since:

Although it is true that this is fairly basic stuff, PHP is still often overlooked when it comes to command line programming.

Creating awereness is good, even if it is just about the basics.

Reply Score: 2

RE[2]: Suggustions for improvement
by kajaman on Wed 20th May 2009 10:46 UTC in reply to "RE: Suggustions for improvement"
kajaman Member since:

I would say it's overlooked not without a reason. I can't find any advantages other than developers being cheap and easy to find, to use PHP for command line scripting.

Well, the reason above might be good enough on the other hand ;)

Reply Score: 1

HiMAcks Member since:

I resent that....I am NOT easy to find.

Reply Score: 2

slight Member since:

Our CMS has a CLI based interface that authenticates users based on their unix account (the web app stores an optional unix account name in the user record) so you can execute commands with the same permissions you could via the web interface.

Comes in very handy, especially for cron integration.

Reply Score: 2

Hook it into your CMS
by destraht on Thu 21st May 2009 00:24 UTC
Member since:

Lets say that you are using Mediawiki, Wordpress or Drupal, what you can do is hack a few lines into the index.php file that check for some command line arguments. Then you can allow CLI maintenance scripts to use the same DB information and connection know-how to get at your data. I think that it allows for tighter integration and reduces code.

Reply Score: 1