php-general Digest 29 May 2013 12:03:48 -0000 Issue 8250

Topics (messages 321222 through 321226):

Re: need some regex help to strip out // comments but not http:// urls
        321222 by: David Harkness
        321223 by: Daevid Vincent
        321224 by: David Harkness
        321225 by: Andreas Perstinger

Webpage Persistence Load balancing
        321226 by: Al

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 ---
Hi Daevid,

On Tue, May 28, 2013 at 2:17 PM, Daevid Vincent <dae...@daevid.com> wrote:

> I'm adding some minification to our cache.class.php . . .


We have been using a native jsmin extension [1] which does a lot more
without any trouble for over two years now. It's much faster than the
equivalent PHP solution and is probably tested by a lot more people than a
home-grown version. You might want to check it out before going too far
down this path.

Good luck,
David

[1] http://www.ypass.net/software/php_jsmin/

--- End Message ---
--- Begin Message ---
> From: David Harkness [mailto:davi...@highgearmedia.com]
> 
> We have been using a native jsmin extension [1] which does a lot more
> without any trouble for over two years now. It's much faster than the
> equivalent PHP solution and is probably tested by a lot more people than a
> home-grown version. You might want to check it out before going too far
> down this path.
> 
> Good luck,
> David
> 
> [1] http://www.ypass.net/software/php_jsmin/

I appreciate the pointer, but our files, like many people, is a mixture of
HTML, PHP and JS in one file. This jsmin appears to only work on .js files
right? Also, everything else works great in our minifing method, just this
edge case.


--- End Message ---
--- Begin Message ---
Hi Daevid,

On Tue, May 28, 2013 at 2:40 PM, Daevid Vincent <dae...@daevid.com> wrote:

> I appreciate the pointer, but our files, like many people, is a mixture of
> HTML, PHP and JS in one file. This jsmin appears to only work on .js files
> right? Also, everything else works great in our minifing method, just this
> edge case.


My bad. We moved all our JS and CSS to external files for this very reason
and created a plugin to combine and minify everything needed by each page
into a unique file. While it does cause some duplication across pages, it
means that every page loads exactly one JS and CSS file each.

For your situation, I don't know a regular expression that will work in all
cases.

David

--- End Message ---
--- Begin Message ---
On 28.05.2013 23:17, Daevid Vincent wrote:
I'm adding some minification to our cache.class.php and am running into an
edge case that is causing me grief.

I want to remove all comments of the // variety, HOWEVER I don't want to
remove URLs...


You need a negative look behind assertion
( http://www.php.net/manual/en/regexp.reference.assertions.php ).

"(?<!http:)//" will match "//" only if it isn't preceded by "http:".

Bye, Andreas

--- End Message ---
--- Begin Message ---
I'm having a webpage Persistence problem, it is intermittent.  I suspect it is 
caused by load-balancing.

Specifically:

Users are connected to a webpage form to complete. Generally, everything is OK if they take a minute or even more to complete the form. However, sometimes they report to me, and I've seen it myself, the connection has been dropped by the server in a short time. They enter the data and Submit it to the server, and the page just reloads and their data is lost.

I have the PHP ignore_user_abort(true); etc.

Is there anything I can do to fix this or is it a server issue that you must 
fix?

Thanks, Al.........

--- End Message ---

Reply via email to