Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Route("/testJson")
- */
- public function testJsonAction() {
- $app = new SymfonyBundleFrameworkBundleConsoleApplication($this->get("kernel"));
- $app->setAutoExit(false);
- $opt = array("command" =>
- "doctrine:generate:entity",
- "--entity" => "GuervylEditorBundle:TestOnline",
- "--fields" => "kl:string");
- $input = new SymfonyComponentConsoleInputArrayInput($opt);
- $out = new SymfonyComponentConsoleOutputBufferedOutput();
- $app->run($input, $out);
- $out->fetch();
- return new JsonResponse(json_encode(["a" => "b", "c" => "d"]));
- }
- public function callCommand($cmd, $opt, &$mykernel = null) {
- if ($mykernel == NULL) {
- $mykernel = new myKernel("dev", false, __DIR__ . "/../Resources/template_2.8/app");
- }
- $app = new SymfonyBundleFrameworkBundleConsoleApplication($mykernel);
- $app->setAutoExit(false);
- $opt = array("command" => $cmd) + $opt;
- $input = new SymfonyComponentConsoleInputArrayInput($opt);
- $out = new SymfonyComponentConsoleOutputBufferedOutput();
- $app->run($input, $out);
- }
- Entity generation
- created ./src/Guervyl/EditorBundle/Entity/TestCase.php
- > Generating entity class src/Guervyl/EditorBundle/Entity/TestCase.php: OK!
- > Generating repository class src/Guervyl/EditorBundle/Repository/TestCaseRepository.php: OK!
- Everything is OK! Now get to work :).
Add Comment
Please, Sign In to add comment