develooper Front page | perl.php.sandwich.dev | Postings from June 2005

[svn:PHP-Sandwich] rev 1078 - in PHP-Sandwich/trunk: . PHP t

From:
gschlossnagle
Date:
June 8, 2005 09:55
Subject:
[svn:PHP-Sandwich] rev 1078 - in PHP-Sandwich/trunk: . PHP t
Message ID:
20050608165535.18612.qmail@x1.develooper.com
Author: gschlossnagle
Date: Wed Jun  8 09:55:35 2005
New Revision: 1078

Added:
   PHP-Sandwich/trunk/t/18.t   (contents, props changed)
Modified:
   PHP-Sandwich/trunk/PHP.pm
   PHP-Sandwich/trunk/PHP.xs
   PHP-Sandwich/trunk/PHP/Interpreter.pm
   PHP-Sandwich/trunk/t/11.t
Log:
more test, cleanup



Modified: PHP-Sandwich/trunk/PHP.pm
==============================================================================
--- PHP-Sandwich/trunk/PHP.pm	(original)
+++ PHP-Sandwich/trunk/PHP.pm	Wed Jun  8 09:55:35 2005
@@ -2,14 +2,18 @@ package PHP;
 
 require Exporter;
 require DynaLoader;
+use PHP::Interpreter;
+use PHP::Class;
 
 use strict;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
 $VERSION = "0.9";
 
+
 @ISA = qw(Exporter DynaLoader);
 
 bootstrap PHP;
 
+
 1;
 __END__

Modified: PHP-Sandwich/trunk/PHP.xs
==============================================================================
--- PHP-Sandwich/trunk/PHP.xs	(original)
+++ PHP-Sandwich/trunk/PHP.xs	Wed Jun  8 09:55:35 2005
@@ -422,7 +422,6 @@ SV* SAND_new(classname, ...)
         RETVAL = &PL_sv_undef;
         return;
       }
-      fprintf(stderr, "items: %d\n", items);
       interp = sandwich_per_interp_setup();
       if(items > 1 && SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVHV)) {
         HV *args = (HV *) SvRV(ST(1));
@@ -547,7 +546,7 @@ SV *SAND_call(method_name, interp, ...)
     }
   OUTPUT:
     RETVAL
-  
+
 void SAND_DESTROY(interp)
   PHP_Interpreter interp;
   CODE:

Modified: PHP-Sandwich/trunk/PHP/Interpreter.pm
==============================================================================
--- PHP-Sandwich/trunk/PHP/Interpreter.pm	(original)
+++ PHP-Sandwich/trunk/PHP/Interpreter.pm	Wed Jun  8 09:55:35 2005
@@ -1,11 +1,11 @@
 package PHP::Interpreter;
 
-use AutoLoader;
+#use AutoLoader;
 
 use strict;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
 
-@ISA = qw(AutoLoader);
+#@ISA = qw(AutoLoader);
 
 sub AUTOLOAD {
   my $sub = $AUTOLOAD;

Modified: PHP-Sandwich/trunk/t/11.t
==============================================================================
--- PHP-Sandwich/trunk/t/11.t	(original)
+++ PHP-Sandwich/trunk/t/11.t	Wed Jun  8 09:55:35 2005
@@ -1,10 +1,9 @@
 #!/opt/ecelerity/3rdParty/bin/perl
 use strict;
-use Test::More tests => 5;
+use Test::More tests => 3;
 
 BEGIN {
     use_ok 'PHP' or die;
-    use_ok 'PHP::Interpreter' or die;
 }
 
 diag "Testing basic function autoloadind";

Added: PHP-Sandwich/trunk/t/18.t
==============================================================================
--- (empty file)
+++ PHP-Sandwich/trunk/t/18.t	Wed Jun  8 09:55:35 2005
@@ -0,0 +1,23 @@
+#!/opt/ecelerity/3rdParty/bin/perl
+use strict;
+use Test::More tests => 6;
+
+BEGIN {
+    diag "Testing Passing interpreter globals";
+    use_ok 'PHP' or die;
+    use_ok 'PHP::Interpreter' or die;
+}
+
+ok my $p = PHP::Interpreter->new(
+  {
+    'GET' => 
+      {'name' => 'george',},
+    'BRIC' => 
+      {'special' => 'data',}
+  }),
+  "Create new PHP interpreter";
+
+is $p->eval(q/return $_GET['name'];/), 'george', 'Checking $_GET';
+is $p->eval(q/function foo(){ return $_GET['name'];} return foo();/), 'george', 'Checking $_GET is an autoglobal';
+is $p->eval(q/return $_REQUEST['name'];/), 'george', 'Checking $_REQUEST population';
+is $p->eval(q/return $BRIC['special'];/), 'data', 'Checking custom variable population';



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About