From 7aacdc2bf0d321080ba5d17cee4c84c950b5979e Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 29 Jul 2015 16:13:25 +0300 Subject: [PATCH 1/2] Make the compiler use the new way of getting the user/project ids During the last revision of the compileAction of the website, we decided to send the user & project id as request fields. If these fields exist, the compiler will use them in order to mark the compilation logs with a specific id --- .../Codebender/CompilerBundle/Handler/CompilerHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php index 653c5cd..3841d70 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php @@ -137,6 +137,11 @@ function main($request, $compiler_config) } } + if (isset($request['userId']) && isset($request['projectId'])) { + $user_id = $request['userId']; + $sketch_id = $request['projectId']; + } + $this->logger_id = microtime(true) . "_" . substr($compiler_config['compiler_dir'], -6) . "_user:$user_id" . "_project:$sketch_id"; $this->compiler_logger->addInfo($this->logger_id . " - " . implode(" ", $req_elements)); From 2b2655646e3aba8a1e61d3a2569546986e938b94 Mon Sep 17 00:00:00 2001 From: spiliot Date: Fri, 21 Aug 2015 11:43:02 +0300 Subject: [PATCH 2/2] Broadened the setting logic for user and sketch id Before these two variables would be set only if both of them were passed in the request, now they are independently set. --- .../CompilerBundle/Handler/CompilerHandler.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php index 3841d70..7907186 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/CompilerHandler.php @@ -117,7 +117,6 @@ function main($request, $compiler_config) // Log the names of the project files and the libraries used in it. if ($format != "autocomplete") { - $user_id = $sketch_id = "null"; $req_elements = array("Files: "); foreach ($request["files"] as $file) { @@ -136,9 +135,14 @@ function main($request, $compiler_config) $req_elements[] = $libname . "/" . $libfile["filename"]; } } - - if (isset($request['userId']) && isset($request['projectId'])) { + + $user_id = "null"; + if (isset($request['userId'])) { $user_id = $request['userId']; + } + + $sketch_id = "null"; + if (isset($request['projectId'])) { $sketch_id = $request['projectId']; }