1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-23 09:32:15 -05:00

pretty good now

This commit is contained in:
Thomas Citharel 2014-08-28 21:00:34 +02:00
parent aa04700c83
commit 1a19277a51

View File

@ -10,6 +10,7 @@
$errors = array(); $errors = array();
$successes = array(); $successes = array();
$installed = false;
/** /**
@ -59,14 +60,20 @@ function delTree($dir) {
return rmdir($dir); return rmdir($dir);
} }
/**
* Call to delete install directory if already installed
*/
if (isset($_GET['clean'])) {
clean();
header('Location: index.php');
}
/** /**
* Delete install directory * Delete install directory
*/ */
function clean() {
if (isset($_GET['clean'])) {
if (is_dir('install')){ if (is_dir('install')){
delTree('install'); delTree('install');
header('Location: index.php');
} }
} }
@ -105,7 +112,7 @@ if (isset($_POST['download'])) {
else if (isset($_POST['install'])) { else if (isset($_POST['install'])) {
if (!is_dir('vendor')) { if (!is_dir('vendor')) {
$errors[] = 'You must install twig before.'; $errors[] = 'You must install twig before.'; # useless unless JS not enabled
} }
else { else {
$continue = true; $continue = true;
@ -209,6 +216,8 @@ else if (isset($_POST['install'])) {
$params = array($id_user, 'language', 'en_EN.UTF8'); $params = array($id_user, 'language', 'en_EN.UTF8');
$query = executeQuery($handle, $sql, $params); $query = executeQuery($handle, $sql, $params);
clean();
$installed = true;
$successes[] = 'wallabag is now installed. You can now <a href="index.php?clean=0">access it !</a>'; $successes[] = 'wallabag is now installed. You can now <a href="index.php?clean=0">access it !</a>';
} }
} }
@ -292,6 +301,7 @@ else if (isset($_POST['install'])) {
<li><a href="http://www.wallabag.org/help/">help</a></li> <li><a href="http://www.wallabag.org/help/">help</a></li>
<li><a href="http://www.wallabag.org/">wallabag.org</a></li> <li><a href="http://www.wallabag.org/">wallabag.org</a></li>
</ul> </ul>
<?php if (!$installed) { ?>
<?php if (!empty($errors)) : ?> <?php if (!empty($errors)) : ?>
<div class='messages error install'> <div class='messages error install'>
<p>Errors during installation:</p> <p>Errors during installation:</p>
@ -302,7 +312,6 @@ else if (isset($_POST['install'])) {
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</p> </p>
<!--<p><a href="index.php">Please reload</a> this page when you think you resolved these problems.</p>-->
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($successes)) : ?> <?php if (!empty($successes)) : ?>
@ -319,7 +328,7 @@ else if (isset($_POST['install'])) {
<?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?> <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
<div class='messages success install'> <div class='messages success install'>
<p> <p>
wallabag seems already installed. If you want to update it, you only have to delete install folder, then <a href="index.php">reload this page</a>. wallabag seems already installed. If you wanted to update it, you now have to <a href="index.php?clean=0">delete the install directory</a>.
</p> </p>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -442,7 +451,7 @@ php composer.phar install</code></pre><p>Then, please reload the page.</p></li>
</div> </div>
<a class="reload" href="#step2">Reload</a> <a class="reload" href="#step2">Reload</a>
<?php } else { ?> <?php } else { ?>
<div>Twig seems to be already installed. All good !</div> <div class='messages success install'>Twig seems to be already installed. All good !</div>
<a class="nextstep" id="nextstep2" href="#step3">Next Step</a> <a class="nextstep" id="nextstep2" href="#step3">Next Step</a>
<?php } ?> <?php } ?>
</fieldset> </fieldset>
@ -585,5 +594,10 @@ php composer.phar install</code></pre><p>Then, please reload the page.</p></li>
location.reload(); location.reload();
}); });
</script> </script>
<?php } else { ?>
<div class='messages success install'>
wallabag is now installed. You can now <a href="index.php">access it !</a>
</div>
<?php } ?>
</body> </body>
</html> </html>