summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-11-18 14:11:43 +0100
committerRamón M. Gómez <ramongomez@us.es>2019-11-18 14:11:43 +0100
commit49ac7971d8fea404d4bdc2e85b3117e650fbe0bc (patch)
tree6bf49261d396c651349c817cc40dc0193b4d4e0a
parent195753cec89d8e26a8f3e4049b2cb58724452740 (diff)
#839: Clearest code and fix typos in `rest/index.php` file.
-rw-r--r--admin/WebConsole/rest/index.php31
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();
-