Mantis - Quercus
Viewing Issue Advanced Details
3164 minor always 12-12-08 13:40 01-09-09 09:37
koreth  
nam  
urgent  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003164: resin_restore_state does not restore imported Java classes
If my "if (!resin_restore_state())" block has an "import" keyword to import a Java class, the class is undefined on subsequent page loads when I'm using the restored state.

Workaround: do the import statements before the resin_restore_state() call.

Notes
(0003627)
ferg   
12-14-08 15:18   
import has bigger issues. It's not currently implemented correctly. It should be lexical, but it modifying the Env directly.
(0003628)
koreth   
12-14-08 15:21   
Okay, if you're talking changes to "import", it would be kind of neat if there were a function-based equivalent, e.g.,

resin_import('com.mycompany.MyClass');

Then you could do

if (function_exists('resin_import')) {
  resin_import('com.mycompany.MyClass');
} else {
  include_once 'myclass-php-implementation.php';
}

to support running the same code both in and out of Quercus. Right now I have to put "import" statements in separate PHP files that get conditionally included, because the "import" keyword is a syntax error in Zend PHP.
(0003711)
nam   
01-09-09 09:37   
php/404l

Issue fixed. Also added quercus_import() for convenience.