'openaire.log'), JLog :: ALL, array('openaire')); JLog :: addLogger(array('text_file' => 'openaire-router.log'), JLog :: ALL, array('router')); // log notices and warnings and convert errors to exceptions set_error_handler(function ($error, $message, $file, $line) { switch ($error) { case E_USER_NOTICE: JLog :: add('User Notice (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: NOTICE, 'openaire'); break; case E_USER_WARNING: JLog :: add('User Warning (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: WARNING, 'openaire'); break; case E_USER_ERROR: throw new ErrorException('User Error: ' . $message, $error, 0, $file, $line); break; case E_NOTICE: JLog :: add('PHP Notice (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: NOTICE, 'openaire'); break; case E_WARNING: JLog :: add('PHP Warning (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: WARNING, 'openaire'); break; case E_RECOVERABLE_ERROR: throw new ErrorException('PHP Error: ' . $message, $error, 0, $file, $line); break; } return FALSE; // prevent further error handling }); // call the controller $controller = JController :: getInstance('OpenAire'); $controller -> execute(JRequest :: getCmd('task')); $controller -> redirect();