New News Entry

Lists: pgsql-www
From: www(at)www(dot)postgresql(dot)com (World Wide Web Owner)
To: pgsql-www(at)postgresql(dot)org
Subject: New News Entry
Date: 2004-04-27 17:53:56
Message-ID: 20040427175356.33667CF542C@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-www

A new entry has been added to the news database.

Database Admin: http://www.postgresql.org/admin/edit_news.php?182

Submitted by: jd(at)commandprompt(dot)com
Headline: plPHP RC1 is now available
Summary:

PL/PHP is a loadable procedural language that enables you to write PostgreSQL functions (store procedures) and triggers in the PHP programming language. It works with 7.3.x and 7.4.x.

Story:

It currently supports SPI, composite types, SetOf function, triggers, trusted, and untrusted modes.

From the last release (Beta3) SPI, composite types, SetOf functions, and compile once have been added. Below are some examples of what the RC1 version of plPHP is currently capable of.

Using global variables to store data between function callsL

<pre>
CREATE OR REPLACE FUNCTION set_var(text) RETURNS text AS \'
global $_SHARED;
$_SHARED[\'\'first\'\']=$args[0];
return \'\'ok\'\';
\' LANGUAGE plphp

CREATE OR REPLACE FUNCTION get_var() RETURNS text AS \'
global $_SHARED;
return $_SHARED[\'\'first\'\'];
\' LANGUAGE plphp;

SELECT set_var(\'hello plphp\');
SELECT get_var(); //will return \"hello plphp\" in our example

</pre>
Database Access (SPI):

$query = \"INSERT INTO my_table VALUES (1, \'\'test\'\')\";
$rv = spi_exec_query($query);

The result would be accessed as:

$res = $rv[\'\'status\'\']; //SPI_OK_INSERT in our example
$nrows = $rv[\'\'rows\'\'];
</pre>

SetOf functions:

<pre>
CREATE TYPE __testsetphp AS (f1 integer, f2 text, f3 text);

CREATE OR REPLACE FUNCTION php_set(integer) RETURNS SETOF __testsetphp AS \'
$ret[0][0]=$args[0];
$ret[0][1]=\"hello\";
$ret[0][2]=\"world\";
$ret[1][0]=2*$args[0];
$ret[1][1]=\"hello\";
$ret[1][2]=\"postgres\";
$ret[2][0]=3*$args[0];
$ret[2][1]=\"hello\";
$ret[2][2]=\"plphp\";
return $ret;
\' LANGUAGE \'plphp\';

SELECT * FROM php_set(1);

Will return:
f1 | f2 | f3
----+-------+----------
1 | hello | world
2 | hello | postgres
3 | hello | plphp

</pre>

plPHP can be found at the Command Prompt, Inc. community pages located <a href=\"https://www.commandprompt.com/entry.lxp?lxpe=294\"> here</a>


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-www(at)postgresql(dot)org
Subject: Re: New News Entry
Date: 2004-04-27 20:24:16
Message-ID: 200404272224.16603.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-www

World Wide Web Owner wrote:
> Headline: plPHP RC1 is now available

I notice that the PHP license contains this:

3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact group(at)php(dot)net(dot)

4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group(at)php(dot)net(dot) You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"

Has such a permission been obtained?


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-www(at)postgresql(dot)org
Subject: Re: New News Entry
Date: 2004-04-28 00:01:44
Message-ID: 200404271701.44833.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-www

Peter,

Word from Josh D:

Hello,

  I have sent a request to group however note that number 4 of the
license does allow what we are doing. It states:

Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group(at)php(dot)net(dot)  You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"

plPHP is derived from PHP thus we can't call it PHPpl but plPHP should
be o.k.

Sincerely,

Joshua D. Drake

--
-Josh Berkus
Aglio Database Solutions
San Francisco


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: www(at)www(dot)postgresql(dot)com (World Wide Web Owner), pgsql-www(at)postgresql(dot)org
Subject: Re: New News Entry
Date: 2004-04-29 16:30:43
Message-ID: 200404290930.43556.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-www

Folks,

> Submitted by: jd(at)commandprompt(dot)com
> Headline: plPHP RC1 is now available
> Summary:

Can someone approve this? Thanks.

--
Josh Berkus
Aglio Database Solutions
San Francisco


From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PostgreSQL WWW Mailing List <pgsql-www(at)postgresql(dot)org>
Subject: Re: New News Entry
Date: 2004-04-29 16:33:30
Message-ID: Pine.LNX.4.44.0404291933160.20878-100000@emo.org.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-www


Hi,

On Thu, 29 Apr 2004, Josh Berkus wrote:

> > Submitted by: jd(at)commandprompt(dot)com
> > Headline: plPHP RC1 is now available
> > Summary:
>
> Can someone approve this? Thanks.

Done.
--
Devrim GUNDUZ
devrim~gunduz.org devrim.gunduz~linux.org.tr
http://www.TDMSoft.com
http://www.gunduz.org