[development] Drupal.org on HipHop
Степан Кузьмин
kyzminst at gmail.com
Wed Sep 22 12:11:52 UTC 2010
Wow! I have been waiting it since HipHop was released.
Great job! Thanks.
2010/9/22 <development-request at drupal.org>:
> Send development mailing list submissions to
> development at drupal.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.drupal.org/mailman/listinfo/development
> or, via email, send a message with subject or body 'help' to
> development-request at drupal.org
>
> You can reach the person managing the list at
> development-owner at drupal.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of development digest..."
>
>
> Today's Topics:
>
> 1. Drupal.org on HipHop (Gerhard Killesreiter)
> 2. Re: Problem with db_affected_rows() in MySQL (Nikola Kotur)
> 3. Re: Problem with db_affected_rows() in MySQL (Bob Hutchinson)
> 4. Re: Drupal.org on HipHop (Gerhard Killesreiter)
> 5. Re: Drupal.org on HipHop (Dipen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 22 Sep 2010 12:49:53 +0200
> From: Gerhard Killesreiter <gerhard at killesreiter.de>
> Subject: [development] Drupal.org on HipHop
> To: "Drupal.org Infrastructure Maintainers"
> <infrastructure at drupal.org>, development at drupal.org
> Message-ID: <4C99DF51.1070009 at killesreiter.de>
> Content-Type: text/plain; charset=UTF-8
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there,
>
> I've been following the development of Facebook's HipHop PHP compiler
> since February with the intention of setting up a copy of drupal.org on
> it. This has now been achieved, see http://driphop.drupal.org/
>
> This runs on a copy of the database, so feel free to make any changes.
> It uses bakery for authentication, so you should be able to log-in.
>
> Please report any errors you notice in the infrastructure issue queue,
> I've added a driphop.drupal.org component.
>
> The website might be unavailable from time to time.
>
> I have not yet done any proper benchmarks for this setup. The aim here
> is to find bugs (the fastest php page is the one with a parse error
> after all...).
>
>
> Known bugs:
>
> 1) Due do some issue with the way URL rewriting works in Hiphop vs how t
> works in apache, the homepage gives you a 404 but does actually show the
> orange d.o box. /node does work, but does not show you the orange box...
>
> 2) The local task tabs lack some HTML that the CSS needs to render them
> properly. Somehow the relevant theme function doesn't appear to get called.
>
> 3) I've had to remove three blocks that use PHP in the "pages" column.
>
> 4) Uploaded files are not available and none can be uploaded.
>
> Thanks to Narayan for getting me a database and to the OSL for loaning
> us another VM.
>
> Cheers,
> Gerhard
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkyZ31EACgkQfg6TFvELooTKLACfUZn2xwluH1u7DChZEtyvo6DG
> HYoAoLuCR8PD/5ypWbeUkrs4Yeb6NXhO
> =DetO
> -----END PGP SIGNATURE-----
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 22 Sep 2010 12:51:17 +0200
> From: Nikola Kotur <kotnick at gmail.com>
> Subject: Re: [development] Problem with db_affected_rows() in MySQL
> To: development at drupal.org
> Message-ID: <1285152677.3556.15.camel at eton>
> Content-Type: text/plain; charset="utf-8"
>
> On Wed, 2010-09-22 at 15:05 +0530, sivaji j.g wrote:
>
>> I assume this is with an intention of avoiding duplicate records
>> inserts. However in my case db_affected_rows() mostly returns 0 though
>> a matching row is found in the table.
>>
>> I guess it is because the values being updated is same as values
>> already available in the row.
>
>
> Yes, as MySQL documentation clearly states:
>
> For UPDATE statements, the affected-rows value by default is the number
> of rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to
> mysql_real_connect() when connecting to mysqld, the affected-rows value
> is the number of rows ?found?; that is, matched by the WHERE clause.
>
> http://dev.mysql.com/doc/refman/5.1/en/mysql-affected-rows.html
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.drupal.org/pipermail/development/attachments/20100922/e11b4017/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Wed, 22 Sep 2010 12:10:47 +0100
> From: Bob Hutchinson <hutchlists at midwales.com>
> Subject: Re: [development] Problem with db_affected_rows() in MySQL
> To: development at drupal.org
> Message-ID: <201009221210.47421.hutchlists at midwales.com>
> Content-Type: Text/Plain; charset="iso-8859-15"
>
> On Wednesday 22 September 2010, sivaji j.g wrote:
>> Hi,
>>
>> I am using support module for my current projects. This module often runs
>> UPDATE SQL statement and checks db_affected_rows() before issuing INSERT
>> statements like
>>
>> db_query("UPDATE {support_ticket} SET message_id = '%s', state =
>> %d, priority = %d, client = %d, assigned = %d WHERE nid = %d",
>> isset($node->message_id) ? $node->message_id : '', $node->state,
>> $node->priority, $node->client, $node->assigned, $node->nid);
>> if (!db_affected_rows()) {
>> db_query("INSERT INTO {support_ticket} (nid, message_id, state,
>> priority, client, assigned) VALUES(%d, '%s', %d, %d, %d, %d)", $node->nid,
>> isset($node->message_id) ? $node->message_id : '', $node->state,
>> $node->priority, $node->client, $node->assigned);
>> }
>
> Better to do a SELECT first to check if a record with the nid concerned
> exists, if it does do UPDATE, if not do INSERT.
>
> db_affected_rows() will only return > 0 if an update results in changed data.
>
> This assumes that nid needs to be unique in the support_ticket table.
>
>>
>> I assume this is with an intention of avoiding duplicate records inserts.
>> However in my case db_affected_rows() mostly returns 0 though a matching
>> row is found in the table.
>>
>> I guess it is because the values being updated is same as values already
>> available in the row. As a result drupal throws user warning like.
>>
>> user warning: Duplicate entry '292' for key 'PRIMARY' query: INSERT INTO
>> support_ticket (nid, message_id, state, priority, client, assigned)
>> VALUES(292, '', 1, 2, 7, 11) in /sites/all/modules/support/support.module
>> on line 650.
>>
>> I am planning to rewrite all the UPDATE query with SELECT COUNT(*) to fix
>> this. Is there any other workaround available for this ?
>>
>> I am using Drupal 6.19, PHP 5.3 and MySQL Server version:
>> 5.1.41-3ubuntu12.6 (Ubuntu).
>>
>> Thanks in advance.
>
>
> --
> -----------------
> Bob Hutchinson
> Midwales dot com
> -----------------
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 22 Sep 2010 13:16:16 +0200
> From: Gerhard Killesreiter <gerhard at killesreiter.de>
> Subject: Re: [development] Drupal.org on HipHop
> To: development at drupal.org, "Drupal.org Infrastructure Maintainers"
> <infrastructure at drupal.org>
> Message-ID: <4C99E580.6050108 at killesreiter.de>
> Content-Type: text/plain; charset=UTF-8
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 22.09.2010 12:49, Gerhard Killesreiter wrote:
>> Known bugs:
>
> To clarify:
>
>> 1) Due do some issue with the way URL rewriting works in Hiphop vs how t
>> works in apache, the homepage gives you a 404 but does actually show the
>> orange d.o box. /node does work, but does not show you the orange box...
>
> This is probably a configuration issue on my part.
>
>> 2) The local task tabs lack some HTML that the CSS needs to render them
>> properly. Somehow the relevant theme function doesn't appear to get called.
>
> This is likely a HipHop bug or Drupal is using some unsupported
> construct in its theming layer. The rest of the theming seems to work,
> though.
>
>> 3) I've had to remove three blocks that use PHP in the "pages" column.
>
> This is simply a limitation of HipHop, you can't use evil eval().
>
>> 4) Uploaded files are not available and none can be uploaded.
>
> This is simply because the files directory isn't exported to the VM.
>
>> Thanks to Narayan for getting me a database and to the OSL for loaning
>> us another VM.
>
> And to Damien of course who supplied three patches to get rid of
> preg_replace calls that use /e.
>
> Cheers,
> Gerhard
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkyZ5X0ACgkQfg6TFvELooRxTwCeLQylBxxgjOYUa/YXCSke+dIx
> za0An1ooxp3PMGplmzyqQY28MArHJy1O
> =OzVG
> -----END PGP SIGNATURE-----
>
>
> ------------------------------
>
> Message: 5
> Date: Wed, 22 Sep 2010 17:25:14 +0530
> From: Dipen <dipench at gmail.com>
> Subject: Re: [development] Drupal.org on HipHop
> To: development at drupal.org
> Cc: "Drupal.org Infrastructure Maintainers"
> <infrastructure at drupal.org>
> Message-ID:
> <AANLkTinkDnzkkMaNELhqeAkQ2d3orUTKyWjtzZ_yWVA2 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Wow!! nice.
>
> Will check this out now :)
>
>
> On Wed, Sep 22, 2010 at 4:46 PM, Gerhard Killesreiter <
> gerhard at killesreiter.de> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 22.09.2010 12:49, Gerhard Killesreiter wrote:
>> > Known bugs:
>>
>> To clarify:
>>
>> > 1) Due do some issue with the way URL rewriting works in Hiphop vs how t
>> > works in apache, the homepage gives you a 404 but does actually show the
>> > orange d.o box. /node does work, but does not show you the orange box...
>>
>> This is probably a configuration issue on my part.
>>
>> > 2) The local task tabs lack some HTML that the CSS needs to render them
>> > properly. Somehow the relevant theme function doesn't appear to get
>> called.
>>
>> This is likely a HipHop bug or Drupal is using some unsupported
>> construct in its theming layer. The rest of the theming seems to work,
>> though.
>>
>> > 3) I've had to remove three blocks that use PHP in the "pages" column.
>>
>> This is simply a limitation of HipHop, you can't use evil eval().
>>
>> > 4) Uploaded files are not available and none can be uploaded.
>>
>> This is simply because the files directory isn't exported to the VM.
>>
>> > Thanks to Narayan for getting me a database and to the OSL for loaning
>> > us another VM.
>>
>> And to Damien of course who supplied three patches to get rid of
>> preg_replace calls that use /e.
>>
>> Cheers,
>> Gerhard
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>>
>> iEYEARECAAYFAkyZ5X0ACgkQfg6TFvELooRxTwCeLQylBxxgjOYUa/YXCSke+dIx
>> za0An1ooxp3PMGplmzyqQY28MArHJy1O
>> =OzVG
>> -----END PGP SIGNATURE-----
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.drupal.org/pipermail/development/attachments/20100922/7c06dbeb/attachment-0001.html
>
> ------------------------------
>
> --
> [ Drupal development list | http://lists.drupal.org/ ]
>
> End of development Digest, Vol 93, Issue 37
> *******************************************
>
--
Кузьмин Степан
Веб разработчик.
ООО <<Аматей>>
Россия, г.Екатеринбург.
Kuzmin Stepan
Web developer.
<<Amatei>> LLC.
Russian Federation, Yekaterinburg.
tel. +7 (343) 283-04-29
skype: KuzminStepan
twitter: @KuzminStepan
e-mail: kyzminst at gmail.com
--------------------------------------------
Q: Why is this email three sentences or less?
A: http://three.sentenc.es
More information about the development
mailing list