enablig api logging
This commit is contained in:
@@ -224,6 +224,8 @@ class WebApplication
|
|||||||
*/
|
*/
|
||||||
public function dispatchApiRequest($uri, $version = "1.0", $multipart = false, $inputExecute = '')
|
public function dispatchApiRequest($uri, $version = "1.0", $multipart = false, $inputExecute = '')
|
||||||
{
|
{
|
||||||
|
$startingTime = microtime(true);
|
||||||
|
|
||||||
$uri = $this->initRest($uri, "1.0", $multipart);
|
$uri = $this->initRest($uri, "1.0", $multipart);
|
||||||
|
|
||||||
// to handle a request with "OPTIONS" method
|
// to handle a request with "OPTIONS" method
|
||||||
@@ -242,12 +244,20 @@ class WebApplication
|
|||||||
* that automatically is sent by a client using XmlHttpRequest or similar.
|
* that automatically is sent by a client using XmlHttpRequest or similar.
|
||||||
*/
|
*/
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
|
||||||
$_SERVER['REQUEST_URI'] = $uri;
|
$_SERVER['REQUEST_URI'] = $uri;
|
||||||
|
|
||||||
$this->rest->inputExecute = $inputExecute;
|
$this->rest->inputExecute = $inputExecute;
|
||||||
$this->rest->handle();
|
$this->rest->handle();
|
||||||
|
|
||||||
|
$serverAddr = $_SERVER ['SERVER_ADDR'];
|
||||||
|
$endTime = microtime(true);
|
||||||
|
$time = $endTime - $startingTime;
|
||||||
|
|
||||||
|
Bootstrap::verifyPath(PATH_DATA . 'logs', true);
|
||||||
|
$fpt = fopen(PATH_DATA . 'logs/api.log', 'a');
|
||||||
|
fwrite($fpt, sprintf("%s %7.6f %-15s %-4s %s\n", date('Y-m-d H:i:s'), $time, getenv('REMOTE_ADDR'), $_SERVER ['REQUEST_METHOD'], $_SERVER ['REQUEST_URI']));
|
||||||
|
fclose($fpt);
|
||||||
|
|
||||||
if ($this->rest->flagMultipart === true) {
|
if ($this->rest->flagMultipart === true) {
|
||||||
return $this->rest->responseMultipart;
|
return $this->rest->responseMultipart;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
define( 'PATH_LANGUAGECONT',PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP );
|
define( 'PATH_LANGUAGECONT',PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP );
|
||||||
define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" );
|
define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" );
|
||||||
define( 'PATH_UPLOAD', PATH_HTML . 'files' . PATH_SEP);
|
define( 'PATH_UPLOAD', PATH_HTML . 'files' . PATH_SEP);
|
||||||
define( 'PATH_DATA', '/shared/workflow_data' . PATH_SEP);
|
define( 'PATH_DATA', '/shared/workflow_data' . PATH_SEP); //todo: review why is hardcoded to shared
|
||||||
define( 'PATH_DB' , PATH_DATA . 'sites' . PATH_SEP );
|
define( 'PATH_DB' , PATH_DATA . 'sites' . PATH_SEP );
|
||||||
|
|
||||||
// the Compiled Directories
|
// the Compiled Directories
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . PATH_SEP );
|
define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . PATH_SEP );
|
||||||
define( 'PATH_THIRDPARTY', $pathTrunk . 'thirdparty' . PATH_SEP );
|
define( 'PATH_THIRDPARTY', $pathTrunk . 'thirdparty' . PATH_SEP );
|
||||||
define( 'PATH_RBAC', PATH_RBAC_HOME . 'engine/classes' . PATH_SEP ); //to enable rbac version 2
|
define( 'PATH_RBAC', PATH_RBAC_HOME . 'engine/classes' . PATH_SEP ); //to enable rbac version 2
|
||||||
define( 'PATH_DATA', '/shared/rbac/');
|
define( 'PATH_DATA', '/shared/rbac/'); //Todo: change this path to use environment variable
|
||||||
define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP );
|
define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP );
|
||||||
|
|
||||||
ini_set('display_errors','On');
|
ini_set('display_errors','On');
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ define('PATH_TRUNK', dirname(__DIR__) . '/');
|
|||||||
define('PATH_CORE', PATH_TRUNK . 'workflow/engine/');
|
define('PATH_CORE', PATH_TRUNK . 'workflow/engine/');
|
||||||
define('PATH_CONFIG', PATH_CORE . 'config/');
|
define('PATH_CONFIG', PATH_CORE . 'config/');
|
||||||
if (!defined("PATH_DATA")) {
|
if (!defined("PATH_DATA")) {
|
||||||
define('PATH_DATA', dirname(__DIR__) . '/shared/');
|
define('PATH_DATA', dirname(__DIR__) . '/shared/'); //todo: where PATH DATA is not defined?
|
||||||
}
|
}
|
||||||
define('PATH_RBAC_CORE', dirname(__DIR__) . '/rbac/engine/');
|
define('PATH_RBAC_CORE', dirname(__DIR__) . '/rbac/engine/');
|
||||||
define('PATH_DB', PATH_DATA . 'sites/');
|
define('PATH_DB', PATH_DATA . 'sites/');
|
||||||
|
|||||||
@@ -16,17 +16,6 @@
|
|||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
<!--<filter>
|
|
||||||
<whitelist>
|
|
||||||
<directory>./</directory>
|
|
||||||
<exclude>
|
|
||||||
<directory>./gulliver</directory>
|
|
||||||
<directory>./workflow</directory>
|
|
||||||
<directory>./rbac</directory>
|
|
||||||
</exclude>
|
|
||||||
</whitelist>
|
|
||||||
</filter> -->
|
|
||||||
|
|
||||||
<php>
|
<php>
|
||||||
<var name="SYS_SYS" value="workflow" />
|
<var name="SYS_SYS" value="workflow" />
|
||||||
</php>
|
</php>
|
||||||
|
|||||||
@@ -7,7 +7,12 @@ array_pop($sections);
|
|||||||
$pathHome = implode('/', $sections) . '/';
|
$pathHome = implode('/', $sections) . '/';
|
||||||
|
|
||||||
// Include the "paths_installed.php" file
|
// Include the "paths_installed.php" file
|
||||||
require_once $pathHome . 'engine/config/paths_installed.php';
|
$documentRoot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
|
||||||
|
$pathParts = explode('/', $documentRoot);
|
||||||
|
array_pop($pathParts); // Remove the last part (usually the project folder)
|
||||||
|
$pathTrunk = implode('/', array_slice($pathParts, 0, -1)) . '/'; // Remove last part again
|
||||||
|
define('PATH_DATA', isset($_SERVER['PATH_DATA']) ? $_SERVER['PATH_DATA'] : $pathTrunk . 'shared' . '/' );
|
||||||
|
require_once PATH_DATA . '/config/paths_installed.php';
|
||||||
|
|
||||||
// Set the fonts styles file, for now the value is fixed (Maybe later we have another PDF engine)
|
// Set the fonts styles file, for now the value is fixed (Maybe later we have another PDF engine)
|
||||||
$fileName = 'fonts.css';
|
$fileName = 'fonts.css';
|
||||||
|
|||||||
@@ -99564,8 +99564,8 @@ LANG = (typeof SYS_LANG !== "undefined") ? SYS_LANG : enviromentVariables('LANG'
|
|||||||
WORKSPACE = (typeof SYS_SYS !== "undefined") ? SYS_SYS : enviromentVariables('WORKSPACE');
|
WORKSPACE = (typeof SYS_SYS !== "undefined") ? SYS_SYS : enviromentVariables('WORKSPACE');
|
||||||
SKIN = (typeof SYS_SKIN !== "undefined") ? SYS_SKIN : enviromentVariables('SKIN');
|
SKIN = (typeof SYS_SKIN !== "undefined") ? SYS_SKIN : enviromentVariables('SKIN');
|
||||||
|
|
||||||
DEFAULT_WINDOW_WIDTH = 1093;
|
DEFAULT_WINDOW_WIDTH = 1193;
|
||||||
DEFAULT_WINDOW_HEIGHT = 520;
|
DEFAULT_WINDOW_HEIGHT = 570;
|
||||||
ENABLED_FEATURES = [];
|
ENABLED_FEATURES = [];
|
||||||
|
|
||||||
if (LANG != 'en') {
|
if (LANG != 'en') {
|
||||||
|
|||||||
Reference in New Issue
Block a user