diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c8f342 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +hesabixArchive/ \ No newline at end of file diff --git a/hesabixBackup/databasefiles/index.php b/hesabixBackup/databasefiles/index.php new file mode 100644 index 0000000..a814366 --- /dev/null +++ b/hesabixBackup/databasefiles/index.php @@ -0,0 +1 @@ +addArgument('arg1', InputArgument::OPTIONAL, 'Argument description') + ->addOption('option1', null, InputOption::VALUE_NONE, 'Option description') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + $arg1 = $input->getArgument('arg1'); + + if ($arg1) { + $io->note(sprintf('You passed an argument: %s', $arg1)); + } + + if ($input->getOption('option1')) { + // ... + } + + $io->success('You have a new command! Now make it your own! Pass --help to see your options.'); + + return Command::SUCCESS; + } +} diff --git a/hesabixCore/src/Controller/AdminController.php b/hesabixCore/src/Controller/AdminController.php index f78da2b..f222346 100644 --- a/hesabixCore/src/Controller/AdminController.php +++ b/hesabixCore/src/Controller/AdminController.php @@ -356,4 +356,31 @@ class AdminController extends AbstractController } throw $this->createNotFoundException(); } + + /** + * @throws Exception + */ + #[Route('/test', name: 'app_admin_database_backup_create')] + public function app_admin_database_backup_create(KernelInterface $kernel):JsonResponse + { + $application = new Application($kernel); + $application->setAutoExit(false); + + $input = new ArrayInput([ + 'command' => 'doctrine:schema:create', + // (optional) define the value of command arguments + '--dump-sql' => true, + '../../hesabixBackup/databaseFiles/file.sql'=>true, + + ]); + + // You can use NullOutput() if you don't need the output + $output = new BufferedOutput(); + $application->run($input, $output); + // return the output, don't use if you used NullOutput() + $content = $output->fetch(); + return $this->json([ + 'message' => $content, + ]); + } } diff --git a/hesabixCore/templates/base.html.twig b/hesabixCore/templates/base.html.twig index 8aca6cb..7f934f8 100644 --- a/hesabixCore/templates/base.html.twig +++ b/hesabixCore/templates/base.html.twig @@ -238,7 +238,7 @@ درباره حسابیکس