aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'install/index.php')
-rw-r--r--install/index.php36
1 files changed, 5 insertions, 31 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 });