1 |
14352
|
thanos.pap
|
<?php
|
2 |
|
|
|
3 |
|
|
defined('_JEXEC') or die('Access denied');
|
4 |
|
|
|
5 |
|
|
jimport('joomla.application.component.controller');
|
6 |
|
|
jimport('joomla.environment.request');
|
7 |
|
|
jimport('joomla.log.log');
|
8 |
|
|
|
9 |
|
|
// set up logging
|
10 |
|
|
JLog :: addLogger(array('text_file' => 'openaire.log'), JLog :: ALL, array('openaire'));
|
11 |
22919
|
thanos.pap
|
JLog :: addLogger(array('text_file' => 'openaire-router.log'), JLog :: ALL, array('router'));
|
12 |
14352
|
thanos.pap
|
|
13 |
|
|
// log notices and warnings and convert errors to exceptions
|
14 |
|
|
set_error_handler(function ($error, $message, $file, $line) {
|
15 |
|
|
switch ($error) {
|
16 |
|
|
case E_USER_NOTICE:
|
17 |
|
|
JLog :: add('User Notice (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: NOTICE, 'openaire');
|
18 |
|
|
break;
|
19 |
|
|
case E_USER_WARNING:
|
20 |
|
|
JLog :: add('User Warning (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: WARNING, 'openaire');
|
21 |
|
|
break;
|
22 |
|
|
case E_USER_ERROR:
|
23 |
|
|
throw new ErrorException('User Error: ' . $message, $error, 0, $file, $line);
|
24 |
|
|
break;
|
25 |
|
|
case E_NOTICE:
|
26 |
|
|
JLog :: add('PHP Notice (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: NOTICE, 'openaire');
|
27 |
|
|
break;
|
28 |
|
|
case E_WARNING:
|
29 |
|
|
JLog :: add('PHP Warning (file: ' . $file . ', line: ' . $line . '): ' . $message, JLog :: WARNING, 'openaire');
|
30 |
|
|
break;
|
31 |
|
|
case E_RECOVERABLE_ERROR:
|
32 |
|
|
throw new ErrorException('PHP Error: ' . $message, $error, 0, $file, $line);
|
33 |
|
|
break;
|
34 |
|
|
}
|
35 |
|
|
return FALSE; // prevent further error handling
|
36 |
|
|
});
|
37 |
|
|
|
38 |
|
|
// call the controller
|
39 |
|
|
$controller = JController :: getInstance('OpenAire');
|
40 |
|
|
$controller -> execute(JRequest :: getCmd('task'));
|
41 |
|
|
$controller -> redirect();
|