FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Only Allow exec in CLI
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Only Allow exec in CLI [message #179189 is a reply to message #179187] Mon, 24 September 2012 18:07 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <k3pt3a$44d$1(at)news(dot)albasani(dot)net>,
The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

> Erwin Moller wrote:
>> On 9/24/2012 2:54 PM, The Natural Philosopher wrote:
>>> Tim Streater wrote:
>>>> In article <k3ph16$7ur$5(at)news(dot)albasani(dot)net>,
>>>> The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

>>>> > I cant imagine why anyone would put PHP in a cron job to start with.
>>>> >
>>>> > Shell script or C, or both...
>>>>
>>>> Neither. PHP is a lot easier to write and I can't see that there's
>>>> going to be a great deal that you can't do in PHP that you can with
>>>> the others. Unless you need every last CPU cycle of course.
>>>>
>>> Actually there is a very great deal you can do in C that you cant do in
>>> PHP.
>>>
>>> Multitasking for one thing.
>>>
>>
>> Of course there are many things you can do in C and not in PHP.
>> Like writing drivers for your graphics card.
>>
>> But realistically, what multitasking cronjobs do you exactly envision
>> here? I cannot think of one.

> Multitasking *for one thing*. Not the only difference. ONE difference.
>
> There are dozens more libraries doing custom stuff better than PHP .
>
> Else why would the OP NEED to 'exec'?

Prolly to do specific things that you can't do in PHP. Hmmm, furtle,
furtle:

Looks like I do it:

1) to open a file using the designated app for the file, in a window on
the user's screen. So I do:

$cmd = "/usr/bin/open \"" . $filename . "\" 2>&1";
exec ($cmd, $results, $result);

or possibly:

exec ("/usr/bin/open -a Safari.app 'http://...");


2) Starting and stopping apache, as in:

$cmd = "/usr/sbin/httpd -f \"" . $fno . "\" 2>&1";
exec ($cmd, $results, $result);

or the same with -k stop.

But I agree, these are not in cron jobs. Although if I had a cron job to
run I'd prolly do it in PHP if at all possible.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Advice for Literature on PHP-Based Web Development Business Models
Next Topic: Count how many times a value occurs in an array
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 08 17:35:41 GMT 2024

Total time taken to generate the page: 0.05729 seconds