Revision 3731:3770620079d4,
1.1 KB
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
Simplify licence block at the beginning of each file
|
Line | |
---|
1 | #!/usr/bin/env php |
---|
2 | <?php |
---|
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 | |
---|
13 | if (!defined('DC_RC_PATH')) {return;} |
---|
14 | |
---|
15 | try |
---|
16 | { |
---|
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 | } |
---|
24 | |
---|
25 | if (!is_file($dc_conf)) { |
---|
26 | throw new Exception(sprintf('%s is not a file', $dc_conf)); |
---|
27 | } |
---|
28 | |
---|
29 | $_SERVER['DC_RC_PATH'] = $dc_conf; |
---|
30 | unset($dc_conf); |
---|
31 | |
---|
32 | require dirname(__FILE__) . '/../prepend.php'; |
---|
33 | |
---|
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); |
---|
48 | } |
---|
49 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.