-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·68 lines (54 loc) · 1.48 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Oraculo(tm) : Crawler software (http://oraculo.umaic.org)
* Copyright 2016, UMAIC (http://umaic.org)
*
* Licensed under GNU GENERAL PUBLIC LICENSE
* Redistributions of files must retain the above copyright notice.
*
* PHP version 5
*
* @category Script
* @package Oraculo
* @author Fogui <github.com/fogui>
* @copyright 2016, UMAIC (http://umaic.org)
* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License
* @link http://oraculo.umaic.org Oraculo
*/
require dirname( __FILE__ ).'/config.php';
$service_dir = $config['services'];
// Parametro $m = modulo
// Parametro $a = accion
// Parametro $p = parametros separados por ~
extract($_GET);
header('Content-Type: application/json');
switch ($m) {
case 'news':
include_once($service_dir.'/news.php');
$service = new NewsService();
switch ($a) {
case 'get':
echo $service->get($p);
break;
default:
# code...
break;
}
break;
case 'diccionario':
include_once($service_dir.'/diccionario.php');
$service = new DiccionarioService();
switch ($a) {
case 'get':
echo $service->get($p);
break;
default:
echo $service->save($p,$_POST['text'],$_POST['update']);
break;
}
break;
default:
# code...
break;
}
?>