You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

updatedb.sh 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. +-----------------------------------------------------------------------+
  5. | bin/updatedb.sh |
  6. | |
  7. | This file is part of the Roundcube Webmail client |
  8. | Copyright (C) 2010-2012, The Roundcube Dev Team |
  9. | Copyright (C) 2010-2012, Kolab Systems AG |
  10. | |
  11. | Licensed under the GNU General Public License version 3 or |
  12. | any later version with exceptions for skins & plugins. |
  13. | See the README file for a full license statement. |
  14. | |
  15. | PURPOSE: |
  16. | Update database schema |
  17. +-----------------------------------------------------------------------+
  18. | Author: Aleksander Machniak <alec@alec.pl> |
  19. +-----------------------------------------------------------------------+
  20. */
  21. define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
  22. require_once INSTALL_PATH . 'program/include/clisetup.php';
  23. // get arguments
  24. $opts = rcube_utils::get_opt(array(
  25. 'v' => 'version',
  26. 'd' => 'dir',
  27. 'p' => 'package',
  28. ));
  29. if (empty($opts['dir'])) {
  30. rcube::raise_error("Database schema directory not specified (--dir).", false, true);
  31. }
  32. if (empty($opts['package'])) {
  33. rcube::raise_error("Database schema package name not specified (--package).", false, true);
  34. }
  35. rcmail_utils::db_update($opts['dir'], $opts['package'], $opts['version'], array('errors' => true));
  36. ?>