FAQ
Author: gschlossnagle
Date: Mon Jul 25 05:23:19 2005
New Revision: 1410

Added:
PHP-Sandwich/trunk/PHP/Interpreter/
PHP-Sandwich/trunk/PHP/Interpreter/Class.pm
- copied, changed from rev 1406, PHP-Sandwich/trunk/PHP/Class.pm
PHP-Sandwich/trunk/PHP/Interpreter/Var/
Removed:
PHP-Sandwich/trunk/PHP.pm
PHP-Sandwich/trunk/PHP/Class.pm
Modified:
PHP-Sandwich/trunk/Makefile.PL
PHP-Sandwich/trunk/PHP.xs
PHP-Sandwich/trunk/PHP/Interpreter.pm
PHP-Sandwich/trunk/phpinterp.c
PHP-Sandwich/trunk/t/1.t
PHP-Sandwich/trunk/t/10.t
PHP-Sandwich/trunk/t/11.t
PHP-Sandwich/trunk/t/12.t
PHP-Sandwich/trunk/t/13.t
PHP-Sandwich/trunk/t/14.t
PHP-Sandwich/trunk/t/15.t
PHP-Sandwich/trunk/t/16.t
PHP-Sandwich/trunk/t/17.t
PHP-Sandwich/trunk/t/18.t
PHP-Sandwich/trunk/t/19.t
PHP-Sandwich/trunk/t/2.t
PHP-Sandwich/trunk/t/3.t
PHP-Sandwich/trunk/t/4.t
PHP-Sandwich/trunk/t/5.t
PHP-Sandwich/trunk/t/6.t
PHP-Sandwich/trunk/t/7.t
PHP-Sandwich/trunk/t/8.t
PHP-Sandwich/trunk/t/9.t
PHP-Sandwich/trunk/typemap
Log:
Move to PHP::Interpreter namespacing


Modified: PHP-Sandwich/trunk/Makefile.PL
==============================================================================
--- PHP-Sandwich/trunk/Makefile.PL (original)
+++ PHP-Sandwich/trunk/Makefile.PL Mon Jul 25 05:23:19 2005
@@ -19,8 +19,8 @@ WriteMakefile(
CC => $ENV{CC},
CCFLAGS => '-g',
OBJECT => join(' ',@ofiles),
- NAME => 'PHP',
- VERSION_FROM => 'PHP.pm',
+ NAME => 'PHP::Interpreter',
+ VERSION_FROM => 'PHP/Interpreter.pm',
PMLIBDIRS => ['PHP'],
LIBS => join(' ',@libs),
LDDLFLAGS => join(' ',@lddlflags),

Modified: PHP-Sandwich/trunk/PHP.xs
==============================================================================
--- PHP-Sandwich/trunk/PHP.xs (original)
+++ PHP-Sandwich/trunk/PHP.xs Mon Jul 25 05:23:19 2005
@@ -25,15 +25,15 @@
typedef struct {
zval *val;
sandwich_per_interp *interp;
-} *PHP_Class;
+} *PHP_Interpreter_Class;

typedef struct {
zval *val;
sandwich_per_interp *interp;
-} *PHP_Resource;
+} *PHP_Interpreter_Resource;

#define PHP_Interpreter sandwich_per_interp *
-#define PHP_Var_Scalar zval *
+#define PHP_Interpreter_Var_Scalar zval *

static int get_class_name(zval *z, char **name, zend_uint *namelen);

@@ -110,12 +110,12 @@ zval *SvZval(SV *sv TSRMLS_DC)
break;
case SVt_PVHV: /* assoc. array */
if(SvMAGICAL(sv)) {
- if(strncmp(HvNAME(SvSTASH(sv)), "PHP::Class::", sizeof("PHP::Class::") -1 ) == 0) {
+ if(strncmp(HvNAME(SvSTASH(sv)), "PHP::Interpreter::Class::", sizeof("PHP::Interpreter::Class::") -1 ) == 0) {
MAGIC *mg;
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
mg = mg_find(sv, PERL_MAGIC_ext);
if(!mg || !mg->mg_obj || !SvROK(mg->mg_obj) || !SvIOK(SvRV(mg->mg_obj))) break;
- pclass = (PHP_Class) SvIV(SvRV(mg->mg_obj));
+ pclass = (PHP_Interpreter_Class) SvIV(SvRV(mg->mg_obj));
retval = pclass->val;
} else {
// handle non-PHP classes
@@ -144,8 +144,8 @@ zval *SvZval(SV *sv TSRMLS_DC)
break;
case SVt_PVMG: /* magic */
if(sv_isobject(orig_sv)) {
- if(strcmp(HvNAME(SvSTASH(sv)), "PHP::Resource") == 0) {
- PHP_Resource prsrc = (PHP_Resource) SvIV(sv);
+ if(strcmp(HvNAME(SvSTASH(sv)), "PHP::Interpreter::Resource") == 0) {
+ PHP_Interpreter_Resource prsrc = (PHP_Interpreter_Resource) SvIV(sv);
retval = prsrc->val;
} else {
/* should wrap me in a zend object */
@@ -246,7 +246,7 @@ SV *newSVzval(zval *zptr, PHP_Interprete
char objectname[MAXPATHLEN];
HV *h1, *package;
SV * c1;
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;

/* this is the special case that this is a perl object returning to us */
if(Z_OBJCE_P(zptr) == plsv_ce) {
@@ -266,8 +266,8 @@ SV *newSVzval(zval *zptr, PHP_Interprete
if(get_class_name(zptr, &name, &namelen) < 0) {
name = "UNKNOWN";
}
- snprintf(objectname, MAXPATHLEN, "PHP::Class::%s", name);
- sv_setref_pv(c1, "PHP::Class", (void *) pclass);
+ snprintf(objectname, MAXPATHLEN, "PHP::Interpreter::Class::%s", name);
+ sv_setref_pv(c1, "PHP::Interpreter::Class", (void *) pclass);
h1 = (HV *)sv_2mortal((SV *)newHV());
hv_magic(h1, (GV*)c1, PERL_MAGIC_tied);
sv_magic((SV *)h1, c1, PERL_MAGIC_ext, NULL, -1);
@@ -276,10 +276,10 @@ SV *newSVzval(zval *zptr, PHP_Interprete
{
char objectisa[MAXPATHLEN];
package = gv_stashpv(objectname, 1);
- snprintf(objectisa, MAXPATHLEN, "PHP::Class::%s::ISA", name);
+ snprintf(objectisa, MAXPATHLEN, "PHP::Interpreter::Class::%s::ISA", name);
//if(get_av(objectisa, FALSE)) {
av_push(get_av(objectisa, TRUE),
- newSVpv("PHP::Class", 0));
+ newSVpv("PHP::Interpreter::Class", 0));
//}
}
retval = sv_bless(retval, package);
@@ -292,7 +292,7 @@ SV *newSVzval(zval *zptr, PHP_Interprete
case IS_RESOURCE:
{
SV * c1;
- PHP_Resource prsrc;
+ PHP_Interpreter_Resource prsrc;

c1 = newSV(0);
prsrc = malloc(sizeof(*prsrc));
@@ -301,7 +301,7 @@ SV *newSVzval(zval *zptr, PHP_Interprete
ZVAL_ZVAL(prsrc->val, zptr, 1, 0);
sandwich_interp_inc_ref(interp);
prsrc->interp = interp;
- sv_setref_pv(c1, "PHP::Resource", (void *) prsrc);
+ sv_setref_pv(c1, "PHP::Interpreter::Resource", (void *) prsrc);
retval = newSV(0);
sv_magic(retval, c1, PERL_MAGIC_tiedscalar, NULL, 0);
}
@@ -416,7 +416,7 @@ static my_auto_globals_create_request(vo
}


-MODULE = PHP PACKAGE = PHP::Interpreter PREFIX=SAND_
+MODULE = PHP::Interpreter PACKAGE = PHP::Interpreter PREFIX=SAND_

REQUIRE: 1.9505
PROTOTYPES: DISABLE
@@ -670,13 +670,13 @@ SV* SAND_instantiate(interp, class, ...)
OUTPUT:
RETVAL

-MODULE = PHP PACKAGE = PHP::Class PREFIX=PHP_V_C_
+MODULE = PHP::Interpreter PACKAGE = PHP::Interpreter::Class PREFIX=PHP_V_C_

REQUIRE: 1.9505
PROTOTYPES: DISABLE

SV* PHP_V_C_FETCH(pclass, key)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
char *key;
CODE:
{
@@ -698,7 +698,7 @@ SV* PHP_V_C_FETCH(pclass, key)
RETVAL

SV* PHP_V_C_STORE(pclass, key, value)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
char *key;
SV *value;
CODE:
@@ -724,7 +724,7 @@ SV* PHP_V_C_STORE(pclass, key, value)
RETVAL

SV* PHP_V_C_FIRSTKEY(pclass)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
CODE:
{
char *key;
@@ -758,7 +758,7 @@ SV* PHP_V_C_FIRSTKEY(pclass)
RETVAL

SV* PHP_V_C_NEXTKEY(pclass, lastkey)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
char *lastkey;
CODE:
{
@@ -793,7 +793,7 @@ SV* PHP_V_C_NEXTKEY(pclass, lastkey)
RETVAL

SV* PHP_V_C_EXISTS(pclass, skey)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
SV *skey;
CODE:
{
@@ -819,7 +819,7 @@ SV* PHP_V_C_EXISTS(pclass, skey)
RETVAL

SV *PHP_V_C_DELETE(pclass, skey)
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
SV *skey;
CODE:
{
@@ -857,7 +857,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
char *method_name;
CODE:
{
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
void *old_ctx;
MAGIC *mg;
zval method;
@@ -870,7 +870,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
char *croakstr = NULL;

mg = mg_find((SvRV(self)), PERL_MAGIC_ext);
- pclass = (PHP_Class) SvIV(SvRV(mg->mg_obj));
+ pclass = (PHP_Interpreter_Class) SvIV(SvRV(mg->mg_obj));

interp = pclass->interp;

@@ -933,7 +933,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,

SV * c1 = sv_newmortal();
RETVAL = newSV(0);
- sv_setref_pv(c1, "PHP::Var::Scalar", (void *) retval);
+ sv_setref_pv(c1, "PHP::Interpreter::Var::Scalar", (void *) retval);
sv_magic(RETVAL, c1, PERL_MAGIC_tiedscalar, NULL, 0);

*/
@@ -948,7 +948,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
char objectname[MAXPATHLEN];
HV *h1, *package;
SV * c1;
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;

c1 = newSV(0);
pclass = malloc(sizeof(*pclass));
@@ -958,8 +958,8 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
if(get_class_name(retval, &name, &namelen) < 0) {
name = "UNKNOWN";
}
- snprintf(objectname, MAXPATHLEN, "PHP::Class::%s", name);
- sv_setref_pv(c1, "PHP::Class", (void *) pclass);
+ snprintf(objectname, MAXPATHLEN, "PHP::Interpreter::Class::%s", name);
+ sv_setref_pv(c1, "PHP::Interpreter::Class", (void *) pclass);
h1 = (HV *)sv_2mortal((SV *)newHV());
hv_magic(h1, (GV*)c1, PERL_MAGIC_tied);
RETVAL = newRV((SV *)h1);
@@ -967,10 +967,10 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
{
char objectisa[MAXPATHLEN];
package = gv_stashpv(objectname, 1);
- snprintf(objectisa, MAXPATHLEN, "PHP::Class::%s::ISA", name);
+ snprintf(objectisa, MAXPATHLEN, "PHP::Interpreter::Class::%s::ISA", name);
//if(get_av(objectisa, FALSE)) {
av_push(get_av(objectisa, TRUE),
- newSVpv("PHP::Class", 0));
+ newSVpv("PHP::Interpreter::Class", 0));
//}
}
sv_setref_pv(RETVAL, objectname, (void *) pclass);
@@ -979,7 +979,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
case IS_RESOURCE:
{
SV * c1;
- PHP_Resource prsrc;
+ PHP_Interpreter_Resource prsrc;

c1 = newSV(0);
prsrc = malloc(sizeof(*prsrc));
@@ -988,7 +988,7 @@ SV *PHP_V_C__AUTOLOAD(self, method_name,
prsrc->interp = interp;
sandwich_interp_inc_ref(interp);
RETVAL = newSV(0);
- sv_setref_pv(c1, "PHP::Resource", (void *) prsrc);
+ sv_setref_pv(c1, "PHP::Interpreter::Resource", (void *) prsrc);
sv_magic(RETVAL, c1, PERL_MAGIC_tiedscalar, NULL, 0);
}
break;
@@ -1021,13 +1021,13 @@ void PHP_V_C_DESTROY(in)
SV *in;
CODE:
{
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
void *old_ctx;
MAGIC *mg;

mg = mg_find((SvRV(in)), PERL_MAGIC_ext);
if(!mg || !mg->mg_obj || !SvROK(mg->mg_obj) || !SvIOK(SvRV(mg->mg_obj))) return;
- pclass = (PHP_Class) SvIV(SvRV(mg->mg_obj));
+ pclass = (PHP_Interpreter_Class) SvIV(SvRV(mg->mg_obj));
if(!pclass) return;
old_ctx = tsrm_set_interpreter_context(pclass->interp->ctx);
{
@@ -1045,7 +1045,7 @@ SV* PHP_V_C_create(in, class, ...)
char *class;
CODE:
{
- PHP_Class pclass;
+ PHP_Interpreter_Class pclass;
void *old_ctx;
char *croakstr = NULL;
MAGIC *mg;
@@ -1053,7 +1053,7 @@ SV* PHP_V_C_create(in, class, ...)

mg = mg_find((SvRV(in)), PERL_MAGIC_ext);
if(!mg) return;
- pclass = (PHP_Class) SvIV(SvRV(mg->mg_obj));
+ pclass = (PHP_Interpreter_Class) SvIV(SvRV(mg->mg_obj));
if(!pclass) return;
old_ctx = tsrm_set_interpreter_context(pclass->interp->ctx);
{
@@ -1089,14 +1089,14 @@ SV* PHP_V_C_create(in, class, ...)
OUTPUT:
RETVAL

-MODULE = PHP PACKAGE = PHP::Resource PREFIX=PHP_V_R_
+MODULE = PHP::Interpreter PACKAGE = PHP::Interpreter::Resource PREFIX=PHP_V_R_

REQUIRE: 1.9505
PROTOTYPES: DISABLE

-PHP_Resource PHP_V_R_FETCH(zptr)
- PHP_Resource zptr;
- PHP_Resource rv;
+PHP_Interpreter_Resource PHP_V_R_FETCH(zptr)
+ PHP_Interpreter_Resource zptr;
+ PHP_Interpreter_Resource rv;
CODE:
{
void *old_ctx = tsrm_set_interpreter_context(zptr->interp->ctx);
@@ -1111,14 +1111,14 @@ PHP_Resource PHP_V_R_FETCH(zptr)
RETVAL

void PHP_V_R_STORE(zptr, new)
- PHP_Resource zptr;
+ PHP_Interpreter_Resource zptr;
SV *new;
CODE:
{
}

void PHP_V_R_DESTROY(prsrc)
- PHP_Resource prsrc;
+ PHP_Interpreter_Resource prsrc;
CODE:
{
if(!prsrc || !prsrc->interp) return;

Modified: PHP-Sandwich/trunk/PHP/Interpreter.pm
==============================================================================
--- PHP-Sandwich/trunk/PHP/Interpreter.pm (original)
+++ PHP-Sandwich/trunk/PHP/Interpreter.pm Mon Jul 25 05:23:19 2005
@@ -2,7 +2,12 @@ package PHP::Interpreter;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
+@ISA = qw(Exporter DynaLoader);
+$VERSION = "0.9";

+use PHP::Interpreter::Class;
+
+bootstrap PHP::Interpreter;

sub AUTOLOAD {
my $sub = $AUTOLOAD;

Copied: PHP-Sandwich/trunk/PHP/Interpreter/Class.pm (from rev 1406, PHP-Sandwich/trunk/PHP/Class.pm)
==============================================================================
--- PHP-Sandwich/trunk/PHP/Class.pm (original)
+++ PHP-Sandwich/trunk/PHP/Interpreter/Class.pm Mon Jul 25 05:23:19 2005
@@ -1,4 +1,4 @@
-package PHP::Class;
+package PHP::Interpreter::Class;

use strict;


Modified: PHP-Sandwich/trunk/phpinterp.c
==============================================================================
--- PHP-Sandwich/trunk/phpinterp.c (original)
+++ PHP-Sandwich/trunk/phpinterp.c Mon Jul 25 05:23:19 2005
@@ -257,7 +257,7 @@ SV *sandwich_eval(sandwich_per_interp *i
{
TSRMLS_FETCH();
zend_try {
- if (FAILURE == my_eval_string(code, &retval, "PHP::eval" TSRMLS_CC)) {
+ if (FAILURE == my_eval_string(code, &retval, "PHP::Interpreter::eval" TSRMLS_CC)) {
rv = -1;
goto cleanup;
}

Modified: PHP-Sandwich/trunk/t/1.t
==============================================================================
--- PHP-Sandwich/trunk/t/1.t (original)
+++ PHP-Sandwich/trunk/t/1.t Mon Jul 25 05:23:19 2005
@@ -1,9 +1,8 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 6;
+use Test::More tests => 5;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}
# weird hack for include path

Modified: PHP-Sandwich/trunk/t/10.t
==============================================================================
--- PHP-Sandwich/trunk/t/10.t (original)
+++ PHP-Sandwich/trunk/t/10.t Mon Jul 25 05:23:19 2005
@@ -1,18 +1,17 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 6;
+use Test::More tests => 5;
use Data::Dumper;

BEGIN {
diag 'Instantiate an internal class with PHP::Interpreter::instantiate()';
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
- use_ok 'PHP::Class' or die;
+ use_ok 'PHP::Interpreter::Class' or die;
}

ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";

my $arg = $p->instantiate('stdClass');

-is ref($arg), "PHP::Class::stdClass", "class membership correct";
-is $PHP::Class::stdClass::ISA[0], 'PHP::Class', 'class inherits correctly';
+is ref($arg), "PHP::Interpreter::Class::stdClass", "class membership correct";
+is $PHP::Interpreter::Class::stdClass::ISA[0], 'PHP::Interpreter::Class', 'class inherits correctly';

Modified: PHP-Sandwich/trunk/t/11.t
==============================================================================
--- PHP-Sandwich/trunk/t/11.t (original)
+++ PHP-Sandwich/trunk/t/11.t Mon Jul 25 05:23:19 2005
@@ -3,7 +3,7 @@ use strict;
use Test::More tests => 3;

BEGIN {
- use_ok 'PHP' or die;
+ use_ok 'PHP::Interpreter' or die;
}

diag "Testing basic function autoloadind";

Modified: PHP-Sandwich/trunk/t/12.t
==============================================================================
--- PHP-Sandwich/trunk/t/12.t (original)
+++ PHP-Sandwich/trunk/t/12.t Mon Jul 25 05:23:19 2005
@@ -1,9 +1,8 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}

@@ -11,7 +10,7 @@ diag "Testing basic function autoloadind
ok my $p = PHP::Interpreter->new, "Create new PHP interpreter";
ok $p->eval('function callme() { return Perl::getInstance(); }'),
'Add a "callme" Perl::getInstance() wrapper';
-ok $p->callme()->isa('PHP::Class::PerlObject'),
+ok $p->callme()->isa('PHP::Interpreter::Class::PerlObject'),
'We should get a perl object back from Perl::getInstance()';
ok $p->eval(q!
function callme2() {

Modified: PHP-Sandwich/trunk/t/13.t
==============================================================================
--- PHP-Sandwich/trunk/t/13.t (original)
+++ PHP-Sandwich/trunk/t/13.t Mon Jul 25 05:23:19 2005
@@ -1,9 +1,8 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 4;
+use Test::More tests => 3;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/14.t
==============================================================================
--- PHP-Sandwich/trunk/t/14.t (original)
+++ PHP-Sandwich/trunk/t/14.t Mon Jul 25 05:23:19 2005
@@ -1,9 +1,8 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 8;
+use Test::More tests => 7;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/15.t
==============================================================================
--- PHP-Sandwich/trunk/t/15.t (original)
+++ PHP-Sandwich/trunk/t/15.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;

BEGIN {
diag "Testing Perl::call";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/16.t
==============================================================================
--- PHP-Sandwich/trunk/t/16.t (original)
+++ PHP-Sandwich/trunk/t/16.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;

BEGIN {
diag "Testing passing blessed references into PHP";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/17.t
==============================================================================
--- PHP-Sandwich/trunk/t/17.t (original)
+++ PHP-Sandwich/trunk/t/17.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;

BEGIN {
diag "Testing passing resources out of PHP";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/18.t
==============================================================================
--- PHP-Sandwich/trunk/t/18.t (original)
+++ PHP-Sandwich/trunk/t/18.t Mon Jul 25 05:23:19 2005
@@ -1,9 +1,8 @@
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;

BEGIN {
diag "Testing Passing interpreter globals";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/19.t
==============================================================================
--- PHP-Sandwich/trunk/t/19.t (original)
+++ PHP-Sandwich/trunk/t/19.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 15;
+use Test::More tests => 14;

BEGIN {
diag "Testing Output Buffering";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}

@@ -21,7 +20,8 @@ is $output, 'datadata', 'check output bu
is $p->get_output, 'datadata', 'check output buffer accessor';
$p->clear_output;
is $output, undef, 'check output buffering was cleared (scalar pass by ref)';
-$p->eval(q/print $BRIC['special'];/);
+my $arg = q/print $BRIC['special'];/;
+$p->eval($arg);
is $output, 'data', 'check output buffering, post-clearing (scalar pass by ref)';
$p->clear_output;
$p->eval(q/print $BRIC['special'];/);

Modified: PHP-Sandwich/trunk/t/2.t
==============================================================================
--- PHP-Sandwich/trunk/t/2.t (original)
+++ PHP-Sandwich/trunk/t/2.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 6;
+use Test::More tests => 5;

BEGIN {
diag "Testing basic function autoloadind";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/3.t
==============================================================================
--- PHP-Sandwich/trunk/t/3.t (original)
+++ PHP-Sandwich/trunk/t/3.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
use ExtUtils::testlib;
-use Test::More tests => 6;
+use Test::More tests => 5;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/4.t
==============================================================================
--- PHP-Sandwich/trunk/t/4.t (original)
+++ PHP-Sandwich/trunk/t/4.t Mon Jul 25 05:23:19 2005
@@ -1,8 +1,7 @@
use strict;
-use Test::More tests => 6;
+use Test::More tests => 5;

BEGIN {
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/5.t
==============================================================================
--- PHP-Sandwich/trunk/t/5.t (original)
+++ PHP-Sandwich/trunk/t/5.t Mon Jul 25 05:23:19 2005
@@ -1,11 +1,10 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 6;
+use Test::More tests => 5;

BEGIN {
# use ExtUtils::testlib;
diag "Testing passing and return nested arrays.";
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/6.t
==============================================================================
--- PHP-Sandwich/trunk/t/6.t (original)
+++ PHP-Sandwich/trunk/t/6.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 4;
+use Test::More tests => 3;

BEGIN {
diag 'Check failed evals';
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}


Modified: PHP-Sandwich/trunk/t/7.t
==============================================================================
--- PHP-Sandwich/trunk/t/7.t (original)
+++ PHP-Sandwich/trunk/t/7.t Mon Jul 25 05:23:19 2005
@@ -1,10 +1,9 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 9;
+use Test::More tests => 8;

BEGIN {
diag '3 ways of calling methods.';
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
}
my $inc = 'test.inc';

Modified: PHP-Sandwich/trunk/t/8.t
==============================================================================
--- PHP-Sandwich/trunk/t/8.t (original)
+++ PHP-Sandwich/trunk/t/8.t Mon Jul 25 05:23:19 2005
@@ -1,13 +1,12 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 9;
+use Test::More tests => 8;
use Data::Dumper;

BEGIN {
diag '3 ways of calling methods.';
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
- use_ok 'PHP::Class' or die;
+ use_ok 'PHP::Interpreter::Class' or die;
}

ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";
@@ -20,9 +19,9 @@ function foo() { return $foo = new Foo()

/);
my $arg = $p->foo();
-is ref($arg), "PHP::Class::Foo", "class membership correct";
+is ref($arg), "PHP::Interpreter::Class::Foo", "class membership correct";
is $arg->{a}, 123, "attribute access";
$arg->{a} = 456;
is $arg->{a}, 456, "attribute writing";
is $arg->bar(), 'george', 'function calls';
-is $PHP::Class::Foo::ISA[0], 'PHP::Class', 'class inherits correctly';
+is $PHP::Interpreter::Class::Foo::ISA[0], 'PHP::Interpreter::Class', 'class inherits correctly';

Modified: PHP-Sandwich/trunk/t/9.t
==============================================================================
--- PHP-Sandwich/trunk/t/9.t (original)
+++ PHP-Sandwich/trunk/t/9.t Mon Jul 25 05:23:19 2005
@@ -1,13 +1,11 @@
#!/opt/ecelerity/3rdParty/bin/perl -w
use strict;
-use Test::More tests => 9;
-use Data::Dumper;
+use Test::More tests => 8;

BEGIN {
diag 'Instantiate a userland class with PHP::Interpreter::instantiate()';
- use_ok 'PHP' or die;
use_ok 'PHP::Interpreter' or die;
- use_ok 'PHP::Class' or die;
+ use_ok 'PHP::Interpreter::Class' or die;
}

ok my $p = new PHP::Interpreter(), "Create new PHP interpreter";
@@ -21,10 +19,10 @@ class Foo {

my $arg = $p->instantiate('Foo', 123);

-is ref($arg), "PHP::Class::Foo", "class membership correct";
+is ref($arg), "PHP::Interpreter::Class::Foo", "class membership correct";
is $arg->{a}, 123, "attribute access";
$arg->{a} = 456;
is $arg->{a}, 456, "attribute writing";
is $arg->bar(), 'george', 'function calls';
-is $PHP::Class::Foo::ISA[0], 'PHP::Class', 'class inherits correctly';
+is $PHP::Interpreter::Class::Foo::ISA[0], 'PHP::Interpreter::Class', 'class inherits correctly';


Modified: PHP-Sandwich/trunk/typemap
==============================================================================
--- PHP-Sandwich/trunk/typemap (original)
+++ PHP-Sandwich/trunk/typemap Mon Jul 25 05:23:19 2005
@@ -1,7 +1,7 @@
PHP_Interpreter T_PTROBJ_SPECIAL
-PHP_Var_Scalar T_PTROBJ_SPECIAL
-PHP_Resource T_PTROBJ_SPECIAL
-PHP_Class T_PTROBJ_SPECIAL
+PHP_Interpreter_Var_Scalar T_PTROBJ_SPECIAL
+PHP_Interpreter_Resource T_PTROBJ_SPECIAL
+PHP_Interpreter_Class T_PTROBJ_SPECIAL

INPUT
T_PTROBJ_SPECIAL

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-sandwich-dev @
categoriesperl
postedJul 25, '05 at 12:23p
activeJul 25, '05 at 12:23p
posts1
users1
websiteperl.org

1 user in discussion

Gschlossnagle: 1 post

People

Translate

site design / logo © 2018 Grokbase