Page 1 of 1

Class not found error

Posted: Thu Feb 18, 2010 12:24 pm
by KeithStephens803
I am getting Class 'index' not found in Eval() code.


//write config

$path = dirname(__FILE__).DS.'..'.DS.'paymentclass';

if ( $model->payment_class ) {

if (include_once($path.DS.$model->payment_class )) {
eval( "\$_PAYMENT = new ".str_replace('.php', '', $model->payment_class)."();");
}
}else {
include( $path."pcl_payment.php" );
$_PAYMENT = new pcl_payment();
}
$_PAYMENT->write_configuration();

//end write


Why??????

Re: Class not found error

Posted: Thu Feb 18, 2010 1:09 pm
by AbraCadaver
Two possibilities:

1. There is no Class index in $path.DS.$model->payment_class
2. The path is wrong and you've run an include_once on this file already

E_ALL error reporting will show you if it is #2. If not, then it is #1.