Merge lp:~alexharrington/xibo/1.1-config-warning into lp:~dangarner/xibo/translate-xibo

Proposed by Alex Harrington
Status: Merged
Merged at revision: not available
Proposed branch: lp:~alexharrington/xibo/1.1-config-warning
Merge into: lp:~dangarner/xibo/translate-xibo
Diff against target: None lines
To merge this branch: bzr merge lp:~alexharrington/xibo/1.1-config-warning
Reviewer Review Type Date Requested Status
Dan Garner Approve
Review via email: mp+5909@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/config/config.class.php'
2--- server/config/config.class.php 2009-04-26 15:11:53 +0000
3+++ server/config/config.class.php 2009-04-26 19:20:44 +0000
4@@ -24,7 +24,9 @@
5 {
6 private $db;
7 private $extensions;
8+ private $envTested;
9 private $envFault;
10+ private $envWarning;
11
12 public function __construct(database $db)
13 {
14@@ -35,6 +37,8 @@
15
16 // Assume the environment is OK
17 $this->envFault = false;
18+ $this->envWarning = false;
19+ $this->envTested = false;
20
21 return;
22 }
23@@ -116,6 +120,7 @@
24 $output = '';
25 $imgGood = '<img src="install/dot_green.gif"> ';
26 $imgBad = '<img src="install/dot_red.gif"> ';
27+ $imgWarn = '<img src="install/dot_amber.gif"> ';
28
29 $output .= '<div class="checks">';
30
31@@ -124,13 +129,13 @@
32
33 if ($this->CheckPHP())
34 {
35- $output .= $imgGood.' '.$message.'<br />';
36+ $output .= $imgGood.$message.'<br />';
37 }
38 else
39 {
40 $this->envFault = true;
41
42- $output .= $imgBad.' '.$message.'<br />';
43+ $output .= $imgBad.$message.'<br />';
44 $output .= '<div class="check_explain"> <p>' . __("Xibo requires PHP version 5.0.2 or later.") . '</p></div>';
45 }
46
47@@ -139,13 +144,13 @@
48
49 if ($this->CheckFsPermissions())
50 {
51- $output .= $imgGood.' '.$message.'<br />';
52+ $output .= $imgGood.$message.'<br />';
53 }
54 else
55 {
56 $this->envFault = true;
57
58- $output .= $imgBad.' '.$message.'<br />';
59+ $output .= $imgBad.$message.'<br />';
60 $output .= '<div class="check_explain"><p>' . __("Xibo needs to be able to write to the following:");
61 $output .= <<<END
62 <ul>
63@@ -162,13 +167,13 @@
64
65 if ($this->CheckMySQL())
66 {
67- $output .= $imgGood.' '.$message.'<br />';
68+ $output .= $imgGood.$message.'<br />';
69 }
70 else
71 {
72 $this->envFault = true;
73
74- $output .= $imgBad.' '.$message.'<br />';
75+ $output .= $imgBad.$message.'<br />';
76 $output .= '<div class="check_explain"><p>' . __('Xibo requires a MySQL database. Ensure PHP MySQL client extension is installed') . '</p></div>';
77 }
78
79@@ -177,13 +182,13 @@
80
81 if ($this->CheckJson())
82 {
83- $output .= $imgGood.' '.$message.'<br />';
84+ $output .= $imgGood.$message.'<br />';
85 }
86 else
87 {
88 $this->envFault = true;
89
90- $output .= $imgBad.' '.$message.'<br />';
91+ $output .= $imgBad.$message.'<br />';
92 $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP JSON extension to function.') . '</p></div>';
93 }
94
95@@ -192,13 +197,13 @@
96
97 if ($this->CheckGd())
98 {
99- $output .= $imgGood.' '.$message.'<br />';
100+ $output .= $imgGood.$message.'<br />';
101 }
102 else
103 {
104 $this->envFault = true;
105
106- $output .= $imgBad.' '.$message.'<br />';
107+ $output .= $imgBad.$message.'<br />';
108 $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP GD extension to function.') . '</p></div>';
109 }
110
111@@ -208,13 +213,13 @@
112
113 if ($this->CheckCal())
114 {
115- $output .= $imgGood.' '.$message.'<br />';
116+ $output .= $imgGood.$message.'<br />';
117 }
118 else
119 {
120 $this->envFault = true;
121
122- $output .= $imgBad.' '.$message.'<br />';
123+ $output .= $imgBad.$message.'<br />';
124 $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP Calendar extension to function.') . '</p></div>';
125 }
126
127@@ -223,13 +228,13 @@
128
129 if ($this->CheckDom())
130 {
131- $output .= $imgGood.' '.$message.'<br />';
132+ $output .= $imgGood.$message.'<br />';
133 }
134 else
135 {
136 $this->envFault = true;
137
138- $output .= $imgBad.' '.$message.'<br />';
139+ $output .= $imgBad.$message.'<br />';
140 $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP DOM core functionality enabled.') . '</p></div>';
141 }
142
143@@ -238,13 +243,13 @@
144
145 if ($this->CheckDomXml())
146 {
147- $output .= $imgGood.' '.$message.'<br />';
148+ $output .= $imgGood.$message.'<br />';
149 }
150 else
151 {
152 $this->envFault = true;
153
154- $output .= $imgBad.' '.$message.'<br />';
155+ $output .= $imgBad.$message.'<br />';
156 $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP DOM XML extension to function.') . '</p></div>';
157 }
158
159@@ -253,20 +258,20 @@
160
161 if (ini_get('allow_url_fopen'))
162 {
163- $output .= $imgGood.' '.$message.'<br />';
164+ $output .= $imgGood.$message.'<br />';
165 }
166 else
167- {
168- // Not a fault as this will not block installation/upgrade. Informational.
169- $this->envFault = false;
170+ { // Not a fault as this will not block installation/upgrade. Informational.
171+ $this->envWarning = true;
172
173- $output .= $imgBad.' '.$message.'<br />';
174- $output .= '<div class="check_explain"><p>' . __('You must have allow_url_fopen = On in your PHP.ini file for statistics gathering to function.') . '<br />';
175- $output .= __('If you do not intend to enable homecall you need not worry about this problem.') . '</p></div>';
176+ $output .= $imgWarn.$message.'<br />';
177+ $output .= '<div class="check_explain"><p>' . __('You must have allow_url_fopen = On in your PHP.ini file for anonymous statistics gathering to function.') . '<br />';
178+ $output .= __('If you do not intend to enable anonymous statistics gathering you need not worry about this problem.') . '</p></div>';
179 }
180
181 $output .= '</div>';
182
183+ this->envTested = true;
184 return $output;
185 }
186
187@@ -276,10 +281,28 @@
188 */
189 public function EnvironmentFault()
190 {
191+ if (! $this->envTested) {
192+ $this->CheckEnvironment();
193+ }
194+
195 return $this->envFault;
196 }
197
198 /**
199+ * Is there an environment warning
200+ * @return
201+ */
202+ public function EnvironmentWarning()
203+ {
204+ if (! $this->envTested) {
205+ $this->CheckEnvironment();
206+ }
207+
208+ return $this->envWarning;
209+ }
210+
211+
212+ /**
213 * Check FileSystem Permissions
214 * @return
215 */
216
217=== modified file 'server/install.php'
218--- server/install.php 2009-04-26 18:55:10 +0000
219+++ server/install.php 2009-04-26 19:20:44 +0000
220@@ -66,6 +66,18 @@
221 <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>
222 </form>
223 <?php
224+ }
225+ else if ($cObj->EnvironmentWarning()) {
226+ ?>
227+ <form action="install.php" method="POST">
228+ <input type="hidden" name="xibo_step" value="1" />
229+ <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>
230+ </form>
231+ <form action="install.php" method="POST">
232+ <input type="hidden" name="xibo_step" value="2" />
233+ <div class="loginbutton"><button type="submit"><?php echo __("Next"); ?> ></button></div>
234+ </form>
235+ <?php
236 }
237 else {
238 ?>
239@@ -708,4 +720,4 @@
240 function checkPHP() {
241 return (version_compare("5",phpversion(), "<="));
242 }
243-?>
244\ No newline at end of file
245+?>
246
247=== modified file 'server/upgrade.php'
248--- server/upgrade.php 2009-04-26 18:55:10 +0000
249+++ server/upgrade.php 2009-04-26 19:41:58 +0000
250@@ -73,6 +73,12 @@
251 if (! $_SESSION['step']) {
252 $_SESSION['step'] = 0;
253 }
254+
255+if (Kit::GetParam('skipstep',_POST,_INT) == 1) {
256+ // Cheat the $_SESSION['step'] variable if required
257+ // Used if there are environment warnings and we want to retest.
258+ $_SESSION['step'] = 1;
259+}
260
261 if ($_SESSION['step'] == 0) {
262
263@@ -135,6 +141,17 @@
264 <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>
265 </form>
266 <?php
267+ }
268+ else if ($cObj->EnvironmentWarning()) {
269+ ?>
270+ <form action="upgrade.php" method="POST">
271+ <input type="hidden" name="stepskip" value="1">
272+ <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>
273+ </form>
274+ <form action="upgrade.php" method="POST">
275+ <div class="loginbutton"><button type="submit"><?php echo __("Next"); ?> ></button></div>
276+ </form>
277+ <?php
278 }
279 else {
280 ?>

Subscribers

People subscribed via source and target branches

to all changes: