cli.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Used for external support of chamilo's users.
  5. *
  6. * @author Arnaud Ligot, CBlue SPRL
  7. *
  8. * @package chamilo.admin.cli
  9. */
  10. // we are in the admin area so we do not need a course id
  11. $cidReset = true;
  12. // include global script
  13. require_once __DIR__.'/../inc/global.inc.php';
  14. $this_section = SECTION_PLATFORM_ADMIN;
  15. // make sure only logged-in admins can execute this
  16. api_protect_admin_script();
  17. // setting the name of the tool
  18. $tool_name = get_lang('CommandLineInterpreter');
  19. // setting breadcrumbs
  20. $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
  21. // including the header file (which includes the banner itself)
  22. Display :: display_header($tool_name);
  23. switch ($_GET["cmd"]) {
  24. case "clear_stapi":
  25. echo "Are you sure you are willing to erase all storage api data (no backup)? <a href='cli.php?cmd=clear_stapi_confirm' >Yes</a>";
  26. break;
  27. case "clear_stapi_confirm":
  28. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES));
  29. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
  30. echo "Done";
  31. break;
  32. default:
  33. echo "UNKNOWN COMMAND";
  34. break;
  35. }
  36. Display :: display_footer();