[PHP] Facebook PHP compiler

2010-02-02 Thread Cesar D. Rodas
Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1story=358 Regards, -- Cesar D. Rodas cro...@php.net http://crodas.org/ -- http://cesar.la/ Phone: +595-961-974165 -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Facebook PHP compiler

2010-02-02 Thread Robert Cummings
Cesar D. Rodas wrote: Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1story=358 Very interesting... I heard about this a few days ago on Slashdot. Most people figured it would be a compiler of some sort, though

[PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ryan S
Hey! i'm just starting with PHP's DOM-XML and need a little help please. Basically, first i am trying to see if a input like a textbox has a 'VALUE=' associated with it, if yes, i leave it be, if no, i add a default value. This *is working* as can be seen by the attached code below. But a bit

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ashley Sheridan
On Tue, 2010-02-02 at 11:29 -0800, Ryan S wrote: Hey! i'm just starting with PHP's DOM-XML and need a little help please. Basically, first i am trying to see if a input like a textbox has a 'VALUE=' associated with it, if yes, i leave it be, if no, i add a default value. This *is

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ryan S
// I have even tried this instead of the above: foreach ($inputs2 as $input2) { if(!$input2-getAttribute(defaultValue)==) { $input2-setAttribute(defaultValue,it works!); } } but no joy. I'm betting its pretty simple but i dont have a DOM chart for php, the

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Michael A. Peters
Ryan S wrote: $website_data = file_get_contents('dom_test.html');//load the website data, $dom = new DomDocument; //make a new DOM container in PHP $dom-loadHTML($website_data); //load all the fetched data into the DOM container I'm not sure what the answer to your issue is, but mind if I

[PHP] database abstraction layer

2010-02-02 Thread Lars Nielsen
Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which are different. The SQL seems to be the same. Is it save to assume

Re: [PHP] database abstraction layer

2010-02-02 Thread James Colannino
Lars Nielsen wrote: Is it save to assume that I can use the same SQL, or should i make some exceptions? Standard SQL should work across all SQL servers with only a few exceptions (for example, MySQL doesn't support full outer joins.) Anything that has to do with server administration,

Re: [PHP] database abstraction layer

2010-02-02 Thread Michael A. Peters
Lars Nielsen wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which are different. The SQL seems to be the same. Is

Re: [PHP] database abstraction layer

2010-02-02 Thread Lester Caine
Lars Nielsen wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which are different. The SQL seems to be the same. Is

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
i'm a fan of adodb.sf.net, which i've used with both postgresql and mysql. On Tue, Feb 2, 2010 at 9:23 PM, Lars Nielsen l...@mit-web.dk wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 09:23:47PM +0100, Lars Nielsen wrote: Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application between MySQL and Postgresql. I have been looking at the way phpBB does it, and it seems that it is only then php-functions which

Re: [PHP] Facebook PHP compiler

2010-02-02 Thread Adam Richardson
Looks very promising !!! On Tue, Feb 2, 2010 at 1:12 PM, Robert Cummings rob...@interjinn.comwrote: Cesar D. Rodas wrote: Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1story=358 Very interesting... I heard

RE: [PHP] database abstraction layer

2010-02-02 Thread Daevid Vincent
-Original Message- From: Lars Nielsen [mailto:l...@mit-web.dk] Sent: Tuesday, February 02, 2010 12:24 PM To: php-general@lists.php.net Subject: [PHP] database abstraction layer Hi List I am trying to make a Database Abstraction Layer so I can which the DB of my application

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 01:15:22PM -0800, Daevid Vincent wrote: -Original Message- From: Lars Nielsen [mailto:l...@mit-web.dk] Sent: Tuesday, February 02, 2010 12:24 PM To: php-general@lists.php.net Subject: [PHP] database abstraction layer Hi List I am trying to make a

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
oh, on using adodb.sf.net and 0-overhead for jumping between mysql and postgresql; keep all your queries to as simple early-standard sql as possible. the auto_increment incompatibilities can be circumvented with a relatively simple function getMax($table, $field) { in adodb, you'd loop through

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote: function getMax($table, $field) If I saw this sort of code I'd be appalled! It's possibly the worst way to get the auto increment value. You won't notice it testing the site out on your own, but all hell will break loose when you start

Re: [PHP] Magento shopping cart

2010-02-02 Thread Skip Evans
Hey all, So I'm more comfortable all the time with using Magento, more I read, and Ryan said, Its great, I have been using it for over 2 years very flexible platform very easy to manipulate, and the end user admin is second to none mate. ... Mate?... Are there Aussies on this list? ;)

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update the max value of any table at exactly the same time. i usually ask for the max value about 2 milliseconds before doing the insert. And if the insert fails, i can auto-retry via a wrapper function

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:05 +0100, Rene Veerman wrote: i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update the max value of any table at exactly the same time. i usually ask for the max value about 2 milliseconds before doing the insert.

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i$rnd; $i++) { $a++ } to further randomize the retry attempt.. On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman rene7...@gmail.com wrote: i haven't had the pleasure yet of writing for

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
eh thats randomize the timing of the retry attempt.. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman rene7...@gmail.com wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i$rnd; $i++) { $a++ } to further randomize the retry

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
the auto_increment sytnax is not uniform across servers, is it? On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: I saw it happen on a site that was getting only about 3000 hits a day. It just takes the right combination of circumstances and it all goes pear

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:17 +0100, Rene Veerman wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i$rnd; $i++) { $a++ } to further randomize the retry attempt.. On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote: the auto_increment sytnax is not uniform across servers, is it? On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: I saw it happen on a site that was getting only about 3000 hits a day. It just takes

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: The problem is where 2 people choose the same instant to perform an action on your site that inserts a record into your db. The db engine inserts them one after the other, and then responds about the max(id) to

Re: [PHP] database abstraction layer

2010-02-02 Thread Ashley Sheridan
On Wed, 2010-02-03 at 00:31 +0100, Rene Veerman wrote: On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: The problem is where 2 people choose the same instant to perform an action on your site that inserts a record into your db. The db engine inserts them

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 12:35 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: It's the reason transactions exist, to prevent things happening like this. When you have two actions where one is dependent on the other, unless you have a way to tie them together so that they can't be broken,

Re: [PHP] Magento shopping cart

2010-02-02 Thread Ryan Sun
Your designer will definitely be able to skin it, it has multi template and skin system, is easy to customize css, images, and html code for each block However, for changing the layout (position of each block), it will require your designer have a little knowledge on Mage's xml layout system

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Yep, love those race conditions. We have them all over the app cuz the app ciders don't know shit! Bastien Sent from my iPod On Feb 2, 2010, at 5:46 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote: function getMax($table,

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Good lord that is exacty the same logic applied in our app. It only takes about 100 users to create the issue. Bastien Sent from my iPod On Feb 2, 2010, at 6:05 PM, Rene Veerman rene7...@gmail.com wrote: i haven't had the pleasure yet of writing for sites that generate so many hits/sec

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: i haven't had the pleasure yet of writing for sites that generate so many hits/sec that they'd update the max value of any table at exactly the same time. i usually ask for the max value about 2 milliseconds before doing the insert. And if the insert fails, i can auto-retry

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: eh thats randomize the timing of the retry attempt.. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman rene7...@gmail.com wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0; for ($i=0; $i$rnd; $i++) { $a++ } to further

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Rene Veerman wrote: On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: The problem is where 2 people choose the same instant to perform an action on your site that inserts a record into your db. The db engine inserts them one after the other, and then responds

Re: [PHP] database abstraction layer

2010-02-02 Thread Robert Cummings
Michael A. Peters wrote: Robert Cummings wrote: Rene Veerman wrote: eh thats randomize the timing of the retry attempt.. On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman rene7...@gmail.com wrote: and after the sleep(rand(1,3)) it might need a short loop like this; $rnd = rand(1,9); $a=0;

Re: [PHP] database abstraction layer

2010-02-02 Thread Michael A. Peters
Robert Cummings wrote: *snip* Einstein I believe said something along the lines of A smart person solves a problem. A wise person avoids it in the first place Might not have been Einstein, but anyway ... Do you mean the following quote? The difference between a smart person and a wise

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Tue, Feb 02, 2010 at 11:19:29PM +0100, Rene Veerman wrote: oh, on using adodb.sf.net and 0-overhead for jumping between mysql and postgresql; keep all your queries to as simple early-standard sql as possible. the auto_increment incompatibilities can be circumvented with a relatively

Re: [PHP] database abstraction layer

2010-02-02 Thread Phpster
Lol, damn iPod corrections. The app designers is what was meant. Bastien Sent from my iPod On Feb 2, 2010, at 8:41 PM, Robert Cummings rob...@interjinn.com wrote: Phpster wrote: Yep, love those race conditions. We have them all over the app cuz the app ciders don't know shit! Mmmm...

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Andrew Ballard
On Tue, Feb 2, 2010 at 2:29 PM, Ryan S gen...@yahoo.com wrote: Hey! i'm just starting with PHP's DOM-XML and need a little help please. Basically, first i am trying to see if a input like a textbox has a 'VALUE=' associated with it, if yes, i leave it be, if no, i add a default value.

Re: [PHP] database abstraction layer

2010-02-02 Thread Jochem Maas
Op 2/3/10 12:19 AM, Ashley Sheridan schreef: On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote: the auto_increment sytnax is not uniform across servers, is it? On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: I saw it happen on a site that was getting

Re: [PHP] database abstraction layer

2010-02-02 Thread Rene Veerman
On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas joc...@iamjochem.com wrote: you can bet you ass that every other DB out there that's worth it's salt has atomic id incrementor functionality exposed in some way or other. @Rene: all that talk of maxId functions and random retries etc, etc, is

Re: [PHP] database abstraction layer

2010-02-02 Thread Paul M Foster
On Wed, Feb 03, 2010 at 06:39:29AM +0100, Rene Veerman wrote: On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas joc...@iamjochem.com wrote: you can bet you ass that every other DB out there that's worth it's salt has atomic id incrementor functionality exposed in some way or other. @Rene: all