<?php
$errors = array();
$successes = array();
-if ($_POST['download']) {
+if (isset($_POST['download'])) {
if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) {
$errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually<∕a> and unzip it in your wallabag folder.';
}
}
}
}
-else if ($_POST['install']) {
+else if (isset($_POST['install'])) {
if (!is_dir('vendor')) {
$errors[] = 'You must install twig before.';
}
}
else {
$content = file_get_contents('inc/poche/config.inc.php');
+ $sql_structure = '';
if ($_POST['db_engine'] == 'mysql') {
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'];
<p>
Database engine:
<ul>
- <li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" />
- <div id="pdo_sqlite" class='messages error install'>
- <p>You have to enable <a href="http://php.net/manual/ref.pdo-sqlite.php">pdo_sqlite extension</a>.</p>
- </div>
- </li>
+ <li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" /></li>
<li>
<label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
<ul id="mysql_infos">
</p>
</fieldset>
- <input type="submit" id="install_button" value="Install wallabag" name="install" />
+ <input type="submit" value="Install wallabag" name="install" />
</form>
</div>
<script>
$("#mysql_infos").hide();
$("#pg_infos").hide();
-
- <?php
- if (!extension_loaded('pdo_sqlite')) : ?>
- $("#install_button").hide();
- <?php
- else :
- ?>
- $("#pdo_sqlite").hide();
- <?php
- endif;
- ?>
-
$("input[name=db_engine]").click(function()
{
if ( $("#mysql").prop('checked')) {
$("#mysql_infos").show();
$("#pg_infos").hide();
- $("#pdo_sqlite").hide();
- $("#install_button").show();
}
else {
if ( $("#postgresql").prop('checked')) {
$("#mysql_infos").hide();
$("#pg_infos").show();
- $("#pdo_sqlite").hide();
- $("#install_button").show();
}
else {
$("#mysql_infos").hide();
$("#pg_infos").hide();
- <?php
- if (!extension_loaded('pdo_sqlite')) : ?>
- $("#pdo_sqlite").show();
- $("#install_button").hide();
- <?php
- endif;
- ?>
}
}
});
</head>
<body>
-
+<?php
+$frominstall = false;
+if (isset($_GET['from'])){
+ if ($_GET['from'] == 'install'){
+ $frominstall = true;
+ }}
+?>
<div id="site">
<div id="content">
<?php if ($php_ok && $xml_ok && $pcre_ok && $filter_ok && $allow_url_fopen_ok && $gettext_ok) { ?>
<h3>Bottom Line: Yes, you can!</h3>
<p><em>Your webhost has its act together!</em></p>
+ <?php if (!$frominstall) { ?>
<p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
- <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>
+ <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>
+ <?php } else { ?>
+ <p>You can now <a href="index.php">return to the installation section</a>.</p>
+ <?php } ?>
<p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost — it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
<?php //} else if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $allow_url_fopen_ok && $filter_ok) { ?>
<?php } else if ($php_ok && $xml_ok && $pcre_ok && $allow_url_fopen_ok && $filter_ok && $gettext_ok) { ?>
<h3>Bottom Line: Yes, you can!</h3>
<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>
+ <?php if (!$frominstall) { ?>
<p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
- <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>
+ <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>
+ <?php } else { ?>
+ <p>You can now <a href="index.php">return to the installation section</a>.</p>
+ <?php } ?>
<p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost — it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
<?php } else { ?>
<h3>Bottom Line: We're sorry…</h3>