Revision 3731:3770620079d4,
1.1 KB
checked in by franck <carnet.franck.paul@…>, 8 years ago
(diff) |
Simplify licence block at the beginning of each file
|
Rev | Line | |
---|
[0] | 1 | #!/usr/bin/env php |
---|
| 2 | <?php |
---|
[3731] | 3 | /** |
---|
| 4 | * @brief Dotclear upgrade procedure (CLI) |
---|
| 5 | * |
---|
| 6 | * @package Dotclear |
---|
| 7 | * @subpackage Core |
---|
| 8 | * |
---|
| 9 | * @copyright Olivier Meunier & Association Dotclear |
---|
| 10 | * @copyright GPL-2.0-only |
---|
| 11 | */ |
---|
| 12 | |
---|
[3730] | 13 | if (!defined('DC_RC_PATH')) {return;} |
---|
[0] | 14 | |
---|
| 15 | try |
---|
| 16 | { |
---|
[3730] | 17 | if (isset($_SERVER['argv'][1])) { |
---|
| 18 | $dc_conf = $_SERVER['argv'][1]; |
---|
| 19 | } elseif (isset($_SERVER['DC_RC_PATH'])) { |
---|
| 20 | $dc_conf = realpath($_SERVER['DC_RC_PATH']); |
---|
| 21 | } else { |
---|
| 22 | $dc_conf = dirname(__FILE__) . '/../config.php'; |
---|
| 23 | } |
---|
[2566] | 24 | |
---|
[3730] | 25 | if (!is_file($dc_conf)) { |
---|
| 26 | throw new Exception(sprintf('%s is not a file', $dc_conf)); |
---|
| 27 | } |
---|
[2566] | 28 | |
---|
[3730] | 29 | $_SERVER['DC_RC_PATH'] = $dc_conf; |
---|
| 30 | unset($dc_conf); |
---|
[2566] | 31 | |
---|
[3730] | 32 | require dirname(__FILE__) . '/../prepend.php'; |
---|
[2566] | 33 | |
---|
[3730] | 34 | echo "Starting upgrade process\n"; |
---|
| 35 | $core->con->begin(); |
---|
| 36 | try { |
---|
| 37 | $changes = dcUpgrade::dotclearUpgrade($core); |
---|
| 38 | } catch (Exception $e) { |
---|
| 39 | $core->con->rollback(); |
---|
| 40 | throw $e; |
---|
| 41 | } |
---|
| 42 | $core->con->commit(); |
---|
| 43 | echo 'Upgrade process successfully completed (' . $changes . "). \n"; |
---|
| 44 | exit(0); |
---|
| 45 | } catch (Exception $e) { |
---|
| 46 | echo $e->getMessage() . "\n"; |
---|
| 47 | exit(1); |
---|
[0] | 48 | } |
---|
[2566] | 49 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.