[Evolvis-commits] r123: Add a preliminary version of my php-perl package, which cannot yet↵ be accepted into Debian proper due to licencing issues ( grml… ) but↵ otherwise should be fine . It has actually been tested. ↵

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Jun 8 10:31:25 CEST 2009


Author: mirabilos
Date: 2009-06-08 08:31:24 +0000 (Mon, 08 Jun 2009)
New Revision: 123

Added:
   trunk/gforge_base/php-perl/
   trunk/gforge_base/php-perl/php-perl-1.0.0/
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog.xsl
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/compat
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/control
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/copyright
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/docs
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/pecl
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/perl.ini
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/php5-perl.dirs
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/rules
   trunk/gforge_base/php-perl/php-perl-1.0.0/debian/watch
   trunk/gforge_base/php-perl/php-perl-1.0.0/package.xml
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/CREDITS
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/EXPERIMENTAL
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/README
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/TODO
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.m4
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.w32
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/perl.dsp
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.c
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.h
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.pl
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl002.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl003.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl004.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl005.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl006.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl007.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl008.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl009.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl010.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl011.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl012.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl013.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl014.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl015.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl016.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl017.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl018.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl019.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl020.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl021.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl022.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl023.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl024.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl025.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl026.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl027.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl028.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl029.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl030.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl031.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl032.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl033.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl034.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl035.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl036.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl037.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl038.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl039.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl040.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl041.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl042.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl043.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl044.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl045.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl046.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl047.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl048.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl049.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl050.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl051.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl052.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl053.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl054.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl055.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl056.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl057.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl058.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl059.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl060.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl061.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl062.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl063.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl064.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl065.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl066.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl067.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl068.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl069.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl070.phpt
   trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/skipif.inc
   trunk/gforge_base/php-perl/php-perl_1.0.0.orig.tar.gz
Log:
Add a preliminary version of my php-perl package, which cannot yet
be accepted into Debian proper due to licencing issues (grml…) but
otherwise should be fine. It has actually been tested.


Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,15 @@
+php-perl (1.0.0-1~evolvis1) unstable; urgency=low
+
+  * Initial Release (Closes: #527280)
+  * debian/rules: fix 「clean」 target
+  * debian/README.Debian: remove, by suggestion of Bastian “waldi” Blank
+  * debian/copyright: add instructions on how to repack the tarball
+  * debian/copyright: reproduce the entire licence
+  * debian/rules: clean up the dh-make-pecl generated template, remove
+    PHPv4 support; by suggestion of Bastian “waldi” Blank
+  * debian/control: depend on php5-cli as alternative to the phpapi
+    virtual package, as suggested by lintian
+  * debian/rules: do not install the automatically generated Changelog
+    file (from package.xml) for now, since it is empty
+
+ -- Thorsten Glaser <tg at mirbsd.de>  Sat, 06 Jun 2009 16:00:39 +0000

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog.xsl
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog.xsl	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/changelog.xsl	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:util="urn:xslt:functions:util" xmlns:func="http://exslt.org/functions" xmlns:str="http://exslt.org/strings" extension-element-prefixes="func str">
+<xsl:output method="text"/>
+
+  <func:function name="util:maximize">
+    <xsl:param name="string"/>
+    <xsl:param name="line-length"/>
+
+    <func:result>
+      <xsl:variable name="tmp" select="string-length(substring-before($string,' '))"/>
+      <xsl:choose>
+	<xsl:when test="($tmp &gt; $line-length) or (not(contains($string, ' ')))">0</xsl:when>
+        <xsl:when test="(substring($string,$line-length,1) = ' ')">
+	  <xsl:value-of select="$line-length"/>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:value-of select="util:maximize(substring-after($string, ' '), $line-length - $tmp - 1) + 1 + $tmp"/>
+	</xsl:otherwise>
+      </xsl:choose>
+    </func:result>
+  </func:function>
+
+  <func:function name="util:format">
+    <xsl:param name="string"/>
+    <xsl:param name="indent" select="2"/>
+    <xsl:param name="line-length" select="76"/>
+
+    <func:result>
+      <xsl:choose>
+        <xsl:when test="contains($string,'&#xA;') or contains($string,'&#xD;')">
+          <xsl:for-each select="str:tokenize($string,'&#xA;&#xD;')">
+	    <xsl:value-of select="util:format(., $indent, $line-length)"/>
+          </xsl:for-each>	    
+	</xsl:when>
+	<xsl:when test="string-length($string) &gt; $line-length">
+	  <xsl:variable name="tmp" select="util:maximize($string, $line-length)"/>
+	  <xsl:value-of select="str:padding($indent,' ')"/>
+	  <xsl:value-of select="substring($string, 1, $tmp)"/>
+	  <xsl:text>&#xA;</xsl:text>
+	  <xsl:value-of select="util:format(substring($string, $tmp + 1))"/>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:value-of select="str:padding($indent,' ')"/>
+	  <xsl:value-of select="$string"/>
+	  <xsl:text>&#xA;</xsl:text>
+	</xsl:otherwise>
+      </xsl:choose>
+    </func:result>
+  </func:function>
+
+  <func:function name="util:norm">
+    <xsl:param name="num"/>
+    <xsl:param name="length" select="4"/>
+
+    <xsl:choose>
+      <xsl:when test="$length &gt; string-length($num)">
+        <func:result select="concat('0',util:norm($num, $length - 1))"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <func:result select="$num"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </func:function>
+
+  <func:function name="util:extractnum">
+    <xsl:param name="string"/>
+
+    <xsl:choose>
+      <xsl:when test="$string = ''">
+        <func:result select="0"/>
+      </xsl:when>
+      <xsl:when test="$string &lt;= '9' and $string &gt;= '0'">
+        <func:result select="$string"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <func:result select="util:extractnum(substring($string,1,string-length($string)-1))"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </func:function>
+
+  <func:function name="util:ver2num">
+    <xsl:param name="version"/>
+
+    <xsl:choose>
+      <xsl:when test="contains($version,'.')">
+        <func:result select="concat(util:norm(substring-before($version,'.')), util:ver2num(substring-after($version,'.')))"/>
+      </xsl:when>
+      <xsl:when test="$version = number($version)">
+        <func:result select="concat(util:norm($version), util:norm(0))"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:variable name="tmp" select="util:extractnum($version)"/>
+        <func:result select="concat(util:norm($tmp),' ', substring($version, string-length($tmp) + 1))"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </func:function>
+
+  <xsl:template match="package">
+    <xsl:apply-templates select="release">
+      <xsl:sort order="descending" select="util:ver2num(normalize-space(version))" data-type="text"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="changelog/release">
+      <xsl:sort order="descending" select="util:ver2num(normalize-space(version))" data-type="text"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="release">
+    <xsl:text>Version </xsl:text>
+    <xsl:value-of select="version"/>
+    <xsl:text> - </xsl:text>
+    <xsl:value-of select="date"/>
+    <xsl:if test="state">
+      <xsl:text> (</xsl:text>
+      <xsl:value-of select="state"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+    <xsl:text>&#xA;----------------------------------------&#xA;Notes:&#xA;</xsl:text>
+    <xsl:value-of select="util:format(notes)"/>
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/compat
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/compat	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/compat	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1 @@
+7

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/control
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/control	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/control	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,16 @@
+Source: php-perl
+Section: non-free/perl
+Priority: optional
+Maintainer: Thorsten Glaser <tg at mirbsd.de>
+Homepage: http://devzone.zend.com/article/1712
+Build-Depends: debhelper (>= 7), po-debconf, xsltproc, php5-dev, libperl-dev
+Standards-Version: 3.8.1
+DM-Upload-Allowed: yes
+
+Package: php5-perl
+Architecture: any
+Depends: ${shlibs:Depends}, php5-cli | ${php:Depends}, ${misc:Depends}
+Description: Embedded Perl module for PHP 5
+ This extension embeds Perl Interpreter into PHP. It allows to execute
+ Perl files, evaluate Perl code, access Perl variables and instantiate
+ Perl objects.

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/copyright
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/copyright	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/copyright	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,94 @@
+This package was debianised by Thorsten Glaser <tg at mirbsd.de> using dh-make-pecl
+on Wed, 06 May 2009 15:53:28 +0200.
+
+It was downloaded from http://pecl.php.net/package/perl
+
+Upstream Author:
+
+    Dmitry Stogov
+
+Copyright:
+
+    Copyright (C)  Dmitry Stogov
+
+License:
+
+    PHP Licence 3.0
+    Request for licence change or dual licencing sent to author.
+
+
+The Debian packaging is Copyright © 2009 Thorsten Glaser <tg at mirbsd.de> and is
+licenced under the GNU GPL, v1 or later, see ‘/usr/share/common-licenses/GPL’.
+
+The repackaged tarball can be created by moving the upstream tarball’s content
+into the new top-level directory.
+
+
+-------------------------------------------------------------------- 
+                  The PHP License, version 3.0
+Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
+-------------------------------------------------------------------- 
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+ 
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+ 
+  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.net.
+  
+  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.net.  You may indicate that your software works in
+     conjunction with PHP by saying "Foo for PHP" instead of calling
+     it "PHP Foo" or "phpfoo"
+ 
+  5. The PHP Group may publish revised and/or new versions of the
+     license from time to time. Each version will be given a
+     distinguishing version number.
+     Once covered code has been published under a particular version
+     of the license, you may always continue to use it under the terms
+     of that version. You may also choose to use such covered code
+     under the terms of any subsequent version of the license
+     published by the PHP Group. No one other than the PHP Group has
+     the right to modify the terms applicable to covered code created
+     under this License.
+
+  6. Redistributions of any form whatsoever must retain the following
+     acknowledgment:
+     "This product includes PHP, freely available from
+     <http://www.php.net/>".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-------------------------------------------------------------------- 
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group at php.net.
+
+For more information on the PHP Group and the PHP project, 
+please see <http://www.php.net>.
+
+This product includes the Zend Engine, freely available at
+<http://www.zend.com>.

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/docs
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/docs	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/docs	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,3 @@
+perl-1.0.0/README
+perl-1.0.0/CREDITS
+perl-1.0.0/TODO

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/pecl
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/pecl	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/pecl	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1 @@
+modules/perl.so

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/perl.ini
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/perl.ini	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/perl.ini	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1 @@
+extension=perl.so

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/php5-perl.dirs
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/php5-perl.dirs	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/php5-perl.dirs	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1 @@
+usr/lib/php5

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/rules
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/rules	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/rules	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,120 @@
+#!/usr/bin/make -f
+# template debian/rules provided by dh-make-php.
+# GNU copyright 2005 by Uwe Steinmann.
+# Copyright (c) 2009 by Thorsten Glaser <t.glaser at tarent.de>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+CFLAGS = -O2 -Wall
+CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+	DEBUG := --enable-debug
+else
+	DEBUG := --disable-debug
+endif
+
+TAR=tar
+PECL_PKG_NAME=perl
+PECL_PKG_REALNAME=perl
+PECL_PKG_VERSION=1.0.0
+PACKAGE_NAME=php-perl
+BIN_PACKAGE_NAME=php$*-perl
+PHPIZE=/usr/bin/phpize
+PHPCONFIG=/usr/bin/php-config
+EXT_DIR=$(shell $(PHPCONFIG)$* --extension-dir)
+SOURCE_DIR=$(shell ls -d $(PECL_PKG_REALNAME)-*)
+BINARYTARGETS=binary-arch-v5
+BUILDTARGETS=build-v5
+CLEANTARGETS=clean-v5
+
+phpapiver5=$(shell /usr/bin/php-config5 --phpapi)
+
+configure-v5: configure-v%: configure-stamp-v%
+configure-stamp-v5: configure-stamp-v%:
+	dh_testdir
+	# Add here commands to configure the package.
+	(cd $(SOURCE_DIR); \
+	$(PHPIZE)$*; \
+	./configure --with-php-config=$(PHPCONFIG)$* --prefix=/usr)
+	touch $@
+
+build: $(BUILDTARGETS)
+
+build-v5: build-v%: build-stamp-v%
+
+build-stamp:
+	$(shell /usr/share/dh-make-php/phppkginfo . changelog > debian/Changelog)
+	touch build-stamp
+
+build-stamp-v5: build-stamp-v%: build-stamp configure-stamp-v%
+	dh_testdir
+
+	# Add here commands to compile the package.
+	(cd $(SOURCE_DIR); $(MAKE); mkdir -p ../tmp/modules$*; cp modules/* ../tmp/modules$*; $(MAKE) clean)
+	touch $@
+
+clean: $(CLEANTARGETS)
+	rm -rf tmp debian/Changelog
+	dh_clean
+
+clean-v5: clean-v%:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp* configure-stamp*
+
+	# Add here commands to clean up after the build process.
+	(cd $(SOURCE_DIR); \
+	$(MAKE) clean; \
+	$(PHPIZE)$* --clean)
+	rm -rf tmp/modules$*
+
+install-v5: install-v%: build-v%
+	dh_testdir
+	dh_testroot
+	# can't dh_clean here without specifically excluding the possibly existing installed dirs
+	# for other version.
+	#dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/$(PACKAGE_NAME).
+	mkdir -p debian/$(BIN_PACKAGE_NAME)/$(EXT_DIR)
+	install -m 644 -o root -g root tmp/modules$*/$(PECL_PKG_NAME).so debian/$(BIN_PACKAGE_NAME)/$(EXT_DIR)/$(PECL_PKG_NAME).so
+	if [ -f "debian/$(PECL_PKG_NAME).ini" ]; then \
+		mkdir -p debian/$(BIN_PACKAGE_NAME)/etc/php$*/conf.d; \
+		cp debian/$(PECL_PKG_NAME).ini debian/$(BIN_PACKAGE_NAME)/etc/php$*/conf.d; \
+	fi
+
+# Build architecture-independent files here.
+binary-indep:
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+
+binary-arch-v5: binary-arch-v%: install-v%
+	echo "php:Depends=phpapi-$(phpapiver$*)" >> debian/$(BIN_PACKAGE_NAME).substvars
+
+binary-arch: $(BINARYTARGETS)
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs #debian/Changelog
+	dh_installdocs
+	dh_installexamples
+	dh_installdebconf
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	dh_strip
+endif
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build build-v5 clean clean-v5 binary-indep binary-arch binary-arch-v5 binary install-v5 configure-v5


Property changes on: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/rules
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/debian/watch
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/debian/watch	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/debian/watch	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,3 @@
+version=3
+http://pecl.php.net/package/perl \
+  /get/perl-([\d\.]*).tgz  debian  uupdate

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/package.xml
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/package.xml	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/package.xml	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
+<package version="1.0" packagerversion="1.4.6">
+ <name>perl</name>
+ <summary>Embedded Perl.</summary>
+ <description>This extension embeds Perl Interpreter into PHP. It allows execute Perl files, evaluate Perl code, access Perl variables and instantiate Perl objects.
+ </description>
+ <maintainers>
+  <maintainer>
+   <user>dmitry</user>
+   <name>Dmitry Stogov</name>
+   <email>dmitry at zend.com</email>
+   <role>lead</role>
+  </maintainer>
+  </maintainers>
+ <release>
+  <version>1.0.0</version>
+  <date>2006-02-13</date>
+  <license>PHP</license>
+  <state>stable</state>
+  <notes>
+  </notes>
+  <deps>
+   <dep type="php" rel="ge" version="5.0.0"/>
+  </deps>
+  <filelist>
+   <file role="doc" baseinstalldir="perl" md5sum="ef49673bf178cdcea63791e8043fe390" name="CREDITS"/>
+   <file role="doc" baseinstalldir="perl" md5sum="7291f1b05a4608bc9223993fd2bea6c2" name="EXPERIMENTAL"/>
+   <file role="doc" baseinstalldir="perl" md5sum="1e821af0b7ec645cbe5fdccc53861bd8" name="README"/>
+   <file role="doc" baseinstalldir="perl" md5sum="08037f45d65c1e3f2b4d274f6f39c310" name="TODO"/>
+   <file role="src" baseinstalldir="perl" md5sum="d1be76d4598850e803720a2725655b36" name="php_perl.h"/>
+   <file role="src" baseinstalldir="perl" md5sum="4b4ad4d3cbb26d002bf7258c377d929d" name="php_perl.c"/>
+   <file role="src" baseinstalldir="perl" md5sum="3fb5b64c91595c6186b1f218b44abff9" name="perl.dsp"/>
+   <file role="src" baseinstalldir="perl" md5sum="26f6b83c5c490778ca2106d237e8d5e1" name="config.m4"/>
+   <file role="src" baseinstalldir="perl" md5sum="8ba02d401388a8a374d4e23c909b3cbb" name="config.w32"/>
+   <file role="test" baseinstalldir="perl" md5sum="45dae7de13fa243b4a7820b0d0f2cfea" name="tests/skipif.inc"/>
+   <file role="test" baseinstalldir="perl" md5sum="1545dea1cd1a488c30d5d5395a44d4ac" name="tests/perl001.pl"/>
+   <file role="test" baseinstalldir="perl" md5sum="e0903bd873154cbfba0c582c125c13ab" name="tests/perl001.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="7af5191a36a0f13a7c257ec011d67c74" name="tests/perl002.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="02e71aa1c2417cc4c1e3d509db7b40c2" name="tests/perl003.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="9b1c1b5588f6aae22373bc3083fba515" name="tests/perl004.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="29c8c9d984e1cf18d91a915e0bfa194c" name="tests/perl005.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="0d00203e7d4133e0ae4a9d695b86ba09" name="tests/perl006.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="426d6d01f5331aae22592d62f964a89b" name="tests/perl007.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="91d62d2a1247a462389473d32d3827b8" name="tests/perl008.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="3746c67f363f0293bebc384a9785981b" name="tests/perl009.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="b6b83850738e03f3836c1b6a14ee249a" name="tests/perl010.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="147bdcfc65cc4321b13ea749d36cbb60" name="tests/perl011.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="387b3b2ca1ec03e047ea831dc1853ce1" name="tests/perl012.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="196a5e22390fbe787546a0e7fb9bf97f" name="tests/perl013.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="c5a0e39bda2b440e1602907a75019953" name="tests/perl014.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="9293e11da5d9302969d9bb0fbb2d7ad9" name="tests/perl015.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="1e8018c4c0be36a7e26810bd1fec683d" name="tests/perl016.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="f48c3a8cedc40ad9384ebfda9191de89" name="tests/perl017.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="4c94068277170c75917c564f84fbde23" name="tests/perl018.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="d39eef5d6e394fda2e0f92cc4b37f76d" name="tests/perl019.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="983c511ad79631663e4c163138f4879e" name="tests/perl020.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="d13e510ff409944a14ec75e9ea92e5d4" name="tests/perl021.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="6e88600bd86a10a023939a5d87e55b10" name="tests/perl022.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="fb7a147d7d35e5ddd0b6d285d1e8de86" name="tests/perl023.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="7967096d319e1050b198ce70f144ef47" name="tests/perl024.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="d9da32e5574cc61c473046799d5ad177" name="tests/perl025.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="75c79f22a16031ef3e6744e1e8bc8089" name="tests/perl026.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="0f0a7537b3bac7e978baa4e811b16d4e" name="tests/perl027.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="49472f8849f7feed927b4d5f2e5976f8" name="tests/perl028.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="218c7a3cac64592d26b5e0a971a744ea" name="tests/perl029.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="c4d0ca62038a0292e8de9d6ef9506ef4" name="tests/perl030.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="71783e2c9ad1a8fd7d7e899f4cad4a92" name="tests/perl031.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="94a2eac30596e491bf07b26467667f20" name="tests/perl032.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="d1dcebc2560c364ecd12f2ad598e5cba" name="tests/perl033.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="84fb6b7012c40e1ad4d3b404d63f98a3" name="tests/perl034.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="4642a8f0fd25486e76eb8925457a3a92" name="tests/perl035.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="743c3328ec079bb668a72f183bcd4834" name="tests/perl036.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="a0889120f1a47ef7ee8b2c3739a8b602" name="tests/perl037.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="0331dd78d8a84d5c6889e8569a742809" name="tests/perl038.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="499eb4fae3c06aa2f26f722b60b2736f" name="tests/perl039.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="f6f80d5a517b9af65776cda1a76d3747" name="tests/perl040.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="13d050af1f550e8f96a704372927cb18" name="tests/perl041.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="98a015944de2b361d503daa351fa5bb5" name="tests/perl042.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="2d2d2ceb34af5426e9484a41222c8820" name="tests/perl043.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="a80efa3e92b7f41e4b95dd08ab566e7c" name="tests/perl044.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="8986419a6cba12382398d74bab9b205f" name="tests/perl045.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="3edcc2c1434a4fbd16c3d2dbabf18137" name="tests/perl046.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="0c8f62010490c0a526259b762261f562" name="tests/perl047.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="26ceac11d6ce2d65744da277ee0bde96" name="tests/perl048.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="2a03be250af94ce7726223b45377c057" name="tests/perl049.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="add8bda198738d3f1edbcecaf06a83cc" name="tests/perl050.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="862654f11f519c54ba65bdc0bcec52a4" name="tests/perl051.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="088eb975838207645eea598ef4f616d9" name="tests/perl052.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="91e5dbdb02926f4dc94f624180ec1e7c" name="tests/perl053.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="1661833fe6b8c478a53ce59b426dadd1" name="tests/perl054.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="7a73c39fc74c5cd6af5c4ea774dc4d68" name="tests/perl055.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="8d6d6f6ead5aa1081234709e2e5e58c2" name="tests/perl056.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="718eea4980cc8dffa0db51a401f65d71" name="tests/perl057.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="50019a011de8d2e6b280844ebcea0cc3" name="tests/perl058.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="4ba8b6602387cc37694462ad57c1c803" name="tests/perl059.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="34bcddbc8db7a500c40584e5a12a8551" name="tests/perl060.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="175803d57c0ea1d1a229f5ab31d61390" name="tests/perl061.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="5ccc4d49857cc96a2d4a2be420d7b1e1" name="tests/perl062.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="6c5b903988acb21846513e3dbc19dc32" name="tests/perl063.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="496a9adfeaf7e797e5426b97d9dd5a92" name="tests/perl064.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="3255e641dac297c5a1da3815a4679957" name="tests/perl065.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="90ab3082bd7a74ef1b351ee2bdb526af" name="tests/perl066.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="9fd14d80ce190676dea579cc55ef948c" name="tests/perl067.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="fd8713face2a4df7bdf6afc613b7e0b3" name="tests/perl068.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="8adaa8614d45e5bf1ecd81c73950135f" name="tests/perl069.phpt"/>
+   <file role="test" baseinstalldir="perl" md5sum="5e5d57731292002b90ffad52fc59e00a" name="tests/perl070.phpt"/>
+  </filelist>
+ </release>
+</package>

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/CREDITS
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/CREDITS	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/CREDITS	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,2 @@
+perl
+Dmitry Stogov

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/EXPERIMENTAL
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/EXPERIMENTAL	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/EXPERIMENTAL	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,5 @@
+this extension is experimental,
+its functions may change their names 
+or move to extension all together 
+so do not rely to much on them 
+you have been warned!

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/README
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/README	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/README	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,162 @@
+What is ext/perl?
+=================
+
+  This extension allows embedding of Perl Interpreter into PHP5 to:
+    * execute Perl files
+    * evaluate Perl code
+    * access values of Perl variables
+    * call Perl subroutines
+    * instantiate and manipulate of Perl objects
+
+Requirements
+============
+  PHP 5.0.0RC2 or later
+  Perl 5.8.0 or later
+
+Quick install
+=============
+
+  Step 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to real
+          PHP and Perl instalation prefixes.
+
+    export PHP_PREFIX="/usr"
+    export PERL_PREFIX="/usr"
+    $PHP_PREFIX/bin/phpize
+    ./configure --with-perl=$PERL_PREFIX --with-php-config=$PHP_PREFIX/bin/php-config
+    make  
+
+  Step 2. Install the extension (this step can require root privileges)
+
+    make install
+
+  Step 3. Add perl extension into your php.ini (this step can require root privileges)
+
+    extension=perl.so
+
+Windows Installation Notes
+==========================
+
+  Step 1. Download ActivePerl binaries for Windows from 
+          http://www.activestate.com/Products/ActivePerl/
+          and install them.
+
+  Step 2. Put this extension into corresponding PHP source tree (into ext/perl)
+
+  Step 3. Compile the extension
+
+    SET PERL_HOME=C:\perl
+    msdev perl.dsp /MAKE "perl - Win32 Release_TS"
+
+  Step 4. Copy php_perl.dll (from Release_TS) to PHP extension dir
+
+  Step 5. Add perl extension into your php.ini
+
+    extension=php_perl.dll
+
+PHP API
+=======
+
+  new Perl()
+  ----------
+    Creates perl interpreter. It allows
+
+    * reading and modifying of Perl variables
+    * calling Perl functions
+    * evaluating Perl code
+    * loading and executing exteranl Perl files
+
+    Examples:
+      $perl = new Perl();
+      var_dump($perl->x);        // print scalar Perl variable - $x
+      var_dump($perl->array->x); // print array Perl variable - @x
+      var_dump($perl->hash->x);  // print hash Perl variable - %x
+      $perl->func();             // call Perl function 'func' in void context
+      $x = $perl->func();        // call Perl function 'func' in scalar context
+      $y = $perl->array->func(); // call Perl function 'func' in array context            
+      $y = $perl->hash->func();  // call Perl function 'func' in hash context
+
+      $perl->eval('use Digest::MD5');
+      echo $perl->{'Digest::MD5::md5_hex'}('Hello');
+
+  
+  Perl->eval($perl_code)
+  ----------------------
+    Evaluates Perl code and returns result. If Perl code is invalid it will
+    throw PHP exception. 
+
+    Exampes:
+      $perl = new Perl();
+      $perl->eval('require "test.pl";');
+      echo $perl->eval($x.'+'.$y.';');
+      $perl->eval('$z='.$x.'+'.$y.';');
+
+    By default Perl code is evaluated in scalar context, but it can be 
+    evaluated in array or hash context too.
+
+    Exampes:
+      $perl = new Perl();
+      $perl->eval('("a","b","c")');                  // eval in void context
+      var_dump($perl->eval('("a","b","c")'));        // eval in scalar context
+      var_dump($perl->array->eval('("a","b","c")')); // eval in array context
+      var_dump($perl->hash->eval('("a","b","c")'));  // eval in hash context
+
+
+  Perl->require($perl_file_name)
+  ------------------------------
+    Loads and executes Perl file. It doesn't return any value. If required Perl
+    file doesn't exist or invalid it will throw PHP exception.
+
+    Examples:
+      $perl = new Perl();
+      $perl->require('test.pl');
+
+  new Perl($perl_class_name[, $constructor = "new"[, ...]])
+  -----------------------------------------------------
+    Creates an instance of Perl class through calling specified constructor
+    or "new" if constructor is not specified. Additional parameters passed
+    to Perl's constructor. The created object allows:
+
+    * reading and modifying of object properties
+    * calling methods
+    * cloning
+
+    Examples:
+      $x = new Perl("Test");
+      $y = new Perl("Test","copy",$x);
+      $z = clone $y;
+      echo $z->property;
+      echo $z->method(1,2,3);
+
+    Methods can be called in array or hash context in the same way as Perl
+    functions, but all properties are acessable directly (without array or
+    hash modifiers).
+
+    Examples:
+      $x = new Perl("Test");
+      $x->f();                  // call method "f" in void context
+      var_dump($x->f());        // call method "f" in scalar context
+      var_dump($x->array->f()); // call method "f" in array context
+      var_dump($x->hash->f());  // call method "f" in hash context
+
+
+
+Known BUGS and limitations
+==========================
+  *  Perl objects passed between Perl and PHP by reference all other data type
+     (including arrays and hashes) passed by value. So modification of Perl's
+     arrays and hashes in PHP will not have effect in Perl.
+
+     $x = $perl->array->x;
+     $x[0] = 1; // Perl's array @x still unmodifyed
+     
+     But you can use PHP references to do this. The following code works fine.
+     
+     $x = &$perl->array->x;
+     $x[0] = 1; // Modifies Perl's array @x
+
+  *  pecl/perl can't call internal Perl functions
+     (print, die, ...).
+
+This extension was testd on RedHat Linux 9.0 with PHP 5.0.0RC2-dev (non ZTS build)
+and perl-5.8.0 (installed from RPM) and on Windows 2000 with PHP-5.0.0RC2-dev
+(ZTS build) and perl-5.8.0.

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/TODO
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/TODO	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/TODO	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,7 @@
+-? call internal Perl functions (print)
+   (see test: 18)
+-? PHP memory leaks
+   (see tests: 53)
+-  Perl memory leaks
+-  *** Warning: Linking the shared library library perl.la against the
+   DynaLoader.a is not portable!

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.m4
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.m4	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.m4	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,33 @@
+dnl $Id: config.m4,v 1.2 2004/12/14 18:04:36 dmitry Exp $
+dnl config.m4 for extension perl
+
+PHP_ARG_WITH(perl, for perl support,
+[  --with-perl[=DIR]      Include perl support. DIR is the perl base directory.])
+
+if test "$PHP_PERL" != "no"; then
+  for i in $PHP_PERL /usr/local /usr; do
+    if test -x $i/bin/perl; then
+      PERL_DIR=$i
+      break
+    fi
+  done
+
+  if test -z "$PERL_DIR"; then
+    AC_MSG_ERROR([Cannot find perl executable under $PHP_PERL.])
+  fi
+
+  EXTRA_CFLAGS=`$PERL_DIR/bin/perl -MExtUtils::Embed -e ccopts`
+  EXTRA_LDFLAGS=`$PERL_DIR/bin/perl -MExtUtils::Embed -e ldopts`
+
+  PHP_SUBST(EXTRA_CFLAGS)
+  PHP_SUBST(EXTRA_LDFLAGS)
+dnl  PHP_EVAL_LIBLINE($PERL_LDFLAGS, PERL_SHARED_LIBADD)
+dnl  PHP_EVAL_INCLINE($PERL_CFLAGS)
+
+dnl  PHP_SUBST(PERL_SHARED_LIBADD)
+
+dnl  PHP_ADD_LIBRARY_WITH_PATH(perl, $PERL_DIR, MYSQL_SHARED_LIBADD)
+dnl  PHP_ADD_INCLUDE($PERL_DIR)
+  AC_DEFINE(HAVE_PERL,1,[Whether you have perl])
+  PHP_NEW_EXTENSION(perl, php_perl.c, $ext_shared)
+fi

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.w32
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.w32	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/config.w32	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,16 @@
+// $Id: config.w32,v 1.2 2004/04/15 16:14:57 edink Exp $
+// config.w32 for extension perl
+
+ARG_WITH("perl", "Perl support (where to find Perl interpriter)", "no");
+
+if (PHP_PERL != "no") {
+  if (CHECK_LIB("perl*.lib", "perl", PHP_PERL + ";\\Perl\\lib\\CORE" ) &&
+      CHECK_HEADER_ADD_INCLUDE("perl.h", "CFLAGS_PERL", PHP_PERL + ";\\Perl\\lib\\CORE")) {
+    EXTENSION("perl", "php_perl.c");
+    AC_DEFINE("HAVE_PERL", 1, "Perl support");
+
+    ADD_FLAG("CFLAGS_PERL", "/DHAVE_PERL /D_CONSOLE /DNO_STRICT /DPERL_IMLICIT_CONTEXT /DPERL_IMPLICIT_SYS /DUSE_PERLIO /DPERL_MSVCRT_READFIX");
+  } else {
+    WARNING("perl not enabled; libraries and headers not found");
+  }
+}

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/perl.dsp
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/perl.dsp	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/perl.dsp	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,163 @@
+# Microsoft Developer Studio Project File - Name="perl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=perl - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "perl.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "perl.mak" CFG="perl - Win32 Debug_TS"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "perl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "perl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "perl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "perl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "perl - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PERL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /I "$(PERL_HOME)\lib\CORE" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D "HAVE_PERL" /D COMPILE_DL_PERL=1 /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "NDEBUG" /D "PHP_EXPORTS" /D "_CONSOLE" /D "NO_STRICT" /D "PERL_IMLICIT_CONTEXT" /D "PERL_IMPLICIT_SYS" /D "USE_PERLIO" /D "PERL_MSVCRT_READFIX" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib perl58.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_perl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"$(PERL_HOME)\lib\CORE"
+
+!ELSEIF  "$(CFG)" == "perl - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PERL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /I "$(PERL_HOME)\lib\CORE" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_PERL" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_PERL=1 /D ZTS=1 /D "WIN32" /D "NDEBUG" /D "PHP_EXPORTS" /D "_CONSOLE" /D "NO_STRICT" /D "PERL_IMLICIT_CONTEXT" /D "PERL_IMPLICIT_SYS" /D "USE_PERLIO" /D "PERL_MSVCRT_READFIX" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib perl58.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_perl.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"$(PERL_HOME)\lib\CORE"
+
+!ELSEIF  "$(CFG)" == "perl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PERL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /I "$(PERL_HOME)\lib\CORE" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_PERL" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_PERL=1 /D ZTS=1 /D "WIN32" /D "NDEBUG" /D "PHP_EXPORTS" /D "_CONSOLE" /D "NO_STRICT" /D "PERL_IMLICIT_CONTEXT" /D "PERL_IMPLICIT_SYS" /D "USE_PERLIO" /D "PERL_MSVCRT_READFIX" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 php5_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib perl58.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug/php_perl.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"$(PERL_HOME)\lib\CORE"
+
+!ELSEIF  "$(CFG)" == "perl - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PERL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /I "$(PERL_HOME)\lib\CORE" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D "HAVE_PERL" /D COMPILE_DL_PERL=1 /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "NDEBUG" /D "PHP_EXPORTS" /D "_CONSOLE" /D "NO_STRICT" /D "PERL_IMLICIT_CONTEXT" /D "PERL_IMPLICIT_SYS" /D "USE_PERLIO" /D "PERL_MSVCRT_READFIX" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 php5.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib perl58.lib /nologo /dll /machine:I386 /out:"..\..\Release/php_perl.dll" /libpath:"..\..\Release" /libpath:"..\..\Release_Inline" /libpath:"$(PERL_HOME)\lib\CORE"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "perl - Win32 Release_TS"
+# Name "perl - Win32 Debug_TS"
+# Name "perl - Win32 Release"
+# Name "perl - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\php_perl.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_perl.h
+# End Source File
+# End Group
+# End Target
+# End Project

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.c
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.c	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.c	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,1917 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 4                                                        |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2003 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.0 of the PHP license,       |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_0.txt.                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Author: Dmitry Stogov <dmitry at zend.com>                              |
+   +----------------------------------------------------------------------+
+   $Id: php_perl.c,v 1.14 2004/12/17 10:49:46 dmitry Exp $
+*/
+
+#ifdef COMPILE_DL_PERL
+#define HAVE_PERL 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_PERL
+
+#ifdef ZEND_WIN32
+#  define _WINSOCK2API_           /* using winsock.h instead of winsock2.h */
+#  define READDIR_H
+#  define _INET_H_
+#  define _NETDB_H_
+#endif
+
+#include <EXTERN.h>               /* from the Perl distribution */
+#include <perl.h>                 /* from the Perl distribution */
+#include <perliol.h>              /* from the Perl distribution */
+#include <perlapi.h>              /* from the Perl distribution */
+
+//#include <XSUB.h>                 /* from the Perl distribution */
+
+#define ST(off) PL_stack_base[ax + (off)]
+
+#undef YYDEBUG                    /* bypass macros redeclaration warning */
+#undef END_EXTERN_C               /* bypass macros redeclaration warning */
+
+#include "php.h"
+#include "php_ini.h"
+#include "zend_objects_API.h"
+#include "zend_exceptions.h"
+#include "zend_extensions.h"
+#include "ext/standard/info.h"
+#include "SAPI.h"
+#include "php_perl.h"
+
+ZEND_BEGIN_MODULE_GLOBALS(perl)
+  PerlInterpreter *perl;
+  HashTable       perl_objects; /* this hash is used to make one to one
+                                   mapping between Perl and PHP objects */
+ZEND_END_MODULE_GLOBALS(perl)
+
+#ifdef ZTS
+#define PERLG(v) TSRMG(perl_globals_id, zend_perl_globals *, v)
+#else
+#define PERLG(v) (perl_globals.v)
+#endif
+
+ZEND_DECLARE_MODULE_GLOBALS(perl);
+
+PHP_METHOD(Perl, eval);
+PHP_METHOD(Perl, require);
+
+static zend_function_entry perl_functions[] = {
+  PHP_ME(Perl, eval, NULL, ZEND_ACC_PUBLIC)
+  PHP_ME(Perl, require, NULL, ZEND_ACC_PUBLIC)
+  {NULL, NULL, NULL}
+};
+
+/****************************************************************************/
+/* This code was produced by `perl -MExtUtils::Embed -e xsinit`             */
+
+EXTERN_C void xs_init (pTHX);
+
+EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
+
+EXTERN_C void
+xs_init(pTHX)
+{
+  char *file = __FILE__;
+  dXSUB_SYS;
+
+  /* DynaLoader is a special case */
+  newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+}
+/****************************************************************************/
+
+typedef enum _perl_context {
+  PERL_SCALAR,
+  PERL_ARRAY,
+  PERL_HASH
+} perl_context;
+
+typedef struct php_perl_object {
+  zend_object   zo;
+  SV           *sv;           /* Perl's representation of object */
+  HashTable    *properties;   /* Temporary collection of object properties */
+  perl_context  context;      /* flag for next perl call, property */
+} php_perl_object;
+
+
+static zend_class_entry* perl_class_entry;
+static zend_class_entry* perl_exception_class_entry;
+
+/* PHP <-> Perl data conversion routines */
+static SV*  php_perl_zval_to_sv_noref(PerlInterpreter* my_perl, zval* zv, HashTable* var_hash TSRMLS_DC);
+static SV*  php_perl_zval_to_sv_ref(PerlInterpreter* my_perl, zval* zv, HashTable* var_hash TSRMLS_DC);
+static SV*  php_perl_zval_to_sv(PerlInterpreter* my_perl, zval* zv TSRMLS_DC);
+static zval* php_perl_sv_to_zval_noref(PerlInterpreter* my_perl, SV* sv, zval* zv, HashTable* var_hash TSRMLS_DC);
+static zval* php_perl_sv_to_zval_ref(PerlInterpreter* my_perl, SV* sv, zval* zv, HashTable* var_hash TSRMLS_DC);
+static zval* php_perl_sv_to_zval(PerlInterpreter* my_perl, SV* sv, zval* zv TSRMLS_DC);
+
+/* Handlers for Perl objects overloading */
+static zend_object_value php_perl_clone(zval *object TSRMLS_DC);
+static zval* php_perl_read_property(zval *object, zval *member, int type TSRMLS_DC);
+static void php_perl_write_property(zval *object, zval *member, zval *value TSRMLS_DC);
+static zval* php_perl_read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
+static void php_perl_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC);
+static int php_perl_has_property(zval *object, zval *member, int check_empty TSRMLS_DC);
+static void php_perl_unset_property(zval *object, zval *member TSRMLS_DC);
+static int php_perl_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC);
+static void php_perl_unset_dimension(zval *object, zval *offset TSRMLS_DC);
+static HashTable* php_perl_get_properties(zval *object TSRMLS_DC);
+#if (ZEND_EXTENSION_API_NO >= 220041030)
+static zend_function *php_perl_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC);
+#else
+static zend_function *php_perl_get_method(zval *object, char *method, int method_len TSRMLS_DC);
+#endif
+static int php_perl_call_function_handler(char *method, INTERNAL_FUNCTION_PARAMETERS);
+static zend_function *php_perl_get_constructor(zval *object TSRMLS_DC);
+static zend_class_entry* php_perl_get_class_entry(zval *object TSRMLS_DC);
+static int php_perl_get_class_name(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
+static zval* php_perl_get(zval *object TSRMLS_DC);
+static void php_perl_set(zval **object, zval *value TSRMLS_DC);
+
+static void php_perl_constructor_handler(INTERNAL_FUNCTION_PARAMETERS);
+
+static void php_perl_destructor(void *perl_object, zend_object_handle handle TSRMLS_DC);
+static void php_perl_cleaner(void *perl_object, zend_object_handle handle TSRMLS_DC);
+
+static zend_object_handlers php_perl_object_handlers = {
+  zend_objects_store_add_ref,      /* add_ref */
+  zend_objects_store_del_ref,      /* del_ref */
+  php_perl_clone,                  /* clone_obj */
+
+  php_perl_read_property,          /* read_property */
+  php_perl_write_property,         /* write_property */
+  php_perl_read_dimension,         /* read_dimension */
+  php_perl_write_dimension,        /* write_dimension */
+  NULL,                            /* get_property_ptr_ptr */
+  NULL,                            /* get */
+  NULL,                            /* set */
+  php_perl_has_property,           /* has_property */
+  php_perl_unset_property,         /* unset_property */
+  php_perl_has_dimension,          /* has_dimension */
+  php_perl_unset_dimension,        /* unset_dimension */
+  php_perl_get_properties,         /* get_properties */
+  php_perl_get_method,             /* get_method */
+  php_perl_call_function_handler,  /* call_method */
+  php_perl_get_constructor,        /* get_constructor */
+  php_perl_get_class_entry,        /* get_class_entry */
+  php_perl_get_class_name,         /* get_class_name */
+  NULL,                            /* compare_objects */
+  NULL,                            /* cast_object */
+  NULL,                            /* count_elements */
+};
+
+static zend_object_handlers php_perl_proxy_handlers = {
+  zend_objects_store_add_ref,      /* add_ref */
+  zend_objects_store_del_ref,      /* del_ref */
+  php_perl_clone,                  /* clone_obj */
+
+  php_perl_read_property,          /* read_property */
+  php_perl_write_property,         /* write_property */
+  php_perl_read_dimension,         /* read_dimension */
+  php_perl_write_dimension,        /* write_dimension */
+  NULL,                            /* get_property_ptr_ptr */
+  php_perl_get,                    /* get */
+  php_perl_set,                    /* set */
+  php_perl_has_property,           /* has_property */
+  php_perl_unset_property,         /* unset_property */
+  php_perl_has_dimension,          /* has_dimension */
+  php_perl_unset_dimension,        /* unset_dimension */
+  php_perl_get_properties,         /* get_properties */
+  php_perl_get_method,             /* get_method */
+  php_perl_call_function_handler,  /* call_method */
+  php_perl_get_constructor,        /* get_constructor */
+  php_perl_get_class_entry,        /* get_class_entry */
+  php_perl_get_class_name,         /* get_class_name */
+  NULL,                            /* compare_objects */
+  NULL,                            /* cast_object */
+  NULL,                            /* count_elements */
+};
+
+zend_internal_function php_perl_constructor_function = {
+  ZEND_INTERNAL_FUNCTION,
+  "Perl",
+  NULL,
+  0,
+  NULL,
+  2,
+  0,
+  NULL,
+  0,
+  0,
+  php_perl_constructor_handler
+};
+
+static SV* PerlIOPHP_getarg(pTHX_ PerlIO *f, CLONE_PARAMS *param, int flags)
+{
+  Perl_croak(aTHX_ "an attempt to getarg from a stale io handle");
+  return NULL;
+}
+
+static SSize_t PerlIOPHP_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count)
+{
+  return zend_write(vbuf, count);
+}
+
+static IV PerlIOPHP_flush(pTHX_ PerlIO *f)
+{
+  TSRMLS_FETCH();
+  sapi_flush(TSRMLS_C);
+  return 0;
+}
+
+static IV PerlIOPHP_noop_fail(pTHX_ PerlIO *f)
+{
+    return -1;
+}
+
+static PerlIO_funcs PerlIO_PHP = {
+    sizeof(PerlIO_funcs),
+    "PHP",
+    sizeof(struct _PerlIO),
+    PERLIO_K_MULTIARG | PERLIO_K_RAW,
+    PerlIOBase_pushed,
+    PerlIOBase_popped,
+    NULL,
+    PerlIOBase_binmode,
+    PerlIOPHP_getarg,
+    PerlIOBase_fileno,
+    PerlIOBase_dup,
+    PerlIOBase_read,
+    NULL,
+    PerlIOPHP_write,
+    NULL,                       /* can't seek on STD{IN|OUT}, fail on call*/
+    NULL,                       /* can't tell on STD{IN|OUT}, fail on call*/
+    PerlIOBase_close,
+    PerlIOPHP_flush,
+    PerlIOPHP_noop_fail,        /* fill */
+    PerlIOBase_eof,
+    PerlIOBase_error,
+    PerlIOBase_clearerr,
+    PerlIOBase_setlinebuf,
+    NULL,                       /* get_base */
+    NULL,                       /* get_bufsiz */
+    NULL,                       /* get_ptr */
+    NULL,                       /* get_cnt */
+    NULL,                       /* set_ptrcnt */
+};
+
+/* Creates Perl interpriter if it was not created brfore */
+static PerlInterpreter* php_perl_init(TSRMLS_D)
+{
+  PerlInterpreter* my_perl = PERLG(perl);
+
+  if (my_perl == NULL) {
+    char *embedding[] = { "", "-e", "0" };
+
+    my_perl = perl_alloc();
+    perl_construct(my_perl);
+    PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
+    perl_parse(my_perl, xs_init, 3, embedding, (char **)NULL);
+/*???FIXME: I don't understend if it need or not
+    perl_run(my_perl);
+*/
+    PerlIO_define_layer(aTHX_ &PerlIO_PHP);
+    PerlIO_apply_layers(aTHX_ PerlIO_stdout(), "w", ":PHP");
+
+    PERLG(perl) = my_perl;
+    zend_hash_init(&PERLG(perl_objects), 0, NULL, NULL, 0);
+  }
+  return my_perl;
+}
+
+/* Destroys Perl interpriter if it was created brfore */
+static void php_perl_destroy(TSRMLS_D)
+{
+  PerlInterpreter* my_perl = PERLG(perl);
+
+  if (my_perl != NULL) {
+    zend_hash_destroy(&PERLG(perl_objects));
+    perl_destruct(my_perl);
+    perl_free(my_perl);
+    PERLG(perl) = NULL;
+  }
+}
+
+/* Remembers mapping betwenn Perl and PHP object */
+static void php_perl_remember_object(SV* sv, zend_object_handle handle TSRMLS_DC) {
+  zend_hash_add(&PERLG(perl_objects), (char*)SvRV(sv), sizeof(sv),
+                &handle, sizeof(zend_object_handle), NULL);
+}
+
+/* Forgets mapping betwenn Perl and PHP object */
+static inline void php_perl_forget_object(SV* sv TSRMLS_DC) {
+  if (sv) {
+    zend_hash_del(&PERLG(perl_objects), (char*)SvRV(sv), sizeof(sv));
+  }
+}
+
+/* Converts PHP's value to Perl's eqivalent */
+static SV* php_perl_zval_to_sv(PerlInterpreter *my_perl,
+                               zval            *zv TSRMLS_DC)
+{
+  HashTable var_hash;
+  SV* sv;
+
+  zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+  sv = php_perl_zval_to_sv_ref(my_perl, zv, &var_hash TSRMLS_CC);
+  zend_hash_destroy(&var_hash);
+  return sv;
+}
+
+static SV* php_perl_zval_to_sv_ref(PerlInterpreter *my_perl,
+                                   zval            *zv,
+                                   HashTable       *var_hash TSRMLS_DC)
+{
+  SV* sv;
+
+  if ((zv->is_ref || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) &&
+      zend_hash_find(var_hash, (char*)zv, sizeof(zv), (void**)&sv) == SUCCESS) {
+    sv = *(SV**)sv;
+    SvREFCNT_inc(sv);
+    return sv;
+  }
+  sv = php_perl_zval_to_sv_noref(my_perl, zv, var_hash TSRMLS_CC);
+  if (zv->is_ref || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) {
+    zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+  }
+  return sv;
+}
+
+static SV* php_perl_zval_to_sv_noref(PerlInterpreter *my_perl,
+                                     zval            *zv,
+                                     HashTable       *var_hash TSRMLS_DC)
+{
+  switch (Z_TYPE_P(zv)) {
+    case IS_NULL:
+      return &PL_sv_undef;
+    case IS_LONG:
+      return newSViv(Z_LVAL_P(zv));
+    case IS_DOUBLE:
+      return newSVnv(Z_DVAL_P(zv));
+    case IS_STRING:
+      return newSVpv(Z_STRVAL_P(zv), Z_STRLEN_P(zv));
+    case IS_ARRAY: {
+      HashTable* ht = zv->value.ht;
+      int is_hash  = 0;
+
+      /* checking if 'hv' is array or hash */
+      zend_hash_internal_pointer_reset(ht);
+      while (1) {
+        int key_type = zend_hash_get_current_key_type(ht);
+        if (key_type == HASH_KEY_NON_EXISTANT) {
+          break;
+        }
+        if (key_type == HASH_KEY_IS_STRING) {
+          is_hash = 1;
+          break;
+        }
+        zend_hash_move_forward(ht);
+      }
+
+      if (is_hash) {
+        /* converting to Perl's hash */
+        HV* hv = newHV();
+        SV* sv = (SV*)newRV((SV*)hv);
+        zval** zv_ptr;
+
+        if (zv->is_ref || Z_TYPE_P(zv) == IS_ARRAY) {
+          zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+        }
+
+        for (zend_hash_internal_pointer_reset(ht);
+             zend_hash_get_current_data(ht, (void **) &zv_ptr) == SUCCESS;
+             zend_hash_move_forward(ht)
+            ) {
+          char* key;
+          int key_len;
+          ulong index;
+
+          if (zend_hash_get_current_key_ex(ht, &key, &key_len, &index, 0, NULL) != HASH_KEY_IS_STRING) {
+            char xkey[16];
+            zend_sprintf(xkey, "%ld", index);
+            hv_store(hv, xkey, strlen(xkey),
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, var_hash TSRMLS_CC), 0);
+          } else {
+            hv_store(hv, key, key_len-1,
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, var_hash TSRMLS_CC), 0);
+          }
+        }
+
+        return sv;
+      } else {
+        /* converting to Perl's array */
+        AV* av = newAV();
+        SV* sv = (SV*)newRV((SV*)av);
+        zval** zv_ptr;
+
+        if (zv->is_ref || Z_TYPE_P(zv) == IS_ARRAY) {
+          zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+        }
+
+        for (zend_hash_internal_pointer_reset(ht);
+             zend_hash_get_current_data(ht, (void **) &zv_ptr) == SUCCESS;
+             zend_hash_move_forward(ht)
+            ) {
+          char *key;
+          ulong index;
+
+          if (zend_hash_get_current_key(ht, &key, &index, 0) != HASH_KEY_IS_STRING) {
+            av_store(av, index,
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, var_hash TSRMLS_CC));
+          }
+        }
+        return sv;
+      }
+    }
+    case IS_OBJECT:
+      if (zv->value.obj.handlers == &php_perl_object_handlers ||
+          zv->value.obj.handlers == &php_perl_proxy_handlers) {
+        php_perl_object *obj = zend_object_store_get_object(zv TSRMLS_CC);
+        return newSVsv(obj->sv);
+      }
+      break;
+    case IS_BOOL:
+      return Z_LVAL_P(zv)?&PL_sv_yes:&PL_sv_no;
+    default:
+      break;
+  }
+  zend_error(E_ERROR, "[perl] Can't convert PHP type (%d) to Perl",
+             Z_TYPE_P(zv));
+  return &PL_sv_undef;
+}
+
+/* Converts Perl's value to PHP's eqivalent */
+static zval* php_perl_sv_to_zval(PerlInterpreter* my_perl, SV* sv, zval* zv TSRMLS_DC)
+{
+  HashTable var_hash;
+
+  zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+  zv = php_perl_sv_to_zval_ref(my_perl, sv, zv, &var_hash TSRMLS_CC);
+  zend_hash_destroy(&var_hash);
+  return zv;
+}
+
+static zval* php_perl_sv_to_zval_ref(PerlInterpreter *my_perl,
+                                     SV              *sv,
+                                     zval            *zv,
+                                     HashTable       *var_hash TSRMLS_DC)
+{
+  zval** z;
+
+  if (SvREFCNT(sv) > 1 &&
+      zend_hash_find(var_hash, (char*)sv, sizeof(sv), (void**)&z) == SUCCESS) {
+    if (zv != NULL) {
+      FREE_ZVAL(zv);
+    }
+    if (Z_TYPE_PP(z) != IS_OBJECT) {
+      (*z)->is_ref = 1;
+    }
+    (*z)->refcount++;
+    return *z;
+  }
+
+  if (zv == NULL) {ALLOC_INIT_ZVAL(zv);}
+
+  if (SvREFCNT(sv) > 1) {
+    zend_hash_add(var_hash, (char*)sv, sizeof(sv), &zv, sizeof(zval*), NULL);
+  }
+  return php_perl_sv_to_zval_noref(my_perl, sv, zv, var_hash TSRMLS_CC);
+}
+
+static zval* php_perl_sv_to_zval_noref(PerlInterpreter *my_perl,
+                                       SV              *sv,
+                                       zval            *zv,
+                                       HashTable       *var_hash TSRMLS_DC)
+{
+  if (sv) {
+    if (SvTYPE(sv) == SVt_NULL) {    /* null */
+      ZVAL_NULL(zv);
+    } else if (SvIOK(sv)) {          /* integer */
+      ZVAL_LONG(zv, SvIV(sv));
+    } else if (SvNOK(sv)) {          /* double */
+      ZVAL_DOUBLE(zv, SvNV(sv));
+    } else if (SvPOK(sv)) {          /* string */
+      int  len;
+      char *str = SvPV(sv, len);
+      ZVAL_STRINGL(zv, str, len, 1);
+    } else if (sv_isobject(sv)) {    /* object */
+      zend_object_handle* handle;
+      if (zend_hash_find(&PERLG(perl_objects), (char*)SvRV(sv), sizeof(SV*), (void**)&handle) == SUCCESS) {
+        zv->type = IS_OBJECT;
+        zv->value.obj.handlers = &php_perl_object_handlers;;
+        zv->value.obj.handle   = *handle;
+        zend_objects_store_add_ref(zv TSRMLS_CC);
+      } else {
+        php_perl_object *obj = (php_perl_object*)emalloc(sizeof(php_perl_object));
+        obj->sv = sv;
+        obj->properties = NULL;
+        SvREFCNT_inc(sv);
+        zv->type = IS_OBJECT;
+        zv->value.obj.handlers = &php_perl_object_handlers;
+        zv->value.obj.handle =
+          zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);
+        php_perl_remember_object(sv, zv->value.obj.handle TSRMLS_CC);
+      }
+    } else if (SvROK(sv)) {                        /* reference */
+      zv = php_perl_sv_to_zval_ref(my_perl, SvRV(sv), zv, var_hash TSRMLS_CC);
+    } else if (SvTYPE(sv) == SVt_PVAV) {           /* array */
+      I32 i   = 0;
+      I32 len = av_len((AV*)sv);
+
+      array_init(zv);
+      for (i = 0; i <= len; i++) {
+        SV** el_sv = av_fetch((AV*)sv, i, 0);
+        if (el_sv != NULL && *el_sv != NULL) {
+          add_index_zval(zv, i,
+            php_perl_sv_to_zval_ref(my_perl, *el_sv, NULL, var_hash TSRMLS_CC));
+        }
+      }
+    } else if (SvTYPE(sv) == SVt_PVHV) {           /* hash */
+      SV*   el_sv;
+      char* key;
+      I32   key_len;
+
+      array_init(zv);
+      hv_iterinit((HV*)sv);
+      while ((el_sv = hv_iternextsv((HV*)sv, &key, &key_len)) != NULL) {
+        add_assoc_zval_ex(zv, key, key_len+1,
+          php_perl_sv_to_zval_ref(my_perl, el_sv, NULL, var_hash TSRMLS_CC));
+      }
+    } else {
+      zend_error(E_ERROR, "[perl] Can't convert Perl type (%ld) to PHP",
+                 SvTYPE(sv));
+    }
+  }
+  return zv;
+}
+
+/* Calls constructor of Perl's class and returns created object */
+static SV* php_perl_call_constructor(PerlInterpreter* my_perl,
+                                     const char* class_name,
+                                     int class_name_len,
+                                     const char* constructor,
+                                     int constructor_len,
+                                     int argc,
+                                     zval** argv[] TSRMLS_DC)
+{
+  SV*   ret;
+  int   func_len = class_name_len + constructor_len + 3;
+  char *func = (char*)emalloc(func_len);
+
+  dSP;                            /* initialize stack pointer         */
+
+  int   i;
+
+  strcpy(func, class_name);
+  strcpy(func + class_name_len, "::");
+  strcpy(func + class_name_len + 2, constructor);
+
+
+  ENTER;                          /* everything created after here    */
+  SAVETMPS;                       /* ...is a temporary variable.      */
+  PUSHMARK(SP);                   /* remember the stack pointer       */
+
+  XPUSHs(sv_2mortal(newSVpv(class_name, class_name_len)));
+  for (i=0; i<argc; i++) {
+    XPUSHs(sv_2mortal(php_perl_zval_to_sv(my_perl, *argv[i] TSRMLS_CC)));
+  }
+
+  PUTBACK;                        /* make local stack pointer global  */
+  call_pv(func, G_SCALAR | G_EVAL | G_KEEPERR);        /* call the function                */
+  SPAGAIN;                        /* refresh stack pointer            */
+
+  ret = POPs;
+  SvREFCNT_inc(ret);
+
+  PUTBACK;
+  FREETMPS;                       /* free that return value           */
+  LEAVE;                          /* ...and the XPUSHed "mortal" args.*/
+
+  efree(func);
+  return ret;
+}
+
+/* Calls method of Perl's object */
+static void php_perl_call_method(PerlInterpreter* my_perl, SV* obj,
+                                 const char* func, int argc, zval** argv[],
+                                 perl_context context,
+                                 zval* return_value TSRMLS_DC)
+{
+  dSP;                            /* initialize stack pointer         */
+
+  int i;
+
+  ENTER;                          /* everything created after here    */
+  SAVETMPS;                       /* ...is a temporary variable.      */
+  PUSHMARK(SP);                   /* remember the stack pointer       */
+
+  XPUSHs(obj);
+
+  for (i=0; i<argc; i++) {
+    XPUSHs(sv_2mortal(php_perl_zval_to_sv(my_perl, *argv[i] TSRMLS_CC)));
+  }
+
+  PUTBACK;                        /* make local stack pointer global  */
+  if (return_value != NULL) {
+    if (context != PERL_SCALAR) {
+      int count, i;
+      I32 ax;
+      HashTable var_hash;
+
+      count = call_method(func, G_ARRAY | G_EVAL | G_KEEPERR);        /* call the function                */
+      SPAGAIN;                        /* refresh stack pointer            */
+      sp -= count;
+      ax = (sp - PL_stack_base) + 1;
+      zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+      array_init(return_value);
+      if (context == PERL_ARRAY) {
+        for (i = 0; i < count; i++) {
+          add_next_index_zval(return_value,
+            php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(i), NULL, &var_hash TSRMLS_CC));
+        }
+      } else {
+        for (i = 0; i < count; i++) {
+          int  key_len;
+          char *key = SvPV(ST(i), key_len);
+          if (i != count-1) {
+            add_assoc_zval_ex(return_value, key, key_len+1,
+              php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(++i), NULL, &var_hash TSRMLS_CC));
+          } else {
+            add_assoc_null_ex(return_value, key, key_len+1);
+          }
+        }
+      }
+      zend_hash_destroy(&var_hash);
+    } else {
+      call_method(func, G_SCALAR | G_EVAL | G_KEEPERR);        /* call the function                */
+      SPAGAIN;                        /* refresh stack pointer            */
+
+      php_perl_sv_to_zval(my_perl, POPs, return_value TSRMLS_CC);
+    }
+  } else {
+    call_method(func, G_DISCARD | G_EVAL | G_KEEPERR);        /* call the function                */
+    SPAGAIN;                        /* refresh stack pointer            */
+  }
+  PUTBACK;
+  FREETMPS;                       /* free that return value           */
+  LEAVE;                          /* ...and the XPUSHed "mortal" args.*/
+}
+
+/* Calls Perl's function */
+static void php_perl_call(PerlInterpreter* my_perl,
+                          const char* func, int argc, zval** argv[],
+                          perl_context context,
+                          zval* return_value TSRMLS_DC)
+{
+  dSP;                            /* initialize stack pointer         */
+
+  int i;
+
+  ENTER;                          /* everything created after here    */
+  SAVETMPS;                       /* ...is a temporary variable.      */
+  PUSHMARK(SP);                   /* remember the stack pointer       */
+
+  for (i=0; i<argc; i++) {
+    XPUSHs(sv_2mortal(php_perl_zval_to_sv(my_perl, *argv[i] TSRMLS_CC)));
+  }
+  PUTBACK;                        /* make local stack pointer global  */
+  if (return_value != NULL) {
+    if (context != PERL_SCALAR) {
+      int count, i;
+      I32 ax;
+      HashTable var_hash;
+
+      count = call_pv(func, G_ARRAY | G_EVAL | G_KEEPERR);        /* call the function                */
+      SPAGAIN;                        /* refresh stack pointer            */
+      sp -= count;
+      ax = (sp - PL_stack_base) + 1;
+      zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+      array_init(return_value);
+      if (context == PERL_ARRAY) {
+        for (i = 0; i < count; i++) {
+          add_next_index_zval(return_value,
+            php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(i), NULL, &var_hash TSRMLS_CC));
+        }
+      } else {
+        for (i = 0; i < count; i++) {
+          int  key_len;
+          char *key = SvPV(ST(i), key_len);
+          if (i != count-1) {
+            add_assoc_zval_ex(return_value, key, key_len+1,
+              php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(++i), NULL, &var_hash TSRMLS_CC));
+          } else {
+            add_assoc_null_ex(return_value, key, key_len+1);
+          }
+        }
+      }
+      zend_hash_destroy(&var_hash);
+    } else {
+      call_pv(func, G_SCALAR | G_EVAL | G_KEEPERR);        /* call the function                */
+      SPAGAIN;                        /* refresh stack pointer            */
+
+      php_perl_sv_to_zval(my_perl, POPs, return_value TSRMLS_CC);
+    }
+  } else {
+    call_pv(func, G_DISCARD | G_EVAL | G_KEEPERR);        /* call the function                */
+    SPAGAIN;                        /* refresh stack pointer            */
+  }
+  PUTBACK;
+  FREETMPS;                       /* free that return value           */
+  LEAVE;                          /* ...and the XPUSHed "mortal" args.*/
+}
+
+/****************************************************************************/
+
+static zval* php_perl_get(zval *object TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  zval *retval;
+
+  if (obj->sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not get value");
+    return NULL;
+  }
+  retval = php_perl_sv_to_zval(my_perl, obj->sv, NULL TSRMLS_CC);
+  /* ensure we're creating a temporary variable */
+  if (retval) {retval->refcount = 0;}
+  return retval;
+}
+
+static void php_perl_set(zval **object, zval *value TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(*object TSRMLS_CC);
+  SV *sv = obj->sv;
+
+  if (sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not set value");
+    return;
+  } 
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+  sv_setsv(sv, php_perl_zval_to_sv(my_perl, value TSRMLS_CC));
+}
+
+/* Returns element of array based Perl's object */
+static zval* php_perl_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  zval *retval = NULL;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+
+  if (sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not get dimension");
+    return NULL;
+  }
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+
+  if (SvTYPE(sv) == SVt_PVAV) {
+    AV* av = (AV*)sv;
+    SV** prop_val;
+
+    convert_to_long(offset);
+
+    prop_val = av_fetch(av, Z_LVAL_P(offset), 0);
+    if (prop_val != NULL) {
+      zend_bool write = FALSE;
+      if (type != BP_VAR_R && type != BP_VAR_IS) {
+        if (*prop_val != NULL && type != BP_VAR_R && type != BP_VAR_IS) {
+          write = TRUE;
+/*
+          SV* tmp_sv = *prop_val;
+
+          while (1) {
+            if (sv_isobject(tmp_sv) || 
+                SvTYPE(tmp_sv) == SVt_PVAV || 
+                SvTYPE(tmp_sv) == SVt_PVHV) {
+              write = TRUE;
+              break;
+            } else if (SvTYPE(tmp_sv) != SVt_RV) {
+              break;
+            }
+            tmp_sv = SvRV(tmp_sv);
+          }
+*/
+        }
+      }
+      if (write && !sv_isobject(*prop_val)) {
+        php_perl_object *obj = (php_perl_object*)emalloc(sizeof(php_perl_object));
+
+        obj->zo.ce = perl_class_entry;
+        obj->sv = newRV(*prop_val);
+        obj->properties = NULL;
+        obj->context = PERL_SCALAR;
+
+        ALLOC_INIT_ZVAL(retval);
+        retval->refcount = 0;
+        retval->is_ref = 1;
+        retval->type = IS_OBJECT;
+        Z_OBJ_HT_P(retval) = &php_perl_proxy_handlers;
+        Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);        
+      } else {
+        ALLOC_INIT_ZVAL(retval);
+        retval = php_perl_sv_to_zval(my_perl, *prop_val, retval TSRMLS_CC);
+        /* ensure we're creating a temporary variable */
+        if (retval) {retval->refcount = 0;}
+      }
+    }
+  } else if (SvTYPE(sv) == SVt_PVHV) {
+    retval = php_perl_read_property(object, offset, type TSRMLS_CC);
+  } else {
+    zend_error(E_WARNING, "[perl] Object is not an array");
+  }
+  if (retval == NULL) {
+    return EG(uninitialized_zval_ptr);
+  } else {
+    return retval;
+  }
+}
+
+/* Sets element of array based Perl's object */
+static void php_perl_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+
+  if (sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not set dimension");
+  }
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+
+  if (SvTYPE(sv) == SVt_PVAV) {
+    AV* av = (AV*)sv;
+
+    convert_to_long(offset);
+
+    av_store(av, Z_LVAL_P(offset), php_perl_zval_to_sv(my_perl, value TSRMLS_CC));
+  } else if (SvTYPE(sv) == SVt_PVHV) {
+    php_perl_write_property(object, offset, value TSRMLS_CC);
+  } else {
+    zend_error(E_WARNING, "[perl] Object is not an array");
+  }
+}
+
+/* Checks if element of array based Perl's object isset or empty */
+static int php_perl_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC)
+{
+  int ret = 0;
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+
+  if (sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not check dimension");
+    return 0;
+  }
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+  if (SvTYPE(sv) == SVt_PVAV) {
+    AV* av = (AV*)sv;
+
+    convert_to_long(offset);
+
+    if (check_empty) {
+      /* empty() */
+      SV** prop_val = av_fetch(av, Z_LVAL_P(offset), 0);
+      if (prop_val != NULL) {
+        zval *zv;
+        ALLOC_INIT_ZVAL(zv);
+        php_perl_sv_to_zval(my_perl, *prop_val, zv TSRMLS_CC);
+        ret = zend_is_true(zv);
+        zval_ptr_dtor(&zv);
+      }
+    } else {
+      /* isset() */
+      if (av_exists(av, Z_LVAL_P(offset))) {
+        ret = 1;
+      }
+    }
+  } else if (SvTYPE(sv) == SVt_PVHV) {
+    ret = php_perl_has_property(object, offset, check_empty TSRMLS_CC);
+  } else {
+    zend_error(E_WARNING, "[perl] Object is not an array");
+  }
+  return ret;
+}
+
+/* Deletes element of array based Perl's object */
+static void php_perl_unset_dimension(zval *object, zval *offset TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+
+  if (sv == NULL) {
+    zend_error(E_ERROR, "[perl] Can not unset dimension");
+  }
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+  if (SvTYPE(sv) == SVt_PVAV) {
+    AV* av = (AV*)sv;
+
+    convert_to_long(offset);
+
+    av_delete(av, Z_LVAL_P(offset), G_DISCARD);
+  } else if (SvTYPE(sv) == SVt_PVHV) {
+    php_perl_unset_property(object, offset TSRMLS_CC);
+  } else {
+    zend_error(E_WARNING, "[perl] Object is not an array");
+  }
+}
+
+/* Returns propery of hash based Perl's object */
+static zval* php_perl_read_property(zval *object, zval *member, int type TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  zval *retval = NULL;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  zval tmp_member;
+  SV* sv = NULL;
+  zend_bool write = obj->context != PERL_SCALAR && 
+                    type != BP_VAR_R && type != BP_VAR_IS;
+
+  if (member->type != IS_STRING) {
+    tmp_member = *member;
+    zval_copy_ctor(&tmp_member);
+    convert_to_string(&tmp_member);
+    member = &tmp_member;
+  }
+  if (obj->context == PERL_SCALAR) {
+    if (zend_binary_strcmp(Z_STRVAL_P(member), Z_STRLEN_P(member), "array", sizeof("array")-1) == 0) {
+      php_perl_object *new_obj;
+      zval* new_object;
+
+      new_obj = emalloc(sizeof(php_perl_object));
+      memcpy(new_obj, obj, sizeof(php_perl_object));
+      new_obj->context = PERL_ARRAY;
+      new_obj->properties = NULL;
+
+      ALLOC_INIT_ZVAL(new_object);
+      new_object->refcount = 0;
+      new_object->type = IS_OBJECT;
+      new_object->value.obj.handlers = &php_perl_object_handlers;
+      new_object->value.obj.handle =
+        zend_objects_store_put(new_obj, php_perl_cleaner, NULL, NULL TSRMLS_CC);
+
+      return new_object;
+    } else if (zend_binary_strcmp(Z_STRVAL_P(member),Z_STRLEN_P(member),"hash",sizeof("hash")-1) == 0) {
+      php_perl_object *new_obj;
+      zval* new_object;
+
+      new_obj = emalloc(sizeof(php_perl_object));
+      memcpy(new_obj, obj, sizeof(php_perl_object));
+      new_obj->context = PERL_HASH;
+      new_obj->properties = NULL;
+
+      ALLOC_INIT_ZVAL(new_object);
+      new_object->refcount = 0;
+      new_object->type = IS_OBJECT;
+      new_object->value.obj.handlers = &php_perl_object_handlers;
+      new_object->value.obj.handle =
+        zend_objects_store_put(new_obj, php_perl_cleaner, NULL, NULL TSRMLS_CC);
+
+      return new_object;
+    } else if (zend_binary_strcmp(Z_STRVAL_P(member),Z_STRLEN_P(member),"scalar",sizeof("scalar")-1) == 0) {
+      php_perl_object *new_obj;
+      zval* new_object;
+
+      new_obj = emalloc(sizeof(php_perl_object));
+      memcpy(new_obj, obj, sizeof(php_perl_object));
+      new_obj->context = PERL_SCALAR;
+      new_obj->properties = NULL;
+
+      ALLOC_INIT_ZVAL(new_object);
+      new_object->refcount = 0;
+      new_object->type = IS_OBJECT;
+      new_object->value.obj.handlers = &php_perl_object_handlers;
+      new_object->value.obj.handle =
+        zend_objects_store_put(new_obj, php_perl_cleaner, NULL, NULL TSRMLS_CC);
+
+      return new_object;
+    }
+  }
+
+  if (obj->sv == NULL) {
+    if (obj->context == PERL_ARRAY) {
+      sv = (SV*)get_av(Z_STRVAL_P(member), write);
+      if (sv && !AvARRAY(sv)) {if (write) {av_clear((AV*)sv);} else {sv = NULL;}}
+    } else if (obj->context == PERL_HASH) {
+      sv = (SV*)get_hv(Z_STRVAL_P(member), write);
+      if (sv && !HvARRAY(sv)) {if (write) {hv_clear((HV*)sv);} else {sv = NULL;}}
+    } else {
+      sv = get_sv(Z_STRVAL_P(member), FALSE);
+      if (sv && !SvOK(sv)) {sv = NULL;}
+    }
+    if (sv == NULL) {
+      if (obj->context == PERL_ARRAY) {
+        zend_error(E_NOTICE, "[perl] Undefined variable: '@%s'", Z_STRVAL_P(member));
+      } else if (obj->context == PERL_HASH) {
+        zend_error(E_NOTICE, "[perl] Undefined variable: '%%%s'", Z_STRVAL_P(member));
+      } else {
+        zend_error(E_NOTICE, "[perl] Undefined variable: '$%s'", Z_STRVAL_P(member));
+      }
+    }
+  } else {
+    sv = obj->sv;
+    while (SvTYPE(sv) == SVt_RV) {
+      sv = SvRV(sv);
+    }
+
+    if (SvTYPE(sv) == SVt_PVHV) {
+      HV* hv = (HV*)sv;
+      SV** prop_val;
+
+      prop_val = hv_fetch(hv, Z_STRVAL_P(member), Z_STRLEN_P(member), 0);
+      if (prop_val != NULL) {
+        sv = *prop_val;
+        write = FALSE;
+        if (sv != NULL && type != BP_VAR_R && type != BP_VAR_IS) {
+          write = TRUE;
+/*
+          SV* tmp_sv = sv;
+
+          while (1) {
+            if (sv_isobject(tmp_sv) || 
+                SvTYPE(tmp_sv) == SVt_PVAV || 
+                SvTYPE(tmp_sv) == SVt_PVHV) {
+              write = TRUE;
+              break;
+            } else if (SvTYPE(tmp_sv) != SVt_RV) {
+              break;
+            }
+            tmp_sv = SvRV(tmp_sv);
+          }
+*/
+        }
+      }
+    } else {
+      zend_error(E_WARNING, "[perl] Object is not a hash");
+    }
+  }
+  
+  if (sv != NULL) {
+    if (write && !sv_isobject(sv)) {
+      php_perl_object *obj = (php_perl_object*)emalloc(sizeof(php_perl_object));
+
+      obj->zo.ce = perl_class_entry;
+      obj->sv = newRV(sv);
+      obj->properties = NULL;
+      obj->context = PERL_SCALAR;
+
+      ALLOC_INIT_ZVAL(retval);
+      retval->refcount = 0;
+      retval->is_ref = 1;
+      retval->type = IS_OBJECT;
+      Z_OBJ_HT_P(retval) = &php_perl_proxy_handlers;
+      Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);        
+    } else {
+      retval = php_perl_sv_to_zval(my_perl, sv, retval TSRMLS_CC);
+      /* ensure we're creating a temporary variable */
+      if (retval) {retval->refcount = 0;}
+    }
+  }
+
+  if (member == &tmp_member) {
+    zval_dtor(member);
+  }
+  if (retval == NULL) {
+    return EG(uninitialized_zval_ptr);
+  } else {
+    return retval;
+  }
+}
+
+/* Sets propery of hash based Perl's object */
+static void php_perl_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+  zval tmp_member;
+
+  if (member->type != IS_STRING) {
+    tmp_member = *member;
+    zval_copy_ctor(&tmp_member);
+    convert_to_string(&tmp_member);
+    member = &tmp_member;
+  }
+  if (sv == NULL) {
+    if (obj->context == PERL_ARRAY) {
+      AV *av = get_av(Z_STRVAL_P(member), TRUE);
+      if (Z_TYPE_P(value) == IS_ARRAY) {
+        HashTable *ht = Z_ARRVAL_P(value);
+        zval** zv_ptr;
+        HashTable var_hash;
+
+        zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+        for (zend_hash_internal_pointer_reset(ht);
+             zend_hash_get_current_data(ht, (void **) &zv_ptr) == SUCCESS;
+             zend_hash_move_forward(ht)
+            ) {
+          char *key;
+          ulong index;
+
+          if (zend_hash_get_current_key(ht, &key, &index, 0) != HASH_KEY_IS_STRING) {
+            av_store(av, index,
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, &var_hash TSRMLS_CC));
+          }
+        }
+        zend_hash_destroy(&var_hash);
+      } else {
+        zend_error(E_NOTICE, "[perl] array required");
+      }
+    } else if (obj->context == PERL_HASH) {
+      HV *hv = get_hv(Z_STRVAL_P(member), TRUE);
+      if (Z_TYPE_P(value) == IS_ARRAY) {
+        HashTable *ht = Z_ARRVAL_P(value);
+        zval** zv_ptr;
+        HashTable var_hash;
+
+        zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+        for (zend_hash_internal_pointer_reset(ht);
+             zend_hash_get_current_data(ht, (void **) &zv_ptr) == SUCCESS;
+             zend_hash_move_forward(ht)
+            ) {
+          char* key;
+          int key_len;
+          ulong index;
+
+          if (zend_hash_get_current_key_ex(ht, &key, &key_len, &index, 0, NULL) != HASH_KEY_IS_STRING) {
+            char xkey[16];
+            zend_sprintf(xkey, "%ld", index);
+            hv_store(hv, xkey, strlen(xkey),
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, &var_hash TSRMLS_CC), 0);
+          } else {
+            hv_store(hv, key, key_len-1,
+              php_perl_zval_to_sv_ref(my_perl, *zv_ptr, &var_hash TSRMLS_CC), 0);
+          }
+        }
+        zend_hash_destroy(&var_hash);
+      } else {
+        zend_error(E_NOTICE, "[perl] array required");
+      }
+    } else {
+      SV *sv = get_sv(Z_STRVAL_P(member), TRUE);
+      sv_setsv(sv, php_perl_zval_to_sv(my_perl, value TSRMLS_CC));
+    }
+  } else {
+    while (SvTYPE(sv) == SVt_RV) {
+      sv = SvRV(sv);
+    }
+
+    if (SvTYPE(sv) == SVt_PVHV) {
+      HV* hv = (HV*)sv;
+
+      hv_store(hv, Z_STRVAL_P(member), Z_STRLEN_P(member),
+               php_perl_zval_to_sv(my_perl, value TSRMLS_CC), 0);
+    } else {
+      zend_error(E_WARNING, "[perl] Object is not a hash");
+    }
+  }
+  if (member == &tmp_member) {
+    zval_dtor(member);
+  }
+}
+
+/* Checks if propery of hash based Perl's object isset or empty */
+static int php_perl_has_property(zval *object, zval *member, int check_empty TSRMLS_DC)
+{
+  int ret = 0;
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+  zval tmp_member;
+
+  if (member->type != IS_STRING) {
+    tmp_member = *member;
+    zval_copy_ctor(&tmp_member);
+    convert_to_string(&tmp_member);
+    member = &tmp_member;
+  }
+
+  if (sv == NULL) {
+    SV* sv;
+    if (obj->context == PERL_ARRAY) {
+      sv = (SV*)get_av(Z_STRVAL_P(member), FALSE);
+      if (sv && !AvARRAY(sv)) {sv = NULL;}
+    } else if (obj->context == PERL_HASH) {
+      sv = (SV*)get_hv(Z_STRVAL_P(member), FALSE);
+      if (sv && !HvARRAY(sv)) {sv = NULL;}
+    } else {
+      sv = get_sv(Z_STRVAL_P(member), FALSE);
+      if (sv && !SvOK(sv)) {sv = NULL;}
+    }
+    if (sv) {
+      if (check_empty) {
+        zval *zv;
+        ALLOC_INIT_ZVAL(zv);
+        php_perl_sv_to_zval(my_perl, sv, zv TSRMLS_CC);
+        ret = zend_is_true(zv);
+        zval_ptr_dtor(&zv);
+      } else {
+        ret = 1;
+      }
+    }
+  } else {
+    while (SvTYPE(sv) == SVt_RV) {
+      sv = SvRV(sv);
+    }
+    if (SvTYPE(sv) == SVt_PVHV) {
+      HV*   hv = (HV*)sv;
+
+      if (check_empty) {
+        /* empty() */
+        SV** prop_val = hv_fetch(hv, Z_STRVAL_P(member), Z_STRLEN_P(member), 0);
+        if (prop_val != NULL) {
+          zval *zv;
+          ALLOC_INIT_ZVAL(zv);
+          php_perl_sv_to_zval(my_perl, *prop_val, zv TSRMLS_CC);
+          ret = zend_is_true(zv);
+          zval_ptr_dtor(&zv);
+        }
+      } else {
+        /* isset() */
+        if (hv_exists(hv, Z_STRVAL_P(member), Z_STRLEN_P(member))) {
+          ret = 1;
+        }
+      }
+    } else {
+      zend_error(E_WARNING, "[perl] Object is not a hash");
+    }
+  }
+  if (member == &tmp_member) {
+    zval_dtor(member);
+  }
+  return ret;
+}
+
+/* Deletes propery of hash based Perl's object */
+static void php_perl_unset_property(zval *object, zval *member TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+  zval tmp_member;
+
+  if (member->type != IS_STRING) {
+    tmp_member = *member;
+    zval_copy_ctor(&tmp_member);
+    convert_to_string(&tmp_member);
+    member = &tmp_member;
+  }
+
+  if (sv == NULL) {
+    if (obj->context == PERL_ARRAY) {
+      AV *av = get_av(Z_STRVAL_P(member), FALSE);
+      av_undef(av);
+    } else if (obj->context == PERL_HASH) {
+      HV *hv = get_hv(Z_STRVAL_P(member), FALSE);
+      hv_undef(hv);
+    } else {
+      SV *sv = get_sv(Z_STRVAL_P(member), FALSE);
+      sv_setsv(sv, &PL_sv_undef);
+    }
+  } else {
+    while (SvTYPE(sv) == SVt_RV) {
+      sv = SvRV(sv);
+    }
+    if (SvTYPE(sv) == SVt_PVHV) {
+      HV*   hv = (HV*)sv;
+      hv_delete(hv, Z_STRVAL_P(member), Z_STRLEN_P(member), G_DISCARD);
+    } else {
+      zend_error(E_WARNING, "[perl] Object is not a hash");
+    }
+  }
+  if (member == &tmp_member) {
+    zval_dtor(member);
+  }
+}
+
+/* Constructs Perl object by calling constructor */
+static void php_perl_constructor_handler(INTERNAL_FUNCTION_PARAMETERS)
+{
+  char* perl_class_name;
+  int   perl_class_name_len;
+  char* constructor     = "new";
+  int   constructor_len = 3;
+  int   argc = ZEND_NUM_ARGS();
+  zval *object = this_ptr;
+
+  if (argc == 0) {
+    php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+    obj->sv = NULL;
+    obj->properties = NULL;
+  } else if (zend_parse_parameters((argc>2?2:argc) TSRMLS_CC, "s|s",
+                            &perl_class_name, &perl_class_name_len,
+                            &constructor, &constructor_len) != FAILURE) {
+    PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+    php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+    zval*** argv = NULL;
+
+    if (argc > 2) {
+      argv = (zval***)safe_emalloc(sizeof(zval **), argc, 0);
+      if (zend_get_parameters_array_ex(argc, argv) == FAILURE) {
+        efree(argv);
+        RETURN_FALSE;
+      }
+    }
+
+    obj->sv = php_perl_call_constructor(my_perl,
+                                        perl_class_name, perl_class_name_len,
+                                        constructor, constructor_len,
+                                        argc-2, argv+2 TSRMLS_CC);
+
+    if (argc > 2) {
+      efree(argv);
+    }
+
+    if(SvTRUE(ERRSV)) {
+      STRLEN na;
+      zval_ptr_dtor(&object);
+      zend_throw_exception_ex(perl_exception_class_entry, 0 TSRMLS_CC,
+        "[perl] constructor error: %s", SvPV(ERRSV, na));
+      return;
+    }
+
+    php_perl_remember_object(obj->sv, object->value.obj.handle TSRMLS_CC);
+  }
+  zval_ptr_dtor(&object);
+}
+
+/* get_constructor handler for overloaded Perl objects */
+static zend_function *php_perl_get_constructor(zval *object TSRMLS_DC)
+{
+  return (zend_function *)&php_perl_constructor_function;
+}
+
+/* get_method handler for overloaded Perl objects */
+#if (ZEND_EXTENSION_API_NO >= 220041030)
+static zend_function *php_perl_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC)
+#else
+static zend_function *php_perl_get_method(zval *object, char *method, int method_len TSRMLS_DC)
+#endif
+{
+  zend_internal_function *f;
+#if (ZEND_EXTENSION_API_NO >= 220041030)
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC);
+#else
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+#endif
+
+  if (obj->sv == NULL) {
+#if (ZEND_EXTENSION_API_NO >= 220041030)
+    zend_function *f = zend_get_std_object_handlers()->get_method(object_ptr, method, method_len TSRMLS_CC);
+#else
+    zend_function *f = zend_get_std_object_handlers()->get_method(object, method, method_len TSRMLS_CC);
+#endif
+    if (f) {
+      return f;
+    }
+  }
+  f = emalloc(sizeof(zend_internal_function));
+  memset(f, 0, sizeof(zend_internal_function));
+  f->type = ZEND_OVERLOADED_FUNCTION_TEMPORARY;
+/*???FIXME: Some tests fail with following code enabled
+    f->scope = perl_class_entry;
+*/
+  f->function_name = estrndup(method, method_len);
+  return (zend_function *)f;
+}
+
+/* Calls method of overloaded Perl's object */
+static int php_perl_call_function_handler(char *method, INTERNAL_FUNCTION_PARAMETERS)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  zval *object = this_ptr;
+  int argc = ZEND_NUM_ARGS();
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  zval ***argv = NULL;
+
+  if (argc > 0) {
+    argv = (zval***)safe_emalloc(sizeof(zval**), argc, 0);
+    zend_get_parameters_array_ex(argc, argv);
+  }
+
+  if (obj->sv == NULL) {
+    php_perl_call(my_perl, method, argc, argv, obj->context,
+                  return_value_used?return_value:NULL  TSRMLS_CC);
+  } else {
+    php_perl_call_method(my_perl, obj->sv, method, argc, argv, obj->context,
+                         return_value_used?return_value:NULL TSRMLS_CC);
+  }
+
+  zval_ptr_dtor(&object);
+  if (argc > 0) {
+    efree(argv);
+  }
+
+  if(SvTRUE(ERRSV)) {
+    STRLEN na;
+    zend_throw_exception_ex(perl_exception_class_entry, 0 TSRMLS_CC,
+      "[perl] call error: %s", SvPV(ERRSV, na));
+    return FAILURE;
+  }
+
+  return SUCCESS;
+}
+
+/* Returns all properties of Perl's object */
+static HashTable* php_perl_get_properties(zval *object TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+  HashTable *ht;
+
+  if (sv == NULL) {
+    return NULL;
+  }
+  if (obj->properties != NULL) {
+    ht = obj->properties;
+
+    if (ht->nApplyCount > 0) {
+      return ht;
+    } else if (active_opline != NULL) {
+      /* each() support */
+#define ZSTRCMP(zv,str) (zend_binary_strcmp(Z_STRVAL(zv),Z_STRLEN(zv),str,sizeof(str)-1)==0)
+//#define ZSTRCMP(zv,str) ((Z_STRLEN(zv) == sizeof(str)-1) && \
+//                         (memcmp(Z_STRVAL(zv), str, sizeof(str)-1) == 0))
+      if (active_opline->opcode == ZEND_DO_FCALL &&
+          active_opline->extended_value == 1 &&
+          active_opline->op1.op_type == IS_CONST &&
+          active_opline->op1.u.constant.type == IS_STRING &&
+          (ZSTRCMP(active_opline->op1.u.constant, "each") ||
+           ZSTRCMP(active_opline->op1.u.constant, "next") ||
+           ZSTRCMP(active_opline->op1.u.constant, "prev") ||
+           ZSTRCMP(active_opline->op1.u.constant, "key")  ||
+           ZSTRCMP(active_opline->op1.u.constant, "current"))) {
+        return ht;
+      }
+    }
+
+    /* rebuild HashTable for properties */
+    zend_hash_clean(ht);
+  } else {
+    ALLOC_HASHTABLE(ht);
+    zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+    obj->properties = ht;
+  }
+
+  while (SvTYPE(sv) == SVt_RV) {
+    sv = SvRV(sv);
+  }
+  if (SvTYPE(sv) == SVt_PVHV) {
+    HV*   hv = (HV*)sv;
+    SV*   el_sv;
+    char* key;
+    I32   key_len;
+
+    hv_iterinit(hv);
+    while ((el_sv = hv_iternextsv(hv, &key, &key_len)) != NULL) {
+      zval* el_zv;
+      ALLOC_INIT_ZVAL(el_zv);
+      php_perl_sv_to_zval(my_perl, el_sv, el_zv TSRMLS_CC);
+      zend_hash_add(ht, key, key_len+1, (void*)&el_zv, sizeof(zval *), NULL);
+    }
+  } else if (SvTYPE(sv) == SVt_PVAV) {
+    AV* av = (AV*)sv;
+    I32 len = av_len(av);
+    I32 i;
+
+    for (i = 0; i <= len; i++) {
+      SV** el_sv = av_fetch(av, i, 0);
+      if (el_sv != NULL && *el_sv != NULL) {
+        zval* el_zv;
+        ALLOC_INIT_ZVAL(el_zv);
+        php_perl_sv_to_zval(my_perl, *el_sv, el_zv TSRMLS_CC);
+        zend_hash_index_update(ht, i, (void*)&el_zv, sizeof(zval *), NULL);
+      }
+    }
+  }
+  return ht;
+}
+
+/* Returns class name of overloaded Perl's object */
+static int php_perl_get_class_name(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
+{
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  SV* sv = obj->sv;
+  if (sv == NULL) {
+    *class_name = emalloc(sizeof("Perl"));
+    strcpy(*class_name,"Perl");
+    *class_name_len = sizeof("Perl")-1;
+    return SUCCESS;
+  } else {
+    HV* stash;
+    while (SvTYPE(sv) == SVt_RV) {
+     sv = SvRV(sv);
+    }
+    if ((stash = SvSTASH(sv)) != NULL) {
+      char *name = HvNAME(stash);
+      int len = strlen(name);
+      *class_name = emalloc(len+sizeof("Perl::"));
+      strcpy(*class_name,"Perl::");
+      strcpy((*class_name)+sizeof("Perl::")-1,name);
+      *class_name_len = len+sizeof("Perl::")-1;
+      return SUCCESS;
+    } else if (SvTYPE(sv) == SVt_PVAV) {
+      *class_name = emalloc(sizeof("Perl::array"));
+      strcpy(*class_name,"Perl::array");
+      *class_name_len = sizeof("Perl::array")-1;
+      return SUCCESS;
+    } else if (SvTYPE(sv) == SVt_PVHV) {
+      *class_name = emalloc(sizeof("Perl::hash"));
+      strcpy(*class_name,"Perl::hash");
+      *class_name_len = sizeof("Perl::hash")-1;
+      return SUCCESS;
+    } else {
+      *class_name = emalloc(sizeof("Perl::scalar"));
+      strcpy(*class_name,"Perl::scalar");
+      *class_name_len = sizeof("Perl::scalar")-1;
+      return SUCCESS;
+    }
+  }
+  return FAILURE;
+}
+
+/* Returns class_entry of overloaded Perl's objects */
+static zend_class_entry* php_perl_get_class_entry(zval *object TSRMLS_DC)
+{
+  return perl_class_entry;
+}
+
+/* Destructor for overloaded Perl's objects */
+static void php_perl_destructor(void *perl_object, zend_object_handle handle TSRMLS_DC)
+{
+  if (perl_object) {
+    php_perl_object *obj = (php_perl_object*)perl_object;
+    PerlInterpreter* my_perl = PERLG(perl);
+    if (obj->properties) {
+      /* removing properties */
+      zend_hash_destroy(obj->properties);
+      FREE_HASHTABLE(obj->properties);
+    }
+    if (my_perl != NULL && obj->sv != NULL) {
+      php_perl_forget_object(obj->sv TSRMLS_CC);
+      /* removing perl object */
+      sv_free(obj->sv);
+    }
+    efree(perl_object);
+  }
+}
+
+static void php_perl_cleaner(void *perl_object, zend_object_handle handle TSRMLS_DC)
+{
+  if (perl_object) {
+    php_perl_object *obj = (php_perl_object*)perl_object;
+    if (obj->properties) {
+      /* removing properties */
+      zend_hash_destroy(obj->properties);
+      FREE_HASHTABLE(obj->properties);
+    }
+    efree(perl_object);
+  }
+}
+
+/* Makes a copy of overloaded perl object.
+   It copies only properties or elements of object, but does'nt copy nested
+   arrays, hashes or objects */
+static zend_object_value php_perl_clone(zval *object TSRMLS_DC)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+  zend_object_value new_value;
+
+  php_perl_object *old = zend_object_store_get_object(object TSRMLS_CC);
+  php_perl_object *obj = (php_perl_object*)emalloc(sizeof(php_perl_object));
+
+  if (old->sv != NULL) {
+    SV* old_sv = SvRV(old->sv);
+    SV* new_sv = NULL;
+
+    if (SvTYPE(old_sv) == SVt_PVAV) {
+      /* array */
+      I32 len = av_len((AV*)old_sv);
+      I32 i;
+
+      new_sv = (SV*)newAV();
+      for (i = 0; i <= len; i++) {
+        SV** el_sv = av_fetch((AV*)old_sv, i, 0);
+        if (el_sv != NULL && *el_sv != NULL) {
+          av_push((AV*)new_sv, newSVsv(*el_sv));
+        }
+      }
+    } else if (SvTYPE(old_sv) == SVt_PVHV) {
+      /* hash */
+      new_sv = (SV*)newHVhv((HV*)old_sv);
+    } else if (SvOK(old_sv)) {
+      /* scalar */
+      new_sv = newSVsv(old_sv);
+    } else {
+      /* unknown */
+      zend_error(E_ERROR, "[perl] Can't clone perl object (type [%ld])", SvTYPE(old_sv));
+    }
+    obj->sv = sv_bless(newRV_noinc(new_sv), SvSTASH(old_sv));
+  } else {
+    obj->sv = NULL;
+  }
+  obj->zo.ce = old->zo.ce;
+  obj->properties = NULL;
+  obj->context = PERL_SCALAR;
+
+  new_value.handlers = &php_perl_object_handlers;
+  new_value.handle =
+    zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);
+
+  if (obj->sv) {
+    php_perl_remember_object(obj->sv, new_value.handle TSRMLS_CC);
+  }
+
+  return new_value;
+}
+
+/* Creates overloaded Perl's object */
+static zend_object_value php_perl_create_object(zend_class_entry *class_type TSRMLS_DC)
+{
+  zend_object_value new_value;
+
+  php_perl_object *obj = (php_perl_object*)emalloc(sizeof(php_perl_object));
+  obj->zo.ce = class_type;
+  obj->sv = NULL;
+  obj->properties = NULL;
+  obj->context = PERL_SCALAR;
+
+  new_value.handlers = &php_perl_object_handlers;
+  new_value.handle =
+    zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);
+
+  return new_value;
+}
+
+/****************************************************************************/
+
+static void php_perl_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
+static int php_perl_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
+static void php_perl_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC);
+static int php_perl_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+static void php_perl_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC);
+static void php_perl_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
+
+zend_object_iterator_funcs php_perl_iterator_funcs = {
+  php_perl_iterator_dtor,
+  php_perl_iterator_valid,
+  php_perl_iterator_current_data,
+  php_perl_iterator_current_key,
+  php_perl_iterator_move_forward,
+  php_perl_iterator_rewind,
+};
+
+static void php_perl_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  zval_ptr_dtor(&object);
+  efree(iterator);
+}
+
+static int php_perl_iterator_valid(zend_object_iterator *iterator TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  if (obj->properties) {
+    return zend_hash_has_more_elements(obj->properties);
+  }
+  return FAILURE;
+}
+
+static void php_perl_iterator_current_data(zend_object_iterator *iterator, zval ***data TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  if (obj->properties) {
+    zend_hash_get_current_data(obj->properties, (void**)data);
+  }
+}
+
+static int php_perl_iterator_current_key(zend_object_iterator *iterator, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  if (obj->properties) {
+    return zend_hash_get_current_key_ex(obj->properties, str_key, str_key_len, int_key, 1, NULL);
+  }
+  return HASH_KEY_NON_EXISTANT;
+}
+
+static void php_perl_iterator_move_forward(zend_object_iterator *iterator TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  if (obj->properties) {
+    zend_hash_move_forward(obj->properties);
+  }
+}
+
+static void php_perl_iterator_rewind(zend_object_iterator *iterator TSRMLS_DC)
+{
+  zval* object =(zval*)iterator->data;
+  php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(object TSRMLS_CC);
+  if (obj->properties) {
+    /* removing properties */
+    zend_hash_destroy(obj->properties);
+    FREE_HASHTABLE(obj->properties);
+    obj->properties = NULL;
+  }
+  php_perl_get_properties(object TSRMLS_CC);
+  if (obj->properties) {
+    zend_hash_internal_pointer_reset(obj->properties);
+  }
+}
+
+zend_object_iterator *php_perl_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+{
+  zend_object_iterator *iterator = emalloc(sizeof(zend_object_iterator));
+  object->refcount++;
+  iterator->data = (void*)object;
+  iterator->funcs = &php_perl_iterator_funcs;
+
+  return iterator;
+}
+/****************************************************************************/
+
+static void php_perl_init_globals(zend_perl_globals *perl_globals)
+{
+  perl_globals->perl = NULL;
+}
+
+PHP_MINIT_FUNCTION(perl)
+{
+  zend_class_entry perl_ce;
+  ZEND_INIT_MODULE_GLOBALS(perl, php_perl_init_globals, NULL);
+
+  INIT_CLASS_ENTRY(perl_ce, "Perl", perl_functions);
+  perl_ce.create_object = php_perl_create_object;
+  perl_class_entry = zend_register_internal_class(&perl_ce TSRMLS_CC);
+  perl_class_entry->get_iterator = php_perl_get_iterator;
+
+  INIT_CLASS_ENTRY(perl_ce, "PerlException", NULL);
+  perl_exception_class_entry = zend_register_internal_class_ex(&perl_ce, zend_exception_get_default(), NULL TSRMLS_CC);
+
+  return SUCCESS;
+}
+
+PHP_MSHUTDOWN_FUNCTION(perl)
+{
+  return SUCCESS;
+}
+
+PHP_RSHUTDOWN_FUNCTION(perl)
+{
+  php_perl_destroy(TSRMLS_C);
+  return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(perl)
+{
+  PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+
+  php_info_print_table_start();
+  php_info_print_table_header(2, "Perl support", "enabled");
+  php_info_print_table_row(2, "Revision", "$Revision: 1.14 $");
+  php_info_print_table_row(2, "Perl version", Perl_form(aTHX_ "%vd",PL_patchlevel));
+  php_info_print_table_end();
+}
+
+/* perl_require($perl_file_name)
+   Loads and executes Perl file. Produces a error if file does not exist or
+   has Perl's errors */
+PHP_METHOD(Perl, require)
+{
+  char* perl_filename;
+  int   perl_filename_len;
+
+  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+                            &perl_filename, &perl_filename_len) == FAILURE) {
+    return;
+  } else {
+    PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+    require_pv(perl_filename);
+    if(SvTRUE(ERRSV)) {
+      STRLEN na;
+
+      zend_throw_exception_ex(perl_exception_class_entry, 0 TSRMLS_CC,
+        "[perl] require error: %s", SvPV(ERRSV, na));
+    }
+  }
+}
+
+/* perl_eval($perl_code)
+   Evaluates Perl code and returns result.
+   Produces a error if code has Perl's errors */
+PHP_METHOD(Perl, eval)
+{
+  char* perl_code;
+  int   perl_code_len;
+
+  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+                            &perl_code, &perl_code_len) != FAILURE) {
+    PerlInterpreter* my_perl = php_perl_init(TSRMLS_C);
+    php_perl_object *obj = (php_perl_object*)zend_object_store_get_object(this_ptr TSRMLS_CC);
+    SV* sv;
+    dSP;
+    sv = newSVpv(perl_code, perl_code_len);
+    if (return_value_used) {
+      if (obj->context != PERL_SCALAR) {
+        int count, i;
+        I32 ax;
+        HashTable var_hash;
+
+        count = eval_sv(sv, G_ARRAY|G_KEEPERR);
+        SPAGAIN;
+        sp -= count;
+        ax = (sp - PL_stack_base) + 1;
+        zend_hash_init(&var_hash, 0, NULL, NULL, 0);
+        array_init(return_value);
+        if (obj->context == PERL_ARRAY) {
+          for (i = 0; i < count; i++) {
+            add_next_index_zval(return_value,
+              php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(i), NULL, &var_hash TSRMLS_CC));
+          }
+        } else {
+          for (i = 0; i < count; i++) {
+            int  key_len;
+            char *key = SvPV(ST(i), key_len);
+            if (i != count-1) {
+              add_assoc_zval_ex(return_value, key, key_len+1,
+                php_perl_sv_to_zval_ref(my_perl, (SV*)(SV*)ST(++i), NULL, &var_hash TSRMLS_CC));
+            } else {
+              add_assoc_null_ex(return_value, key, key_len+1);
+            }
+          }
+        }
+        zend_hash_destroy(&var_hash);
+      } else {
+        eval_sv(sv, G_SCALAR|G_KEEPERR);
+        SPAGAIN;
+        php_perl_sv_to_zval(my_perl, POPs, return_value TSRMLS_CC);
+      }
+      PUTBACK;
+    } else {
+      eval_sv(sv, G_DISCARD|G_KEEPERR);
+    }
+    sv_free(sv);
+
+    if (SvTRUE(ERRSV)) {
+      STRLEN na;
+      zend_throw_exception_ex(perl_exception_class_entry, 0 TSRMLS_CC,
+        "[perl] eval error: %s", SvPV(ERRSV, na));
+    }
+  }
+}
+
+zend_module_entry perl_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+  STANDARD_MODULE_HEADER,
+#endif
+  "perl",
+  NULL,
+  PHP_MINIT(perl),
+  PHP_MSHUTDOWN(perl),
+  NULL,
+  PHP_RSHUTDOWN(perl),
+  PHP_MINFO(perl),
+#if ZEND_MODULE_API_NO >= 20010901
+  "0.7",
+#endif
+  STANDARD_MODULE_PROPERTIES
+};
+
+#ifdef COMPILE_DL_PERL
+ZEND_GET_MODULE(perl)
+#endif
+
+#endif

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.h
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.h	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/php_perl.h	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 4                                                        |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2003 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.0 of the PHP license,       |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_0.txt.                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Author: Dmitry Stogov <dmitry at zend.com>                              |
+   +----------------------------------------------------------------------+
+   $Id: php_perl.h,v 1.2 2003/12/09 10:48:09 dmitry Exp $
+*/
+
+#ifndef PHP_PERL_H
+#define PHP_PERL_H
+
+#include "php.h"
+
+extern zend_module_entry perl_module_entry;
+#define phpext_perl_ptr &perl_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_PERL_API __declspec(dllexport)
+#else
+#define PHP_PERL_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#endif

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,14 @@
+--TEST--
+Test 1: require of existing file
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+$perl = new Perl();
+$perl->require(dirname(__FILE__)."/perl001.pl");
+echo "ok\n";
+?>
+--EXPECT--
+ok
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.pl
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.pl	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl001.pl	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1 @@
+print "ok\n"

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl002.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl002.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl002.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,17 @@
+--TEST--
+Test 2: require of non existing file
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+$perl = new Perl();
+$perl->require(dirname(__FILE__)."/perl002.pl");
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'PerlException' with message '[perl] require error: Can't locate %sperl002.pl in @INC (@INC contains: %s) at (eval %d) line %d.
+' in %sperl002.php:%d
+Stack trace:
+#0 {main}
+  thrown in %sperl002.php on line %d

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl003.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl003.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl003.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,13 @@
+--TEST--
+Test 3: eval
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('print "ok\n";');
+echo "ok\n";
+?>
+--EXPECT--
+ok
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl004.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl004.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl004.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,19 @@
+--TEST--
+Test 4: returning scalar value from eval()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+var_dump($perl->eval(''));
+var_dump($perl->eval('5+3;'));
+var_dump($perl->eval('5.5+3.2;'));
+var_dump($perl->eval('reverse "0123456789";'));
+echo "ok\n";
+?>
+--EXPECT--
+NULL
+int(8)
+float(8.7)
+string(10) "9876543210"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl005.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl005.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl005.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,20 @@
+--TEST--
+Test 5: returning array value from eval()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+var_dump($perl->eval('[1,2.5,"string"];'));
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  float(2.5)
+  [2]=>
+  string(6) "string"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl006.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl006.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl006.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,20 @@
+--TEST--
+Test 6: returning hash value from eval()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+var_dump($perl->eval('{"int"=>1,"double"=>3.5,"string"=>"string"};'));
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  ["double"]=>
+  float(3.5)
+  ["int"]=>
+  int(1)
+  ["string"]=>
+  string(6) "string"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl007.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl007.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl007.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,16 @@
+--TEST--
+Test 7: Evaluating invalid Perlcode (eval)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+var_dump($perl->eval('$a = $s{$d}.'));
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'PerlException' with message '[perl] eval error: syntax error at (eval %d) line %d, at EOF
+' in %sperl007.php:%d
+Stack trace:
+#0 {main}
+  thrown in %sperl007.php on line %d

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl008.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl008.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl008.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,20 @@
+--TEST--
+Test 8: accessing scalar perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('$a = 5;');
+var_dump($perl->a);
+$perl->eval('$a = 2.5;');
+var_dump($perl->a);
+$perl->eval('$a = "str";');
+var_dump($perl->a);
+echo "ok\n";
+?>
+--EXPECT--
+int(5)
+float(2.5)
+string(3) "str"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl009.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl009.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl009.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,21 @@
+--TEST--
+Test 9: accessing array perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('@a = (4, 2.5, "str");');
+var_dump($perl->array->a);
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  int(4)
+  [1]=>
+  float(2.5)
+  [2]=>
+  string(3) "str"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl010.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl010.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl010.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,21 @@
+--TEST--
+Test 10: accessing hash perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('%a = ("int" => 4, "double" => 2.5, "str" => "str");');
+var_dump($perl->hash->a);
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  ["double"]=>
+  float(2.5)
+  ["str"]=>
+  string(3) "str"
+  ["int"]=>
+  int(4)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl011.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl011.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl011.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,13 @@
+--TEST--
+Test 11: accessing undefined perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+$perl = new Perl();
+var_dump($perl->tmpvar);
+?>
+--EXPECTF--
+Notice: [perl] Undefined variable: '$tmpvar' in %s on line %d
+NULL

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl012.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl012.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl012.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,47 @@
+--TEST--
+Test 12: calling perl user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f_integer {
+  return 5;
+}
+sub f_double {
+  return 2.5;
+}
+sub f_string {
+  return "str";
+}
+sub f_array {
+  my @x=(2);
+  return \\@x;
+}
+sub f_hash {
+  my %x=('str'=>'str');
+  return \\%x;
+}
+PERL_END
+);
+var_dump($perl->f_integer());
+var_dump($perl->f_double());
+var_dump($perl->f_string());
+var_dump($perl->f_array());
+var_dump($perl->f_hash());
+echo "ok\n";
+?>
+--EXPECT--
+int(5)
+float(2.5)
+string(3) "str"
+array(1) {
+  [0]=>
+  int(2)
+}
+array(1) {
+  ["str"]=>
+  string(3) "str"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl013.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl013.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl013.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,23 @@
+--TEST--
+Test 13: passing scalar argument to user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  return shift(@_);
+}
+PERL_END
+);
+var_dump($perl->f(5));
+var_dump($perl->f(2.5));
+var_dump($perl->f("str"));
+echo "ok\n";
+?>
+--EXPECT--
+int(5)
+float(2.5)
+string(3) "str"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl014.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl014.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl014.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 14: passing array argument to user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  \$var = shift(@_);
+}
+PERL_END
+);
+$perl->f(array(1,2.5,"str",array(1)));
+var_dump($perl->var);
+echo "ok\n";
+?>
+--EXPECT--
+array(4) {
+  [0]=>
+  int(1)
+  [1]=>
+  float(2.5)
+  [2]=>
+  string(3) "str"
+  [3]=>
+  array(1) {
+    [0]=>
+    int(1)
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl015.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl015.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl015.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 15: passing hash argument to user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  \$var = shift(@_);
+}
+PERL_END
+);
+$perl->f(array("a"=>1,"b"=>2.5,"c"=>"str","d"=>array(1)));
+var_dump($perl->var);
+echo "ok\n";
+?>
+--EXPECT--
+array(4) {
+  ["c"]=>
+  string(3) "str"
+  ["a"]=>
+  int(1)
+  ["b"]=>
+  float(2.5)
+  ["d"]=>
+  array(1) {
+    [0]=>
+    int(1)
+  }
+}
+ok
\ No newline at end of file

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl016.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl016.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl016.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,27 @@
+--TEST--
+Test 16: passing many arguments to user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub sum {
+  my \$x = shift(@_);
+  foreach my \$y (@_) {
+    \$x += \$y;
+  }
+  return \$x;
+}
+
+PERL_END
+);
+
+var_dump($perl->eval("sum(1,2,3,4,5);"));
+var_dump($perl->sum(1,2,3,4,5));
+echo "ok\n";
+?>
+--EXPECT--
+int(15)
+int(15)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl017.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl017.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl017.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,22 @@
+--TEST--
+Test 17: calling function from external Perl module
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+use Digest::MD5 qw(md5_hex);
+PERL_END
+);
+
+var_dump($perl->eval('md5_hex("Hello");'));
+var_dump($perl->md5_hex('Hello'));
+var_dump($perl->{'Digest::MD5::md5_hex'}('Hello'));
+echo "ok\n";
+?>
+--EXPECT--
+string(32) "8b1a9953c4611296a827abf8c47804d7"
+string(32) "8b1a9953c4611296a827abf8c47804d7"
+string(32) "8b1a9953c4611296a827abf8c47804d7"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl018.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl018.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl018.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,15 @@
+--TEST--
+Test 18: calling internal Perl function (not implemented by pecl/perl)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('print "Hello\n"');
+$perl->print("Hello\n");
+echo "ok\n";
+?>
+--EXPECT--
+Hello
+Hello
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl019.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl019.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl019.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,23 @@
+--TEST--
+Test 19: die() in user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  die("Bye bye!");
+}
+PERL_END
+);
+
+$perl->f();
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'PerlException' with message '[perl] call error: 	(in cleanup) Bye bye! at (eval %d) line %d.
+' in %sperl019.php:%d
+Stack trace:
+#0 {main}
+  thrown in %sperl019.php on line %d

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl020.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl020.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl020.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,19 @@
+--TEST--
+Test 20: die() in perl_eval()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+  die("Bye bye!");
+PERL_END
+);
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'PerlException' with message '[perl] eval error: 	(in cleanup) Bye bye! at (eval %d) line %d.
+' in %sperl020.php:%d
+Stack trace:
+#0 {main}
+  thrown in %sperl020.php on line %d

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl021.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl021.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl021.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,43 @@
+--TEST--
+Test 21: returning object from eval()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+package Bar;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'y'} = 8;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+var_dump($perl->eval('Foo->new()'));
+var_dump($perl->eval('Bar::new("Bar")'));
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(12)
+}
+object(Perl::Bar)#2 (1) {
+  ["y"]=>
+  int(8)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl022.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl022.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl022.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 22: returning object from perl function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+var_dump($perl->{'Foo::new'}('Foo'));
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(12)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl023.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl023.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl023.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,58 @@
+--TEST--
+Test 23: creating new Perl objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 11;
+    bless \$self, \$type;
+    return \$self;
+  }
+  sub new2 {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+  sub new3 {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = shift;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo);
+$foo = new Perl('Foo','new2');
+var_dump($foo);
+$foo = new Perl('Foo','new3',13);
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(11)
+}
+object(Perl::Foo)#3 (1) {
+  ["x"]=>
+  int(12)
+}
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(13)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl024.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl024.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl024.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,33 @@
+--TEST--
+Test 24: reading scalar object's properties
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'int'} = 12;
+    \$self->{'float'} = 2.5;
+    \$self->{'str'} = 'str';
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->int);
+var_dump($foo->float);
+var_dump($foo->str);
+echo "ok\n";
+?>
+--EXPECT--
+int(12)
+float(2.5)
+string(3) "str"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl025.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl025.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl025.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,34 @@
+--TEST--
+Test 25: reading array object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = [1, 2.5, "str"];
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->x);
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  float(2.5)
+  [2]=>
+  string(3) "str"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl026.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl026.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl026.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,34 @@
+--TEST--
+Test 26: reading hash object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = {"int"=>1, "flost"=>2.5, "str"=>"str"};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->x);
+echo "ok\n";
+?>
+--EXPECT--
+array(3) {
+  ["str"]=>
+  string(3) "str"
+  ["int"]=>
+  int(1)
+  ["flost"]=>
+  float(2.5)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl027.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl027.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl027.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,42 @@
+--TEST--
+Test 27: reading object object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Bar;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    bless \$self, \$type;
+    return \$self;
+  }
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'bar'} = Bar->new;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->bar);
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Bar)#3 (0) {
+}
+object(Perl::Foo)#2 (1) {
+  ["bar"]=>
+  object(Perl::Bar)#3 (0) {
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl028.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl028.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl028.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,37 @@
+--TEST--
+Test 28: setting scalar object's properties
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'int'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+$foo->int   = 5;
+$foo->float = 2.5;
+$foo->str   = "str";
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (3) {
+  ["float"]=>
+  float(2.5)
+  ["str"]=>
+  string(3) "str"
+  ["int"]=>
+  int(5)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl029.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl029.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl029.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,44 @@
+--TEST--
+Test 29: setting array object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'a1'} = [1,2];
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+$foo->a1 = array(2,1);
+$foo->a2 = array(1,2);
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (2) {
+  ["a2"]=>
+  array(2) {
+    [0]=>
+    int(1)
+    [1]=>
+    int(2)
+  }
+  ["a1"]=>
+  array(2) {
+    [0]=>
+    int(2)
+    [1]=>
+    int(1)
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl030.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl030.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl030.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,44 @@
+--TEST--
+Test 30: setting hash object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'a1'} = {"one"=>1,"two"=>2};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+$foo->a1 = array("one"=>2,"two"=>1);
+$foo->a2 = array("one"=>1,"two"=>2);
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (2) {
+  ["a2"]=>
+  array(2) {
+    ["one"]=>
+    int(1)
+    ["two"]=>
+    int(2)
+  }
+  ["a1"]=>
+  array(2) {
+    ["one"]=>
+    int(2)
+    ["two"]=>
+    int(1)
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl031.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl031.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl031.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,43 @@
+--TEST--
+Test 31: setting object object's property
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Bar;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 1;
+    bless \$self, \$type;
+    return \$self;
+  }
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+$foo->bar = $bar =new Perl('Bar');
+$bar->x = 2;
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["bar"]=>
+  object(Perl::Bar)#3 (1) {
+    ["x"]=>
+    int(2)
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl032.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl032.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl032.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,49 @@
+--TEST--
+Test 32: calling objects methods (without arguments)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'int'} = 12;
+    \$self->{'float'} = 2.5;
+    \$self->{'str'} = "str";
+    bless \$self, \$type;
+    return \$self;
+  }
+
+  sub getInt {
+    my \$self = shift;
+    return \$self->{'int'};
+  }
+
+  sub getFloat {
+    my \$self = shift;
+    return \$self->{'float'};
+  }
+
+  sub getStr {
+    my \$self = shift;
+    return \$self->{'str'};
+  }
+
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->getInt());
+var_dump($foo->getFloat());
+var_dump($foo->getStr());
+echo "ok\n";
+?>
+--EXPECT--
+int(12)
+float(2.5)
+string(3) "str"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl033.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl033.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl033.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+--TEST--
+Test 33: calling objects methods with arguments
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'sum'} = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+
+  sub sum {
+    my \$self = shift;
+    foreach my \$x (@_) {
+      \$self->{'sum'} += \$x;
+    }
+    return \$self->{'sum'};
+  }
+
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+var_dump($foo->sum(1,2,3,4,5));
+var_dump($foo->sum(1,2,3,4,5));
+echo "ok\n";
+?>
+--EXPECT--
+int(15)
+int(30)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl034.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl034.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl034.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,33 @@
+--TEST--
+Test 34: passing object argument to user function
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+  sub f {
+    \$var = shift(@_);
+  }
+PERL_END
+);
+$perl->f(new Perl('Foo'));
+var_dump($perl->var);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(12)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl035.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl035.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl035.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+--TEST--
+Test 35: checking isset() and empty() on object properies
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'p1'} = 12;
+    \$self->{'p2'} = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+var_dump(isset($x->p1));
+var_dump(isset($x->p2));
+var_dump(isset($x->p3));
+var_dump(empty($x->p1));
+var_dump(empty($x->p2));
+var_dump(empty($x->p3));
+echo "ok\n";
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl036.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl036.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl036.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 36: clearing object properies with unset()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'p1'} = 1;
+    \$self->{'p2'} = 2;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+unset($x->p2);
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["p1"]=>
+  int(1)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl037.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl037.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl037.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+--TEST--
+Test 37: cloning perl objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 12;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$y = clone $x;
+$x->x = 1;
+$y->x = 2;
+var_dump($x);
+var_dump($y);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["x"]=>
+  int(1)
+}
+object(Perl::Foo)#3 (1) {
+  ["x"]=>
+  int(2)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl038.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl038.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl038.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,42 @@
+--TEST--
+Test 38: cloning perl objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = [0];
+    bless \$self, \$type;
+    return \$self;
+  }
+  sub modify {
+    my \$self = shift;
+    \$self->{'x'}->[0] = shift;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$y = clone $x;
+$x->modify(1);
+$y->modify(2);
+var_dump($x->x);
+var_dump($y->x);
+echo "ok\n";
+?>
+--EXPECT--
+array(1) {
+  [0]=>
+  int(2)
+}
+array(1) {
+  [0]=>
+  int(2)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl039.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl039.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl039.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,30 @@
+--TEST--
+Test 39: creating array based perl objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  [0]=>
+  int(0)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl040.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl040.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl040.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,33 @@
+--TEST--
+Test 40: accessing elements of array based perl object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    \$self->[1] = 1.5;
+    \$self->[2] = "str";
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+var_dump($x[0]);
+var_dump($x[1]);
+var_dump($x[2]);
+echo "ok\n";
+?>
+--EXPECT--
+int(0)
+float(1.5)
+string(3) "str"
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl041.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl041.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl041.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+--TEST--
+Test 41: setting elements of array based perl object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    \$self->[1] = 1.5;
+    \$self->[2] = "str";
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x[0] = 3;
+$x[2] = "ok";
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (3) {
+  [0]=>
+  int(3)
+  [1]=>
+  float(1.5)
+  [2]=>
+  string(2) "ok"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl042.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl042.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl042.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,38 @@
+--TEST--
+Test 42: checking isset() and empty() on elements of array based perl object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 2;
+    \$self->[1] = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+var_dump(isset($x[0]));
+var_dump(isset($x[1]));
+var_dump(isset($x[2]));
+var_dump(empty($x[0]));
+var_dump(empty($x[1]));
+var_dump(empty($x[2]));
+echo "ok\n";
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl043.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl043.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl043.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,35 @@
+--TEST--
+Test 43: clearing clearing elements of array based object with unset()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 1;
+    \$self->[1] = 2;
+    \$self->[3] = 3;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+unset($x[1]);
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (2) {
+  [0]=>
+  int(1)
+  [3]=>
+  int(3)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl044.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl044.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl044.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,42 @@
+--TEST--
+Test 44: cloning array based perl objects
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+  sub modify {
+    my \$self = shift;
+    \$self->[0] = shift;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$y = clone $x;
+$x->modify(1);
+$y->modify(2);
+var_dump($x);
+var_dump($y);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  [0]=>
+  int(1)
+}
+object(Perl::Foo)#3 (1) {
+  [0]=>
+  int(2)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl045.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl045.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl045.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 45: modifying property of object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{x} = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x->x++;
+++$x->x;
+var_dump($x->x);
+echo "ok\n";
+?>
+--EXPECT--
+int(2)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl046.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl046.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl046.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 46: modifying element of array based object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x[0]++;
+++$x[0];
+var_dump($x[0]);
+echo "ok\n";
+?>
+--EXPECT--
+int(2)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl047.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl047.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl047.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,34 @@
+--TEST--
+Test 47: foreach() on Perl object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{x} = 1;
+    \$self->{y} = 2;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$i = 0;
+foreach($x as $var => $val) {
+  echo "$var = ";
+  var_dump($val);
+  if (++$i > 5) break;
+}
+echo "ok\n";
+?>
+--EXPECT--
+y = int(2)
+x = int(1)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl048.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl048.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl048.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,33 @@
+--TEST--
+Test 48: foreach() on array based Perl object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 1;
+    \$self->[1] = 2;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$i = 0;
+foreach($x as $val) {
+  var_dump($val);
+  if (++$i > 5) break;
+}
+echo "ok\n";
+?>
+--EXPECT--
+int(1)
+int(2)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl049.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl049.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl049.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,16 @@
+--TEST--
+Test 49: creating and using perl objects from external module
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('use Digest::MD5;');
+$ctx = new Perl('Digest::MD5');
+$ctx->add("Hello");
+echo $ctx->hexdigest()."\n";
+echo "ok\n";
+?>
+--EXPECT--
+8b1a9953c4611296a827abf8c47804d7
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl050.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl050.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl050.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 50: Perl's references support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$x = $perl->eval(<<<PERL_END
+  \$x = [1];
+  \$x->[1] = \\\$x->[0];
+  return \$x;
+PERL_END
+);
+var_dump($x);
+$x[0] = 2;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  &int(1)
+  [1]=>
+  &int(1)
+}
+array(2) {
+  [0]=>
+  &int(2)
+  [1]=>
+  &int(2)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl051.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl051.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl051.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,53 @@
+--TEST--
+Test 51: PHP's references support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  \$x = shift(@_);
+  \$x->[0] = 3;
+  return \$x;
+}
+PERL_END
+);
+
+$x = array(1);
+$x[1] =& $x[0];
+var_dump($x);
+$x[0] = 2;
+var_dump($x);
+$x = $perl->f($x);
+var_dump($x);
+$x[1] = 4;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  &int(1)
+  [1]=>
+  &int(1)
+}
+array(2) {
+  [0]=>
+  &int(2)
+  [1]=>
+  &int(2)
+}
+array(2) {
+  [0]=>
+  &int(3)
+  [1]=>
+  &int(3)
+}
+array(2) {
+  [0]=>
+  &int(4)
+  [1]=>
+  &int(4)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl052.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl052.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl052.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,42 @@
+--TEST--
+Test 52: Perl's cyclic structures support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$x = $perl->eval(<<<PERL_END
+  \$x = [1];
+  \$x->[1] = \\\$x;
+  return \$x;
+PERL_END
+);
+var_dump($x);
+$x[0] = 2;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  int(1)
+  [1]=>
+  array(2) {
+    [0]=>
+    int(1)
+    [1]=>
+    *RECURSION*
+  }
+}
+array(2) {
+  [0]=>
+  int(2)
+  [1]=>
+  array(2) {
+    [0]=>
+    int(2)
+    [1]=>
+    *RECURSION*
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl053.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl053.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl053.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,61 @@
+--TEST--
+Test 53: PHP's cyclic structures support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  \$x = shift(@_);
+  \$x->[0] = 3;
+  return \$x;
+}
+PERL_END
+);
+
+$x = array(1);
+$x[1] =& $x;
+$x[0] = 2;
+var_dump($x);
+$y = $perl->f($x);
+var_dump($y);
+$x[0] = 4;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  int(2)
+  [1]=>
+  array(2) {
+    [0]=>
+    int(2)
+    [1]=>
+    *RECURSION*
+  }
+}
+array(2) {
+  [0]=>
+  int(3)
+  [1]=>
+  array(2) {
+    [0]=>
+    int(3)
+    [1]=>
+    *RECURSION*
+  }
+}
+array(2) {
+  [0]=>
+  int(4)
+  [1]=>
+  array(2) {
+    [0]=>
+    int(4)
+    [1]=>
+    *RECURSION*
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl054.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl054.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl054.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,47 @@
+--TEST--
+Test 54: Perl's cyclic object structures support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$x = $perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+  \$x = new Foo;
+  \$x->{'foo'} = \$x;
+  return \$x;
+PERL_END
+);
+var_dump($x);
+$x->x = 1;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["foo"]=>
+  object(Perl::Foo)#2 (1) {
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+object(Perl::Foo)#2 (2) {
+  ["x"]=>
+  int(1)
+  ["foo"]=>
+  object(Perl::Foo)#2 (2) {
+    ["x"]=>
+    int(1)
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl055.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl055.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl055.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,46 @@
+--TEST--
+Test 55: Perl's cyclic object structures support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x->foo = $x;
+var_dump($x);
+$x->x = 1;
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["foo"]=>
+  object(Perl::Foo)#2 (1) {
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+object(Perl::Foo)#2 (2) {
+  ["x"]=>
+  int(1)
+  ["foo"]=>
+  object(Perl::Foo)#2 (2) {
+    ["x"]=>
+    int(1)
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl056.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl056.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl056.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,46 @@
+--TEST--
+Test 56: Perl's cyclic object structures support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+sub f {
+  my \$x = shift(@_);
+  return \$x;
+}
+PERL_END
+);
+$x = new Perl('Foo');
+$x->foo = $x;
+var_dump($x);
+$x = $perl->f($x);
+var_dump($x);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["foo"]=>
+  object(Perl::Foo)#2 (1) {
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+object(Perl::Foo)#2 (1) {
+  ["foo"]=>
+  object(Perl::Foo)#2 (1) {
+    ["foo"]=>
+    *RECURSION*
+  }
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl057.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl057.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl057.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,36 @@
+--TEST--
+Test 57: Perl and PHP output buffering
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function xxx($str) {
+  return "buf[\n".$str."]\n";
+}
+ob_start("xxx");
+
+echo "PHP echo 1\n";
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+format STDOUT =
+Perl's write
+.
+write;
+PERL_END
+);
+echo "PHP echo 2\n";
+$perl->eval("print \"Perl's print\n\";");
+echo "PHP echo 3\n";
+$perl->eval("printf \"Perl's printf\n\";");
+echo "PHP echo 4\n";
+?>
+--EXPECT--
+buf[
+PHP echo 1
+Perl's write
+PHP echo 2
+Perl's print
+PHP echo 3
+Perl's printf
+PHP echo 4
+]

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl058.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl058.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl058.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 58: Proxy test
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'a1'} = 1;;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$foo = new Perl('Foo');
+$x = & $foo->a1;
+$x = 2;
+var_dump($foo);
+echo "ok\n";
+?>
+--EXPECT--
+object(Perl::Foo)#2 (1) {
+  ["a1"]=>
+  int(2)
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl059.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl059.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl059.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,28 @@
+--TEST--
+Test 59: Calling perl subroutine in array context
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+sub f {
+  return ("Hello", "World");
+}
+PERL_END
+);
+$a = $perl->f();
+var_dump($a);
+$a = $perl->array->f();
+var_dump($a);
+echo "ok\n";
+?>
+--EXPECT--
+string(5) "World"
+array(2) {
+  [0]=>
+  string(5) "Hello"
+  [1]=>
+  string(5) "World"
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl060.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl060.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl060.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,46 @@
+--TEST--
+Test 60: Calling perl method in array context
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    bless \$self, \$type;
+    return \$self;
+  }
+  
+  sub f {
+    my \$self = shift;
+    if (wantarray) {
+      return ("Hello", "World");
+    } else {
+      return 0;
+    }
+  }
+PERL_END
+);
+$foo = new Perl("Foo");
+$a = $foo->f();
+var_dump($a);
+$a = $foo->array->f();
+var_dump($a);
+$a = $foo->f();
+var_dump($a);
+echo "ok\n";
+?>
+--EXPECT--
+int(0)
+array(2) {
+  [0]=>
+  string(5) "Hello"
+  [1]=>
+  string(5) "World"
+}
+int(0)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl061.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl061.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl061.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 61: Modifying object property with += operator
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = {};
+    \$self->{'x'} = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x->x += 2;
+$x->x += 2;
+var_dump($x->x);
+echo "ok\n";
+?>
+--EXPECT--
+int(4)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl062.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl062.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl062.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 62: Modifying object element with += operator
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    \$self->[0] = 0;
+    bless \$self, \$type;
+    return \$self;
+  }
+package main;
+PERL_END
+);
+$x = new Perl('Foo');
+$x[0] += 2;
+$x[0] += 2;
+var_dump($x[0]);
+echo "ok\n";
+?>
+--EXPECT--
+int(4)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl063.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl063.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl063.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,18 @@
+--TEST--
+Test 63: Modifying scalar Perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->x = 12;
+$perl->x++;
+$perl->x -= 2;
+var_dump($perl->x);
+$perl->eval('print $x,"\n"');
+echo "ok\n";
+?>
+--EXPECT--
+int(11)
+11
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl064.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl064.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl064.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,32 @@
+--TEST--
+Test 64: Modifying array Perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->array->x = array(1,2,3);
+$perl->eval('print @x,"\n"');
+var_dump(isset($perl->array->x));
+var_dump(empty($perl->array->x));
+var_dump($perl->array->x);
+unset($perl->array->x);
+var_dump(isset($perl->array->x));
+var_dump(empty($perl->array->x));
+echo "ok\n";
+?>
+--EXPECT--
+123
+bool(true)
+bool(false)
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+bool(false)
+bool(true)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl065.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl065.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl065.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,30 @@
+--TEST--
+Test 65: Modifying hash Perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->hash->x = array("a"=>1,"b"=>2);
+$perl->eval('print %x,"\n"');
+var_dump(isset($perl->hash->x));
+var_dump(empty($perl->hash->x));
+var_dump($perl->hash->x);
+unset($perl->hash->x);
+var_dump(isset($perl->hash->x));
+var_dump(empty($perl->array->x));
+echo "ok\n";
+?>
+--EXPECT--
+a1b2
+bool(true)
+bool(false)
+array(2) {
+  ["a"]=>
+  int(1)
+  ["b"]=>
+  int(2)
+}
+bool(false)
+bool(true)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl066.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl066.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl066.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,25 @@
+--TEST--
+Test 66: Modifying scalar Perl variables
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->x = 123;
+$perl->eval('print $x,"\n"');
+var_dump(isset($perl->x));
+var_dump(empty($perl->x));
+var_dump($perl->x);
+unset($perl->x);
+var_dump(isset($perl->x));
+var_dump(empty($perl->x));
+echo "ok\n";
+?>
+--EXPECT--
+123
+bool(true)
+bool(false)
+int(123)
+bool(false)
+bool(true)
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl067.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl067.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl067.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,29 @@
+--TEST--
+Test 67: Eval code in scalar/array/hash context
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+var_dump($perl->eval('("a","b","c")'));
+var_dump($perl->array->eval('("a","b","c")'));
+var_dump($perl->hash->eval('("a","b","c")'));
+echo "ok\n";
+?>
+--EXPECT--
+string(1) "c"
+array(3) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(1) "b"
+  [2]=>
+  string(1) "c"
+}
+array(2) {
+  ["a"]=>
+  string(1) "b"
+  ["c"]=>
+  NULL
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl068.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl068.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl068.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,30 @@
+--TEST--
+Test 68: Function call in scalar/array/hash context
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval('sub f() {return ("a","b","c");}');
+var_dump($perl->f());
+var_dump($perl->array->f());
+var_dump($perl->hash->f());
+echo "ok\n";
+?>
+--EXPECT--
+string(1) "c"
+array(3) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(1) "b"
+  [2]=>
+  string(1) "c"
+}
+array(2) {
+  ["a"]=>
+  string(1) "b"
+  ["c"]=>
+  NULL
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl069.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl069.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl069.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,46 @@
+--TEST--
+Test 69: Method call in scalar/array/hash context
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+$perl->eval(<<<PERL_END
+package Foo;
+  sub new {
+    my \$this = shift;
+    my \$type = ref(\$this) || \$this;
+    my \$self = [];
+    bless \$self, \$type;
+    return \$self;
+  }
+  sub f {
+    return ("a","b","c");
+  }
+package main;
+PERL_END
+);
+
+$obj = new Perl("Foo");
+var_dump($obj->f());
+var_dump($obj->array->f());
+var_dump($obj->hash->f());
+echo "ok\n";
+?>
+--EXPECT--
+string(1) "c"
+array(3) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(1) "b"
+  [2]=>
+  string(1) "c"
+}
+array(2) {
+  ["a"]=>
+  string(1) "b"
+  ["c"]=>
+  NULL
+}
+ok

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl070.phpt
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl070.phpt	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/perl070.phpt	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,16 @@
+--TEST--
+Test 70: Catching Perl errors
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$perl = new Perl();
+try {
+	var_dump($perl->eval('$a = $s{$d}.'));
+	echo "ok\n";
+} catch (PerlException $exception) {
+  echo "Perl error: " . $exception->getMessage() . "\n";
+}
+?>
+--EXPECTF--
+Perl error: [perl] eval error: syntax error at (eval %d) line %d, at EOF

Added: trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/skipif.inc
===================================================================
--- trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/skipif.inc	                        (rev 0)
+++ trunk/gforge_base/php-perl/php-perl-1.0.0/perl-1.0.0/tests/skipif.inc	2009-06-08 08:31:24 UTC (rev 123)
@@ -0,0 +1,3 @@
+<?php
+  if (!extension_loaded('perl')) die('skip perl extension not available');
+?>

Added: trunk/gforge_base/php-perl/php-perl_1.0.0.orig.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/gforge_base/php-perl/php-perl_1.0.0.orig.tar.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the evolvis-commits mailing list