php-general Digest 8 Nov 2008 12:56:47 -0000 Issue 5779

Topics (messages 283090 through 283093):

Re: PCRE regex result is different between Linux & Windows.
        283090 by: ClapClap
        283093 by: Lupus Michaelis

Re: object persistence within a session
        283091 by: Shawn McKenzie
        283092 by: Andrew Ballard

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 ---
Jochem Maas a écrit :
>>
>> [I precede you, sorry for language mistakes...]
>
> php or english? :-)
>

ohhh... sh.. ! I think I speak PHP better than english (silly, not ?).

>
> okay, are you using the same PHP version on both machines?
> anything in the php.ini's that differs?
>

The same, not possible (Windows/Linux).
For php.ini, quite the same (some directories are different).
Under Windows (PHP 5.1.6 on 2k SP4 / 5.2.4 on XP SP2, the officials).
Under Linux (Ubuntu 8.04) 5.2.4-2ubuntu5.3.

> are you possibly looking at an input/file character-set encoding related
> issue? (i.e. encoding is different between the two servers)?
>

All PHP source is written in UTF-8.
I take the HTML code and convert it to UTF-8 using iconv() / mbstring...

> can you post a short complete script to see if others can reproduce the
> error?
>

See the following link for the bogus test (Must match : windows = 90, linux = 54): http://pastebin.com/m1c43cc10

The same results are given when :
- comments are removed
- with 'm' or 's' PCRE options
- recursion is removed (multiple parses in while statement (matches for each pass : 55, 26, 5, 2))

This snippet is used in a part of code which goal is to convert HTML from Word 2003 to valid XHTML. But that is not the subject...

For the PCRE version, I really can not tell you which one I use...
Where can I see that ?

So, It may be a bug ? Too bad...

>
> have you tried to use the Tidy extension to clean up the input string?,
> it has alsorts of wonderful settings for making (x)HTML nice an shiny.
>

You think I have already tried it. ;-)
Tidy is too agressive for parsing HTML from MS Office...

Hope it will work.... :-/

--
Julien


--- End Message ---
--- Begin Message ---
ClapClap a écrit :

For the PCRE version, I really can not tell you which one I use...
Where can I see that ?

  In the the output from phpinfo function.

So, It may be a bug ? Too bad...

I remember some change behavior recently in PCRE. But I am not sure, I want just to drop this option first.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

--- End Message ---
--- Begin Message ---
tedd wrote:
> At 7:08 PM +0100 11/7/08, Jochem Maas wrote:
>> Stan schreef:
>>>  If this is the wrong forum, please point me at the correct forum.
>>>
>>>  I am new to PHP but have 40 years experience programming.
>>
>> cool. we're you around when they programmed with Rocks[tm]? :-)
>> (stick around a while and you'll get to know that inside joke)
> 
> 
> Rocks?! Did someone say Rocks? Did I ever tell you about programming
> with rocks....
> 
> Egads, not another old fart.  :-)
> 
> Well, welcome to the group oldster and get ready to learn from these
> up-starts. I don't know when these youngsters passed me, but they did.
> 
> Cheers,
> 
> ted
> 
Stan is a young whipper - snapper.

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
On Fri, Nov 7, 2008 at 3:54 PM, Stan <[EMAIL PROTECTED]> wrote:
> Andrew,
> Do I feel stupid!
> Thanks.

Welcome to the list. No need to feel stupid, and you're welcome. We
were all here at some point. Even tedd, who has been programming since
Rocks apparently. :-) At least you read up on the language and took a
stab at a solution before you came looking for help. That's a lot more
than can be said for some of the requests that show up on this list.

Just something to keep in mind based on your description of the
project. (You said you were trying to avoid repeated database calls on
each request.) PHP sessions are usually stored in the file system
(unlike ASP sessions that are stored in memory). Therefore there will
be some overhead with sessions as well. (The server has to read the
cookie, find the corresponding file, compare the modified time of the
file to make sure the session hasn't expired, read the file into
memory, and unserialize the data into variables.) You may want to
experiment from project to project while you're getting used to the
language until find the right balance of how much you store in
sessions versus how often you repeat trips to the database.

I usually use the database to store session information so that it is
available regardless of which server handles a request in a clustered
environment. I've found that I don't mind a few well organized
database calls per page for the information I need. I know some people
on this list have forgone sessions altogether in favor of other
approaches.

Andrew

--- End Message ---

Reply via email to