diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 8a424a3c7..7f086d81a 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -224,6 +224,8 @@ class WebApplication */ public function dispatchApiRequest($uri, $version = "1.0", $multipart = false, $inputExecute = '') { + $startingTime = microtime(true); + $uri = $this->initRest($uri, "1.0", $multipart); // to handle a request with "OPTIONS" method @@ -242,12 +244,20 @@ class WebApplication * that automatically is sent by a client using XmlHttpRequest or similar. */ header('Access-Control-Allow-Origin: *'); - $_SERVER['REQUEST_URI'] = $uri; $this->rest->inputExecute = $inputExecute; $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) { return $this->rest->responseMultipart; } diff --git a/rbac/engine/config/paths.php b/rbac/engine/config/paths.php index db7867be6..861ac748f 100644 --- a/rbac/engine/config/paths.php +++ b/rbac/engine/config/paths.php @@ -59,7 +59,7 @@ define( 'PATH_LANGUAGECONT',PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP ); define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" ); 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 ); // the Compiled Directories diff --git a/rbac/public_html/sysGeneric.php b/rbac/public_html/sysGeneric.php index 64e3d73ad..b4d56e0e3 100644 --- a/rbac/public_html/sysGeneric.php +++ b/rbac/public_html/sysGeneric.php @@ -28,7 +28,7 @@ define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . 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_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 ); ini_set('display_errors','On'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 282ff0b3d..3d38cd2e5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -20,7 +20,7 @@ define('PATH_TRUNK', dirname(__DIR__) . '/'); define('PATH_CORE', PATH_TRUNK . 'workflow/engine/'); define('PATH_CONFIG', PATH_CORE . 'config/'); 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_DB', PATH_DATA . 'sites/'); diff --git a/workflow/engine/src/phpunit.xml b/workflow/engine/src/phpunit.xml index 3f96d7e9b..04ddb3969 100644 --- a/workflow/engine/src/phpunit.xml +++ b/workflow/engine/src/phpunit.xml @@ -16,17 +16,6 @@ - - diff --git a/workflow/public_html/fonts/styles.php b/workflow/public_html/fonts/styles.php index a595b393e..f8ef8d52e 100644 --- a/workflow/public_html/fonts/styles.php +++ b/workflow/public_html/fonts/styles.php @@ -7,7 +7,12 @@ array_pop($sections); $pathHome = implode('/', $sections) . '/'; // 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) $fileName = 'fonts.css'; diff --git a/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js b/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js index c64fa4e77..ea62c788e 100644 --- a/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js +++ b/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js @@ -99564,8 +99564,8 @@ LANG = (typeof SYS_LANG !== "undefined") ? SYS_LANG : enviromentVariables('LANG' WORKSPACE = (typeof SYS_SYS !== "undefined") ? SYS_SYS : enviromentVariables('WORKSPACE'); SKIN = (typeof SYS_SKIN !== "undefined") ? SYS_SKIN : enviromentVariables('SKIN'); -DEFAULT_WINDOW_WIDTH = 1093; -DEFAULT_WINDOW_HEIGHT = 520; +DEFAULT_WINDOW_WIDTH = 1193; +DEFAULT_WINDOW_HEIGHT = 570; ENABLED_FEATURES = []; if (LANG != 'en') {