php-general Digest 22 Nov 2011 12:15:44 -0000 Issue 7580

Topics (messages 315786 through 315789):

Re: include
        315786 by: Tamara Temple

Re: Sniping on the List
        315787 by: Tedd Sperling
        315789 by: Judson Vaughn

Re: PHP script won't run in the background
        315788 by: Laruence

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Tim Streater <t...@clothears.org.uk> wrote:
> I'm looking for confirmation that:
> 
>   include $fn;
> 
> is an allowed form of the include statement.

Yes, it is definitely allowed. The syntactic sugar of using parens
around the include subject is optional, as it is in other parts of php
as well. That said, it's usually better to include the syntactic sugar
so as to make future maintenance concerns easier -- there's less chance
of a future change to introduce an error if it's clear what things are
grouped with what. Much less of a concern in this case, but more of a
concern in, say, compound expressions.

<?php
$fn="foo.ext";
include $fn;
include "$fn";
include ($fn);
include ("$fn");
?>

are all equivalent, because php interpolates variable references in
double quoted strings.

<?php
include '$fn';
?>

however is not.

> > While it's certainly possible to rig up something using sockets, I don't
> > think that's how AJAX works, and you'd need a JS library that did.
> 
> Hmmm, I think perhaps I've not made myself clear - sorry about that. At 
> present I'm using AJAX and apache; I'd like to *stop* doing that (and not use 
> another web server, either). In my case, client and server are the same 
> machine - the user's machine. There is a browser window and JavaScript within 
> it which makes the AJAX requests. I just happen to use apache to have a 
> variety of PHP scripts run to provide results back to the browser window.
> 
> > Generally, you should only really need to dynamically replace parts of a
> > long-running program if you don't want to restart it. However, php
> > scripts are not long-running programs in general, unlike the apache
> > server itself, for example, and certainly if the php scripts are running
> > under apache, they will be time- and space-limited by whatever is set in
> > the php.ini file. If these little scripts are merely responding to AJAX
> > requests, they should be really short-lived.
> 
> At present these scripts generally are short-lived, but with some notable 
> exceptions. Hence my exploration of whether I could use websockets instead.

Ah, okay, I'm not at all familiar with websockets, so I'm going to have
to step out of this. Good luck with it!

--- End Message ---
--- Begin Message ---
On Nov 20, 2011, at 4:59 PM, Geoff Shang wrote:

> On Sun, 20 Nov 2011, Tedd Sperling wrote:
> 
>> I appreciate your time and comments. However, you missed the point I was 
>> trying to make, which does not have anything to do with timezones. If you 
>> copy my code and place it on any server in the world, you'll observe the 
>> same results as I did.
> 
> NO I won't, and timezones do matter.
> 
> This server is set to UTC and uses PHP 5.2.6.
> 
> Lets skip right to your point.
> 
> From your script on your server:
> 
> String Given: null
> 
> Seconds Computed from String: null
> 
> Date from Seconds Computed: 31 December, 1969 : Wednesday
> ___________________________________________________________________________
> 
> From the script on my server:
> 
>   String Given: null
> 
>   Seconds Computed from String: null
> 
>   Date from Seconds Computed: 1 January, 1970 : Thursday
>     __________________________________________________________________

Geoff:

Hmmm, granted your output is different than mine. But I think there is 
something else beside timezones going on here, but I could be wrong.

My server is set to America New York (+5 hours) and uses PHP version 5.2.17

Let's consider this -- you are in a different time zone than me, right? You 
said UTC and mine is America New York. As such you claim is that your 
strtotime() function will return a different result for you as compared to me 
because of the time zone differences, right?

If so, then tell me why I can take both sites (your and mine) and click the 
Submit buttons at the same time and the forms will report back the exact same 
number of elapsed seconds. Try it (you got to be quick):

http://www.webbytedd.com/cccc/strtotime/index.php
http://quitelikely.com/~geoff/strtotime/index.php

Why is that? By what you said, shouldn't the reports be offset (+5 hours) by 
the local timezone differences?

What am I not understanding here?

Cheers,

tedd


_____________________
t...@sperling.com
http://sperling.com

--- End Message ---
--- Begin Message ---
Isn't Eastern time zone minus 5 not plus 5 hours of GMT? 

Jud

Sent from my iPad
Jud at bizville.com
Phone 703-303-4271

On Nov 21, 2011, at 11:34 PM, Tedd Sperling <tedd.sperl...@gmail.com> wrote:

> Why is that? By what you said, shouldn't the reports be offset (+5 hours) by 
> the local timezone differences?

--- End Message ---
--- Begin Message ---
On Sat, Nov 19, 2011 at 11:27 PM, richard gray <r...@richgray.com> wrote:
>
>> Laruence, while that may be a helpful answer to a few people in the know,
I think a clue is better, leave some space for the people to dance.  :)
>> just replying back with a single line like that isn't really going to help
>> the people who are having this problem. At least explain why you suggested
>> that, or what it does for those on the list that don't know, especially as
>> it's not a PHP thing, it's a Unix command thing.
>>
>> Richard, some more info on the command Laruence mentioned can be found at
>> http://docstore.mik.ua/orelly/unix/upt/ch12_07.htm which explains it in more
>> detail.
>>
> not sure this is relevant as my script is not trying to write to the
> terminal the >test.log 2>&1 is sending stdout and stderr to the log file not
> the tty...

did you run php with readline?  try run the script without php-readline.

thanks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--- End Message ---

Reply via email to