From 8d827fcca67f91feb9c3a37ff48f268308b0ccda Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Wed, 10 Jun 2015 18:15:49 +0300 Subject: [PATCH 1/2] update coveralls badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bd0a04..436975a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ This repository is part of the [codebender.cc](http://www.codebender.cc) maker and artist web platform. -[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler) [![Coverage Status](https://img.shields.io/coveralls/codebendercc/compiler.svg)](https://coveralls.io/r/codebendercc/compiler?branch=master) +[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler) +[![Coverage Status](https://coveralls.io/repos/codebendercc/compiler/badge.svg?branch=master)](https://coveralls.io/r/codebendercc/compiler?branch=master) ## And what's that? From 1eb193eb82219d8575d935c130a02477459b6365 Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Wed, 10 Jun 2015 18:48:37 +0300 Subject: [PATCH 2/2] rename auth_key to authorizationKey --- Symfony/app/config/parameters.yml.dist | 2 +- .../DemoBundle/Resources/config/routing.yml | 2 +- .../Controller/DefaultController.php | 18 +++++++------- .../CompilerBundle/Handler/MCUHandler.php | 2 +- .../Handler/PostprocessingHandler.php | 2 +- .../Handler/PreprocessingHandler.php | 2 +- .../CompilerBundle/Handler/UtilityHandler.php | 2 +- .../Resources/config/routing.yml | 10 ++++---- .../Resources/config/services.yml | 2 +- .../Controller/DefaultControllerTest.php | 24 +++++++++---------- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Symfony/app/config/parameters.yml.dist b/Symfony/app/config/parameters.yml.dist index 6ef4ec7..1fc7268 100644 --- a/Symfony/app/config/parameters.yml.dist +++ b/Symfony/app/config/parameters.yml.dist @@ -18,7 +18,7 @@ parameters: arduino_cores_dir: "/opt/codebender/codebender-arduino-core-files" external_core_files: "/opt/codebender/external-core-files" - auth_key: "youMustChangeThis" + authorizationKey: "youMustChangeThis" # Paths to various executables used by the compiler. These depend on the # distribution used and the method of installation. Linking is performed by diff --git a/Symfony/src/Acme/DemoBundle/Resources/config/routing.yml b/Symfony/src/Acme/DemoBundle/Resources/config/routing.yml index 3402ca1..f95dc84 100644 --- a/Symfony/src/Acme/DemoBundle/Resources/config/routing.yml +++ b/Symfony/src/Acme/DemoBundle/Resources/config/routing.yml @@ -9,4 +9,4 @@ _demo_secured: _demo: resource: "@AcmeDemoBundle/Controller/DemoController.php" type: annotation - prefix: /demo \ No newline at end of file + prefix: /demo diff --git a/Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php b/Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php index ab79309..15b7f3f 100644 --- a/Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php +++ b/Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php @@ -23,11 +23,11 @@ public function statusAction() return new Response(json_encode(array("success" => true, "status" => "OK"))); } - public function testAction($auth_key) + public function testAction($authorizationKey) { $params = $this->generateParameters(); - if ($auth_key !== $params["auth_key"]) + if ($authorizationKey !== $params["authorizationKey"]) { return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key."))); } @@ -43,11 +43,11 @@ public function testAction($auth_key) return new Response(json_encode(array("success" => (bool) !$return_val, "message" => implode("\n", $output)))); } - public function indexAction($auth_key, $version) + public function indexAction($authorizationKey, $version) { $params = $this->generateParameters(); - if ($auth_key !== $params["auth_key"]) + if ($authorizationKey !== $params["authorizationKey"]) { return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key."))); } @@ -69,9 +69,9 @@ public function indexAction($auth_key, $version) } } - public function deleteAllObjectsAction($auth_key, $version) + public function deleteAllObjectsAction($authorizationKey, $version) { - if ($this->container->getParameter('auth_key') != $auth_key) + if ($this->container->getParameter('authorizationKey') != $authorizationKey) return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key."))); if ($version != "v1") @@ -122,9 +122,9 @@ public function deleteAllObjectsAction($auth_key, $version) array("Files not deleted" => $undeletedFiles)))); } - public function deleteSpecificObjectsAction($auth_key, $version, $option, $to_delete) + public function deleteSpecificObjectsAction($authorizationKey, $version, $option, $to_delete) { - if ($this->container->getParameter('auth_key') != $auth_key) + if ($this->container->getParameter('authorizationKey') != $authorizationKey) return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key."))); if ($version != "v1") @@ -188,7 +188,7 @@ public function deleteSpecificObjectsAction($auth_key, $version, $option, $to_de */ private function generateParameters() { - $parameters = array("binutils", "python", "clang", "logdir", "temp_dir", "archive_dir", "autocompletion_dir", "autocompleter", "cflags", "cppflags", "asflags", "arflags", "ldflags", "ldflags_tail", "clang_flags", "objcopy_flags", "size_flags", "output", "arduino_cores_dir", "external_core_files", "auth_key"); + $parameters = array("binutils", "python", "clang", "logdir", "temp_dir", "archive_dir", "autocompletion_dir", "autocompleter", "cflags", "cppflags", "asflags", "arflags", "ldflags", "ldflags_tail", "clang_flags", "objcopy_flags", "size_flags", "output", "arduino_cores_dir", "external_core_files", "authorizationKey"); $compiler_config = array(); diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/MCUHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/MCUHandler.php index 297918f..e3b542a 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/MCUHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/MCUHandler.php @@ -206,4 +206,4 @@ class MCUHandler "attiny20" => "__AVR_ATtiny20__", "attiny40" => "__AVR_ATtiny40__"); -} \ No newline at end of file +} diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/PostprocessingHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/PostprocessingHandler.php index b64ab45..ca83a86 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/PostprocessingHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/PostprocessingHandler.php @@ -120,4 +120,4 @@ function ansi_to_html($text) return $text; } -} \ No newline at end of file +} diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/PreprocessingHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/PreprocessingHandler.php index 720c2dd..a7d327d 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/PreprocessingHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/PreprocessingHandler.php @@ -293,4 +293,4 @@ function validate_input($request) // Request is valid. return $request; } -} \ No newline at end of file +} diff --git a/Symfony/src/Codebender/CompilerBundle/Handler/UtilityHandler.php b/Symfony/src/Codebender/CompilerBundle/Handler/UtilityHandler.php index b539f31..3e6c0db 100644 --- a/Symfony/src/Codebender/CompilerBundle/Handler/UtilityHandler.php +++ b/Symfony/src/Codebender/CompilerBundle/Handler/UtilityHandler.php @@ -142,4 +142,4 @@ function debug_exec($command, /** @noinspection PhpUnusedParameterInspection */ echo "$ $command\n"; passthru("$command 2>&1"); } -} \ No newline at end of file +} diff --git a/Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml b/Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml index 2249623..e4ae4bd 100644 --- a/Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml +++ b/Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml @@ -3,19 +3,19 @@ codebender_compiler_status_check: defaults: { _controller: CodebenderCompilerBundle:Default:status } codebender_compiler_test: - pattern: /{auth_key}/test/ + pattern: /{authorizationKey}/test/ defaults: { _controller: CodebenderCompilerBundle:Default:test } codebender_compiler_homepage: - pattern: /{auth_key}/{version} + pattern: /{authorizationKey}/{version} defaults: { _controller: CodebenderCompilerBundle:Default:index } codebender_compiler_delete_all: - pattern: /{auth_key}/{version}/delete/all/ + pattern: /{authorizationKey}/{version}/delete/all/ defaults: { _controller: CodebenderCompilerBundle:Default:deleteAllObjects } codebender_compiler_delete_specific: - pattern: /{auth_key}/{version}/delete/{option}/{to_delete} + pattern: /{authorizationKey}/{version}/delete/{option}/{to_delete} defaults: { _controller: CodebenderCompilerBundle:Default:deleteSpecificObjects } @@ -25,4 +25,4 @@ root: defaults: _controller: FrameworkBundle:Redirect:urlRedirect path: /status - permanent: true \ No newline at end of file + permanent: true diff --git a/Symfony/src/Codebender/CompilerBundle/Resources/config/services.yml b/Symfony/src/Codebender/CompilerBundle/Resources/config/services.yml index 94a63ba..a529420 100644 --- a/Symfony/src/Codebender/CompilerBundle/Resources/config/services.yml +++ b/Symfony/src/Codebender/CompilerBundle/Resources/config/services.yml @@ -25,4 +25,4 @@ services: - [pushHandler, [@compiler_log_handler]] compiler_log_handler: class: Monolog\Handler\StreamHandler - arguments: [%kernel.logs_dir%/compiler.log] \ No newline at end of file + arguments: [%kernel.logs_dir%/compiler.log] diff --git a/Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerTest.php b/Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerTest.php index bd8fef8..2057e10 100644 --- a/Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerTest.php +++ b/Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerTest.php @@ -30,9 +30,9 @@ public function testInvalidAPI() { $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('GET', '/'.$auth_key.'/v666'); + $client->request('GET', '/'.$authorizationKey.'/v666'); $this->assertEquals($client->getResponse()->getContent(), '{"success":false,"step":0,"message":"Invalid API version."}'); @@ -42,9 +42,9 @@ public function testInvalidInput() { $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('GET', '/'.$auth_key.'/v1'); + $client->request('GET', '/'.$authorizationKey.'/v1'); $this->assertEquals($client->getResponse()->getContent(), '{"success":false,"step":0,"message":"Invalid input."}'); @@ -62,9 +62,9 @@ public function testBlinkUnoSyntaxCheck() $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('POST', '/'.$auth_key.'/v1', array(),array(),array(),$data); + $client->request('POST', '/'.$authorizationKey.'/v1', array(),array(),array(),$data); $response = json_decode($client->getResponse()->getContent(), true); @@ -85,9 +85,9 @@ public function testBlinkUnoCompile() $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data); + $client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data); $response = json_decode($client->getResponse()->getContent(), true); @@ -110,9 +110,9 @@ public function testBlinkUnoSyntaxCheckError() $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data); + $client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data); $response = json_decode($client->getResponse()->getContent(), true); @@ -138,9 +138,9 @@ public function testBlinkUnoCompileError() $client = static::createClient(); - $auth_key = $client->getContainer()->getParameter("auth_key"); + $authorizationKey = $client->getContainer()->getParameter("authorizationKey"); - $client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data); + $client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data); $response = json_decode($client->getResponse()->getContent(), true);