Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Tomas Kuliavas
2011.03.15 23:08 Olivier Hoareau rašė: > Hi Tomas ! > > Thanks for your proposals. > > >> Create .deb package and make it dependent on PHP for Debian/Ubuntu. >> Debian >> has docs and tools that allow to do that. PHP is in standard >> Debian/Ubuntu >> software repository. >> > > This solution does

[PHP-DEV] [patch] Session RSHUTDOWN, shutdown_destructors() issues

2011-03-15 Thread Tim Starling
This is a followup to http://bugs.php.net/bug.php?id=54157 . Johannes said I should post here. In the course of my MediaWiki development work, I hit a strange issue involving session_set_save_handler(). PHP's built-in session handler is pretty much useless when you have more than one server servi

Re: [PHP-DEV] Package php binaries + php script into one singleexecutable file

2011-03-15 Thread Alec
I actually wrote that. I never imagined someone would actually find that useful! If you don't mind having a few external dlls, you can use dl (ick!) to load the extensions. I gave up supporting that because compiling the custom lightweight stubs took more work than I cared for. I am consider

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Olivier Hoareau
Found one interesting tool named PHPACK : http://winbinder.org/forum/viewtopic.php?f=8&t=1148 (windows only) Tool is no more supported (ended mid-2010), but seems to be working with PHP 5.3. What it does : package php5ts.dll + custom php script

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Olivier Hoareau
Hi Tomas ! Thanks for your proposals. > Create .deb package and make it dependent on PHP for Debian/Ubuntu. Debian > has docs and tools that allow to do that. PHP is in standard Debian/Ubuntu > software repository. > This solution does not provide me one of the goal I need to reach : that my us

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Tomas Kuliavas
2011.03.15 22:09 Olivier Hoareau rašė: > Hi ! > > I would like to be able to "distribute" (freely) a single executable > (binary) containing : > > - php binaries (v 5.3+) > - a php script already packaged as a .phar (1 Mb, requiring PHP 5.3+) > - additional (optional) compiled extensions > - php.in

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Olivier Hoareau
> > Hi Olivier, > Hi ! > Could you be a little more specific about what questions you have? Is it to > do with the licensing or physically how to go about achieving your aim? > technical point : how to go about achieving my aim ;) Ideas : - specific compilation of PHP (I am newbee, but there

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread James Butler
Hi Olivier, Could you be a little more specific about what questions you have? Is it to do with the licensing or physically how to go about achieving your aim? Regards, James -- James Butler Sent from my iPhone On 15 Mar 2011, at 20:02, "Olivier Hoareau" wrote: > Hi ! > > I would like to be

[PHP-DEV] Re: Package php binaries + php script into one single executable file

2011-03-15 Thread Alec
I am also interested in hearing the answer to this. Alec Gorge On 3/15/2011 4:09 PM, Olivier Hoareau wrote: Hi ! I would like to be able to "distribute" (freely) a single executable (binary) containing : - php binaries (v 5.3+) - a php script already packaged as a .phar (1 Mb, requiring PHP 5

[PHP-DEV] Package php binaries + php script into one single executable file

2011-03-15 Thread Olivier Hoareau
Hi ! I would like to be able to "distribute" (freely) a single executable (binary) containing : - php binaries (v 5.3+) - a php script already packaged as a .phar (1 Mb, requiring PHP 5.3+) - additional (optional) compiled extensions - php.ini - all other resources required by the php executable

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Richard Quadling
On 15 March 2011 12:41, Ben Schmidt wrote: >    static $re = '/(^|[^])\'/'; >>> >>> Did no one see why the regex was wrong? > > I saw what the regex was. I didn't think like you that it was 'wrong'. > > Once you unescape the characters in the PHP single-quoted string above > (where two bac

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Dave Ingram
On 03/15/11 12:41, Ben Schmidt wrote: > [snip] > > Hope this helps, > > Ben. As an outsider in this discussion, I'd just like to applaud you for one of the best, in-depth, most patient and most thorough explanations I have ever seen on a mailing list. Dave -- PHP Internals - PHP Runtime Develo

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Ben Schmidt
Now, here is a pattern which actually means "a quote which doesn't already have a backslash before it" which is achieved by means of a lookbehind assertion, which, even when searching the string after the first match, "'str", still 'looks back' on the earlier part of the string to recognise the se

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Ben Schmidt
static $re = '/(^|[^])\'/'; Did no one see why the regex was wrong? I saw what the regex was. I didn't think like you that it was 'wrong'. Once you unescape the characters in the PHP single-quoted string above (where two backslashes count as one, and backslash-quote counts as a quote)

Re: [PHP-DEV] SplFileObject Countable

2011-03-15 Thread Alexey Zakhlestin
On Tue, Mar 15, 2011 at 1:54 PM, Nick Pope wrote: > Currently we have: > >    SplFileInfo  -- information/metadata about a file. >         | >         V >   SplFileObject -- modify/access contents of a file. > > It could make sense to subclass this to provide methods for accessing > information a

Re: [PHP-DEV] SplFileObject Countable

2011-03-15 Thread Nick Pope
On 15/03/11 10:01, Peter Cowburn wrote: For countBytes() how is that different from SplFileInfo's getSize() ? As for countWords() and the others, I think this crosses the line (in my view) over what a "File Object" should provide. Hi Peter & Sebastian, Bah. It isn't. Obviously that was going

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Richard Quadling
On 15 March 2011 10:32, Richard Quadling wrote: > On 14 March 2011 20:36, Hannes Landeholm wrote: >> What is more likely to be wrong? Your understanding of a specific >> regex pattern (which happens to be full of escapes making it >> incredibly hard to read) or the implementation of preg_replace?

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Richard Quadling
On 14 March 2011 20:36, Hannes Landeholm wrote: > What is more likely to be wrong? Your understanding of a specific > regex pattern (which happens to be full of escapes making it > incredibly hard to read) or the implementation of preg_replace? > > ~Hannes > > On 14 March 2011 16:18, Martin Scotta

Re: [PHP-DEV] SplFileObject Countable

2011-03-15 Thread Peter Cowburn
Hi all, On 15 March 2011 09:35, Nick Pope wrote: > Hi Sebastian, > > Since Etienne brought it up, would it not also make sense for you to > implement countWords() and countBytes()? For countBytes() how is that different from SplFileInfo's getSize() ? As for countWords() and the others, I think t

Re: [PHP-DEV] SplFileObject Countable

2011-03-15 Thread Sebastian Marek
Hello Nick, Might be fun, I'll have a look at it. Is the stuff I have done so far any good? I've got only a little C experience, so any feedback is good! cheers On Tue, Mar 15, 2011 at 9:35 AM, Nick Pope wrote: > Hi Sebastian, > > Since Etienne brought it up, would it not also make sense for

Re: [PHP-DEV] SplFileObject Countable

2011-03-15 Thread Nick Pope
Hi Sebastian, Since Etienne brought it up, would it not also make sense for you to implement countWords() and countBytes()? Also, unicode issues aside, it might still be nice to implement countChars(). And finally, so that it provides all most of the functionality of the GNU wc program, th