Skip to content

Commit 645a37e

Browse files
committed
Added version parameter to the compiler Action that deletes all object files.
1 parent 068a85f commit 645a37e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ public function indexAction($auth_key, $version)
6969
}
7070
}
7171

72-
public function deleteAllObjectsAction($auth_key)
72+
public function deleteAllObjectsAction($auth_key, $version)
7373
{
7474
if ($this->container->getParameter('auth_key') != $auth_key)
7575
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key.")));
7676

77+
if ($version != "v1")
78+
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid API version.")));
79+
7780
$tempDir = $this->container->getParameter('temp_dir');
7881
$objectFilesDir = $this->container->getParameter('objdir');
7982
$fileCount = 0;

Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ codebender_compiler_homepage:
1111
defaults: { _controller: CodebenderCompilerBundle:Default:index }
1212

1313
codebender_compiler_deleteAll:
14-
pattern: /{auth_key}/delete/all/
14+
pattern: /{auth_key}/{version}/delete/all/
1515
defaults: { _controller: CodebenderCompilerBundle:Default:deleteAllObjects }

0 commit comments

Comments
 (0)