]> git.pld-linux.org Git - packages/eventum.git/blob - upgrade-2.0.patch
- memory limit patches merged
[packages/eventum.git] / upgrade-2.0.patch
1 --- /dev/null   2006-03-28 14:00:37.387408000 +0300
2 +++ eventum-20060717/misc/upgrade/v1.7.1_to_v2.0/index.html     2006-07-18 00:54:31.875309544 +0300
3 @@ -0,0 +1,15 @@
4 +<html>
5 +<head>
6 +<title>Eventum - Upgrade to 2.0 from 1.7.1</title>
7 +</head>
8 +<body>
9 +Please take the following steps to upgrade to Eventum 2.0 from 1.7.1.<br />
10 +
11 +<a href="database_changes.php">Perform database changes</a>.<br />
12 +
13 +<a href="upgrade_config.php">Upgrade the configuration file</a>.<br />
14 +
15 +<a href="../flush_compiled_templates.php">Flush compiled templates</a>.<br />
16 +
17 +</body>
18 +</html>
19 --- /dev/null   2006-03-28 14:00:37.387408000 +0300
20 +++ eventum-20060717/misc/upgrade/v1.7.1_to_v2.0/upgrade_config.php     2006-07-18 00:52:13.012203723 +0300
21 @@ -0,0 +1,50 @@
22 +<?php
23 +// upgrade the config.inc.php file
24 +
25 +include_once("../../../config.inc.php");
26 +
27 +// make backup copy
28 +$backup_file = APP_PATH . "config.inc.pre_2_0.php";
29 +if (copy(APP_PATH . "config.inc.php", $backup_file) == false) {
30 +    echo "Unable to create backup copy of config.inc.php. Please check your base directory is writeable and try again.";
31 +    exit(1);
32 +}
33 +
34 +$config_contents = implode("", file(APP_PATH . "setup/config.inc.php"));
35 +$config_backup = $config_contents;
36 +$config_contents = str_replace("%{APP_PATH}%", APP_PATH, $config_contents);
37 +$config_contents = str_replace("%{APP_SQL_DBHOST}%", APP_SQL_DBHOST, $config_contents);
38 +$config_contents = str_replace("%{APP_SQL_DBNAME}%", APP_SQL_DBNAME, $config_contents);
39 +$config_contents = str_replace("%{APP_SQL_DBUSER}%", APP_SQL_DBUSER, $config_contents);
40 +$config_contents = str_replace("%{APP_SQL_DBPASS}%", APP_SQL_DBPASS, $config_contents);
41 +$config_contents = str_replace("%{APP_TABLE_PREFIX}%", APP_TABLE_PREFIX, $config_contents);
42 +$config_contents = str_replace("%{APP_HOSTNAME}%", APP_HOSTNAME, $config_contents);
43 +$config_contents = str_replace("%{APP_RELATIVE_URL}%", APP_RELATIVE_URL, $config_contents);
44 +if (APP_ENABLE_FULLTEXT == true) {
45 +    $fulltext = 'true';
46 +} else {
47 +    $fulltext = 'false';
48 +}
49 +$config_contents = str_replace("'%{APP_ENABLE_FULLTEXT}%'", $fulltext, $config_contents);
50 +$config_contents = str_replace("%{APP_VERSION}%", "2.0", $config_contents);
51 +if (stristr(APP_BASE_URL, 'https://') !== false) {
52 +    $protocol_type = 'https://';
53 +} else {
54 +    $protocol_type = 'http://';
55 +}
56 +
57 +$config_contents = str_replace("%{PROTOCOL_TYPE}%", $protocol_type, $config_contents);
58 +$fp = fopen(APP_PATH . 'config.inc.php', 'w');
59 +if ($fp === FALSE) {
60 +    echo "Could not open the file 'config.inc.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again.";
61 +    exit(1);
62 +}
63 +$res = fwrite($fp, $config_contents);
64 +if ($fp === FALSE) {
65 +    echo "Could not write the configuration information to 'config.inc.php'. The file should be writable by the user that the web server runs as. Please correct this problem and try again.";
66 +    exit(1);
67 +}
68 +fclose($fp);
69 +?>
70 +Done. Your configuration file (config.inc.php) has been upgraded to version 2.0.<br />
71 +A backup copy has been made in the file <i>'<?php echo $backup_file; ?>'</i>.
72 --- /dev/null   2006-03-28 14:00:37.387408000 +0300
73 +++ eventum-20060717/misc/upgrade/v1.7.1_to_v2.0/database_changes.php   2006-07-18 00:50:46.760275066 +0300
74 @@ -0,0 +1,19 @@
75 +<?php
76 +include_once("../../../config.inc.php");
77 +include_once(APP_INC_PATH . "db_access.php");
78 +
79 +$stmts = array();
80 +
81 +$stmts[] = "ALTER TABLE eventum_support_email CHANGE COLUMN sup_to sup_to tinytext;";
82 +$stmts[] = "ALTER TABLE eventum_support_email CHANGE COLUMN sup_cc sup_cc tinytext;";
83 +
84 +foreach ($stmts as $stmt) {
85 +    $stmt = str_replace('eventum_', APP_TABLE_PREFIX, $stmt);
86 +    $res = $GLOBALS["db_api"]->dbh->query($stmt);
87 +    if (PEAR::isError($res)) {
88 +        echo "<pre>";var_dump($res);echo "</pre>";
89 +        exit(1);
90 +    }
91 +}
92 +?>
93 +done
This page took 0.064132 seconds and 3 git commands to generate.