[phpa] Re: class not found


Hi all!

I have the same problem but in a different case.
I'm using PHPA 1.2p4 on a Linux glibc 2.2 PHP 4.1.1

When a php code uses a function that includes an other function definition -
ex:
function test () {

  function i_am_embeded() { ... }

  for(;;) { i_am_embebed(..) }

}

PHP (+PHPA) complains that function has already been defined and dies...
hugh!
without PHPA it works fine.

Is there a release of PHPA (older) than doesn't have this bug ?

Best regards,

Christophe Ruelle

----- Original Message -----
From: "Thomas Duffey" <tduffey@xxxxxxxxxxxx>
To: <phpa@xxxxxxxxxxxxx>
Cc: <nick@xxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, April 01, 2002 8:21 PM
Subject: [phpa] class not found


>
> Nick and others,
>
> Just noticed this morning that there seems to be a problem when using PHPA
> and certain include_once() statements.  The scenario goes like this:
>
> I have a db-driven system where generic forms allow adding/editing various
> objects that are mapped back to the db.  The "add" form posts in
information
> for each field and also a string containing the class name to be added.
>
> The form posts to a "save.php" script that determines that determines
> whether or not I am adding a new object or editing an existing object.
For
> this example I am adding a new object.  So, I instantiate a new
> "ComponentManager" objects that knows how to create a blank object of the
> type I want.  Like this:
>
> $className = $HTTP_ALL_VARS['className'];
> $slave = new ComponentManager();
> $newComponent = $slave->createComponentByName($className, ...);
>
> With PHPA enabled, the ComponentManager::createComponentByName() method is
> complaining that it cannot instantiate unknown class of whatever type I
want
> to add.  The method is really simple:
>
> function createComponentByName($className, ...)
> {
>   include_once("lib/Component/class.$className.php");
>   $c = new $className();
>   // do some stuff to $c
>   return $c;
> }
>
> Apparently the include_once() is not including the class definition when
> PHPA is enabled.  Any ideas?  The code runs fine w/o PHPA.
>
> - Tom Duffey
>
>
> ------------------------------------------------------------------------
>   www.php-accelerator.co.uk           Home of the free PHP Accelerator
>
> To post, send email to phpa@xxxxxxxxxxxxx
> To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe
>
>
>

------------------------------------------------------------------------
  www.php-accelerator.co.uk           Home of the free PHP Accelerator

To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe


Other related posts: