aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--install/index.php36
-rw-r--r--wallabag_compatibility_test.php20
2 files changed, 22 insertions, 34 deletions
diff --git a/install/index.php b/install/index.php
index b21cec52..599bbe2b 100644
--- a/install/index.php
+++ b/install/index.php
@@ -1,7 +1,7 @@
1<?php 1<?php
2$errors = array(); 2$errors = array();
3$successes = array(); 3$successes = array();
4if ($_POST['download']) { 4if (isset($_POST['download'])) {
5 if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) { 5 if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) {
6 $errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually<∕a> and unzip it in your wallabag folder.'; 6 $errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually<∕a> and unzip it in your wallabag folder.';
7 } 7 }
@@ -25,7 +25,7 @@ if ($_POST['download']) {
25 } 25 }
26 } 26 }
27} 27}
28else if ($_POST['install']) { 28else if (isset($_POST['install'])) {
29 if (!is_dir('vendor')) { 29 if (!is_dir('vendor')) {
30 $errors[] = 'You must install twig before.'; 30 $errors[] = 'You must install twig before.';
31 } 31 }
@@ -68,6 +68,7 @@ else if ($_POST['install']) {
68 } 68 }
69 else { 69 else {
70 $content = file_get_contents('inc/poche/config.inc.php'); 70 $content = file_get_contents('inc/poche/config.inc.php');
71 $sql_structure = '';
71 72
72 if ($_POST['db_engine'] == 'mysql') { 73 if ($_POST['db_engine'] == 'mysql') {
73 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database']; 74 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'];
@@ -225,11 +226,7 @@ php composer.phar install</code></pre></li>
225 <p> 226 <p>
226 Database engine: 227 Database engine:
227 <ul> 228 <ul>
228 <li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" /> 229 <li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" /></li>
229 <div id="pdo_sqlite" class='messages error install'>
230 <p>You have to enable <a href="http://php.net/manual/ref.pdo-sqlite.php">pdo_sqlite extension</a>.</p>
231 </div>
232 </li>
233 <li> 230 <li>
234 <label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" /> 231 <label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
235 <ul id="mysql_infos"> 232 <ul id="mysql_infos">
@@ -267,49 +264,26 @@ php composer.phar install</code></pre></li>
267 </p> 264 </p>
268 </fieldset> 265 </fieldset>
269 266
270 <input type="submit" id="install_button" value="Install wallabag" name="install" /> 267 <input type="submit" value="Install wallabag" name="install" />
271 </form> 268 </form>
272 </div> 269 </div>
273 <script> 270 <script>
274 $("#mysql_infos").hide(); 271 $("#mysql_infos").hide();
275 $("#pg_infos").hide(); 272 $("#pg_infos").hide();
276
277 <?php
278 if (!extension_loaded('pdo_sqlite')) : ?>
279 $("#install_button").hide();
280 <?php
281 else :
282 ?>
283 $("#pdo_sqlite").hide();
284 <?php
285 endif;
286 ?>
287
288 $("input[name=db_engine]").click(function() 273 $("input[name=db_engine]").click(function()
289 { 274 {
290 if ( $("#mysql").prop('checked')) { 275 if ( $("#mysql").prop('checked')) {
291 $("#mysql_infos").show(); 276 $("#mysql_infos").show();
292 $("#pg_infos").hide(); 277 $("#pg_infos").hide();
293 $("#pdo_sqlite").hide();
294 $("#install_button").show();
295 } 278 }
296 else { 279 else {
297 if ( $("#postgresql").prop('checked')) { 280 if ( $("#postgresql").prop('checked')) {
298 $("#mysql_infos").hide(); 281 $("#mysql_infos").hide();
299 $("#pg_infos").show(); 282 $("#pg_infos").show();
300 $("#pdo_sqlite").hide();
301 $("#install_button").show();
302 } 283 }
303 else { 284 else {
304 $("#mysql_infos").hide(); 285 $("#mysql_infos").hide();
305 $("#pg_infos").hide(); 286 $("#pg_infos").hide();
306 <?php
307 if (!extension_loaded('pdo_sqlite')) : ?>
308 $("#pdo_sqlite").show();
309 $("#install_button").hide();
310 <?php
311 endif;
312 ?>
313 } 287 }
314 } 288 }
315 }); 289 });
diff --git a/wallabag_compatibility_test.php b/wallabag_compatibility_test.php
index 51ea31e1..7a52767c 100644
--- a/wallabag_compatibility_test.php
+++ b/wallabag_compatibility_test.php
@@ -171,7 +171,13 @@ background-color:#FF9500;
171</head> 171</head>
172 172
173<body> 173<body>
174 174<?php
175$frominstall = false;
176if (isset($_GET['from'])){
177 if ($_GET['from'] == 'install'){
178 $frominstall = true;
179 }}
180?>
175<div id="site"> 181<div id="site">
176 <div id="content"> 182 <div id="content">
177 183
@@ -337,15 +343,23 @@ background-color:#FF9500;
337 <?php if ($php_ok && $xml_ok && $pcre_ok && $filter_ok && $allow_url_fopen_ok && $gettext_ok) { ?> 343 <?php if ($php_ok && $xml_ok && $pcre_ok && $filter_ok && $allow_url_fopen_ok && $gettext_ok) { ?>
338 <h3>Bottom Line: Yes, you can!</h3> 344 <h3>Bottom Line: Yes, you can!</h3>
339 <p><em>Your webhost has its act together!</em></p> 345 <p><em>Your webhost has its act together!</em></p>
346 <?php if (!$frominstall) { ?>
340 <p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p> 347 <p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
341 <p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and start using wallabag</p> 348 <p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and/or start using wallabag</p>
349 <?php } else { ?>
350 <p>You can now <a href="index.php">return to the installation section</a>.</p>
351 <?php } ?>
342 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p> 352 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
343 <?php //} else if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $allow_url_fopen_ok && $filter_ok) { ?> 353 <?php //} else if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $allow_url_fopen_ok && $filter_ok) { ?>
344 <?php } else if ($php_ok && $xml_ok && $pcre_ok && $allow_url_fopen_ok && $filter_ok && $gettext_ok) { ?> 354 <?php } else if ($php_ok && $xml_ok && $pcre_ok && $allow_url_fopen_ok && $filter_ok && $gettext_ok) { ?>
345 <h3>Bottom Line: Yes, you can!</h3> 355 <h3>Bottom Line: Yes, you can!</h3>
346 <p><em>For most feeds, it'll run with no problems.</em> There are certain languages that you might have a hard time with though.</p> 356 <p><em>For most feeds, it'll run with no problems.</em> There are certain languages that you might have a hard time with though.</p>
357 <?php if (!$frominstall) { ?>
347 <p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p> 358 <p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
348 <p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and start using wallabag</p> 359 <p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and/or start using wallabag</p>
360 <?php } else { ?>
361 <p>You can now <a href="index.php">return to the installation section</a>.</p>
362 <?php } ?>
349 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p> 363 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
350 <?php } else { ?> 364 <?php } else { ?>
351 <h3>Bottom Line: We're sorry…</h3> 365 <h3>Bottom Line: We're sorry…</h3>