common.inc.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Loads libraries/common.inc.php and preforms some additional actions
  5. *
  6. * @package PhpMyAdmin-Setup
  7. */
  8. use PhpMyAdmin\Config\ConfigFile;
  9. /**
  10. * Do not include full common.
  11. * @ignore
  12. */
  13. define('PMA_MINIMUM_COMMON', true);
  14. chdir('..');
  15. if (!file_exists('./libraries/common.inc.php')) {
  16. die('Bad invocation!');
  17. }
  18. require_once './libraries/common.inc.php';
  19. require_once './setup/lib/ConfigGenerator.php';
  20. // use default error handler
  21. restore_error_handler();
  22. // Save current language in a cookie, required since we use PMA_MINIMUM_COMMON
  23. $GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']);
  24. $GLOBALS['PMA_Config']->set('is_setup', true);
  25. $GLOBALS['ConfigFile'] = new ConfigFile();
  26. $GLOBALS['ConfigFile']->setPersistKeys(
  27. array(
  28. 'DefaultLang',
  29. 'ServerDefault',
  30. 'UploadDir',
  31. 'SaveDir',
  32. 'Servers/1/verbose',
  33. 'Servers/1/host',
  34. 'Servers/1/port',
  35. 'Servers/1/socket',
  36. 'Servers/1/auth_type',
  37. 'Servers/1/user',
  38. 'Servers/1/password'
  39. )
  40. );
  41. // allows for redirection even after sending some data
  42. ob_start();