php-general Digest 28 Jun 2008 07:41:05 -0000 Issue 5538

Topics (messages 276084 through 276092):

Re: fwrite() Append Files
        276084 by: Wolf
        276085 by: Wei, Alice J.

[Q] Exec'ing a command
        276086 by: Eric Gorr
        276087 by: Daniel Brown
        276088 by: Eric Gorr
        276092 by: Per Jessen

Re: How to make a "Auto View" and a "Download" Link for PDF?
        276089 by: Nitsan Bin-Nun

Re: Military Service WAS [PHP] Capitalization of variable
        276090 by: Dotan Cohen

localconv() monetary grouping
        276091 by: Ian Carter

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Wei, Alice J. wrote:
Hi,

  Right now I enforced the file to read in through HTTP-Request and output it 
to a local file.
  Looks like this functioned perfectly after I used append functions after I 
attempted to write to the file!

Thanks to everyone who contributed to this.

Alice

Are you making sure to credit the work and suggestions in your code as required by your class documentation standards?


--- End Message ---
--- Begin Message ---
________________________________________
From: Wolf [EMAIL PROTECTED]
Sent: Friday, June 27, 2008 2:18 PM
To: Wei, Alice J.
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] fwrite() Append Files

Wei, Alice J. wrote:
> Hi,
>
>   Right now I enforced the file to read in through HTTP-Request and output it 
> to a local file.
>   Looks like this functioned perfectly after I used append functions after I 
> attempted to write to the file!
>
> Thanks to everyone who contributed to this.
>
> Alice

Are you making sure to credit the work and suggestions in your code as
required by your class documentation standards?

I am working for my client who wants to get some tasks done. Had this been for 
an assignment for a class, I would probably have to contact my instructor about 
it.
Thanks for pointing it out.

--- End Message ---
--- Begin Message ---
Hopefully this will be clear.

I've got a unix command-line app which I will be exec'ing (or some other similar command) from a php script.

The special property of this unix app is that while it executes and terminates quickly, only a single instance can be running at any one time.

However, the php script can be called simultaneously and it is possible that an invalid attempt to run two or more instances of the unix app at the same time could be made.


Now, one possible solution to this problem is that the php script adds it's request to run the unix app to a queue and their is some other code which pulls a request off the queue, performs the operation and returns the data back to the php script which made the request.


Are there other solutions that I have not considered?







--- End Message ---
--- Begin Message ---
On Fri, Jun 27, 2008 at 3:12 PM, Eric Gorr <[EMAIL PROTECTED]> wrote:
>
> Now, one possible solution to this problem is that the php script adds it's
> request to run the unix app to a queue and their is some other code which
> pulls a request off the queue, performs the operation and returns the data
> back to the php script which made the request.
>
>
> Are there other solutions that I have not considered?

    Can you just add the commands to a database, and have the commands
read from there and run via cron job every n minutes?  That would
ensure that the *NIX file will only be run with a single instance, but
run over and over again.

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
On Jun 27, 2008, at 3:18 PM, Daniel Brown wrote:

On Fri, Jun 27, 2008 at 3:12 PM, Eric Gorr <[EMAIL PROTECTED]> wrote:

Now, one possible solution to this problem is that the php script adds it's request to run the unix app to a queue and their is some other code which pulls a request off the queue, performs the operation and returns the data
back to the php script which made the request.


Are there other solutions that I have not considered?

   Can you just add the commands to a database, and have the commands
read from there and run via cron job every n minutes?  That would
ensure that the *NIX file will only be run with a single instance, but
run over and over again.

Sure.

--- End Message ---
--- Begin Message ---
Eric Gorr wrote:

> Hopefully this will be clear.
> 
> I've got a unix command-line app which I will be exec'ing (or some
> other similar command) from a php script.
> 
> The special property of this unix app is that while it executes and
> terminates quickly, only a single instance can be running at any one
> time.
> 
> However, the php script can be called simultaneously and it is
> possible that an invalid attempt to run two or more instances of the
> unix app at the same time could be made.
> 
> Now, one possible solution to this problem is that the php script adds
> it's request to run the unix app to a queue and their is some other
> code which pulls a request off the queue, performs the operation and
> returns the data back to the php script which made the request.
> 
> Are there other solutions that I have not considered?

A lock file.  Your script will lock it when it's running, unlock it when
it's done.  If your script finds the file already locked, it quits. 

In practical terms, your script will check for the existence of the
file. If found, it exits. If not found, it creates it.  And removes it
when it's finished.  
Yes, the check and the creation of the lock file should preferably be
atomic, but when you're in a script language, you can't have it all.


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
Great.

Cheers,
Nitsan

On 25/06/2008, Michelle Konzack <[EMAIL PROTECTED]> wrote:
>
> Hi Nitsan,
>
> Am 2008-06-22 22:09:38, schrieb Nitsan Bin-Nun:
> > Oops
>
> :-)
>
> > ---------- Forwarded message ----------
> > From: Nitsan Bin-Nun <[EMAIL PROTECTED]>
> > Date: 21 Jun 2008 19:23
> > Subject: Re: [PHP] How to make a "Auto View" and a "Download" Link for
> PDF?
> > To: Michelle Konzack <[EMAIL PROTECTED]>
> >
> > I am not 100 percent sure that i have understood your idea,
> > but if i did
> > you can place the PDF for online view with content-disposition header*
> > *>*     Content-Disposition: inline; filename=pdf1.pdf
> > *
> > replace the *inline* with *attachment* and you get the save as dialog
>
> More simple was not possible...
> It works perfectly.
>
> Thanks, Greetings and nice Day/Evening
>    Michelle Konzack
>    Systemadministrator
>    24V Electronic Engineer
>    Tamay Dogan Network
>    Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> ##################### Debian GNU/Linux Consultant #####################
> Michelle Konzack   Apt. 917                  ICQ #328449886
> +49/177/9351947    50, rue de Soultz         MSN LinuxMichi
> +33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)
>
>

--- End Message ---
--- Begin Message ---
2008/6/25 Michelle Konzack <[EMAIL PROTECTED]>:
> Am 2008-06-23 21:17:13, schrieb Dotan Cohen:
>> 2008/6/22 Michelle Konzack <[EMAIL PROTECTED]>:
>> > I know at least on Jew, which was 1 1/2 years in the french
>> > army for his "service national" and then 5 years in Israel.
>> >
>>
>> That was very likely not compulsory service. Especially if he served  years.
>
> He has French citizenship and is Jew like many others here.
> And they all go to Israel to serv since the have the choice/right, to do
> the "national service" in France or in Israel...
>

I still do not believe that he had to do 5 years in the IDF by Israeli
law. Unless he signed up as an officer, which he could have chosen not
to do.

>> What is the English/French name of the French non-Frenchmen reserve
>> army? They are very well respected.
>
> Légion Etrangère Français  =  French Foreign Legion
>

Thanks. _That_ is an army that I very much respect.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

--- End Message ---
--- Begin Message ---
Looking through the PHP 5 docs regarding the information returned by
localconv(), I am not sure what the 'grouping' and 'mon_grouping' elements
refer to.

Can someone explain to me why in the example shown ('[EMAIL PROTECTED]'), the
grouping array is empty and the mon_grouping array has two elements of '3'
each.

Thanks, Ian.



--- End Message ---

Reply via email to