diff options
Diffstat (limited to 'admin')
-rw-r--r-- | admin/WebConsole/rest/index.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/admin/WebConsole/rest/index.php b/admin/WebConsole/rest/index.php index fd2f3230..17f9a568 100644 --- a/admin/WebConsole/rest/index.php +++ b/admin/WebConsole/rest/index.php @@ -6,7 +6,7 @@ * @note Some ideas are based on article "How to create REST API for Android app using PHP, Slim and MySQL" by Ravi Tamada, thanx. * @license GNU GPLv3+ * @author Ramón M. Gómez, ETSII Univ. Sevilla - * @version 1.1 + * @version 1.1.0 * @date 2016-05-19 */ @@ -16,33 +16,33 @@ include_once("../controlacceso.php"); include_once("../clases/AdoPhp.php"); include_once("../includes/CreaComando.php"); -// Connection class. -@include_once("../includes/constantes.php"); +include_once("../includes/constantes.php"); include_once("../includes/comunes.php"); // REST functions. -@include_once("../includes/restfunctions.php"); +include_once("../includes/restfunctions.php"); // Slim framework. include_once("Slim/Slim.php"); \Slim\Slim::registerAutoloader(); // Server access control. $cmd = CreaComando($cnx); -if (!$cmd) - die("Access Error"); +if (!$cmd) { + die("Access Error"); +} -// Install Slim application (development mode). -//$app = new \Slim\Slim(array('mode' => 'production', ... ); -$app = new \Slim\Slim(array( - 'mode' => 'development', - 'log.enabled' => true, - 'log.level' => \Slim\Log::ERROR, - 'debug' => true)); +// Install Slim application. +$app = new \Slim\Slim([ + 'mode' => 'development', // Mode (production or development). + 'log.enabled' => true, // Using logs. + 'log.level' => \Slim\Log::ERROR, // Log level. + 'debug' => true, // Generating debug info. +]); $app->setName('opengnsys'); // Global variables. -$userid = NULL; // User id. with access to REST API. +$userid = NULL; // User id. with access to REST API. -// Common funtions and routes. +// Common functions and routes. include("common.php"); // Check if services are running. @@ -71,4 +71,3 @@ $app->get('/', // Execute REST using Slim. $app->run(); - |