]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - install/index.php
problem with resources and localhost url fix
[github/wallabag/wallabag.git] / install / index.php
index 4d7e8cd2ebf5876f5caf8ad609313a79bd9a3cb0..b21cec521d0f8b2782acd8c8e977deb90e7bcbd1 100644 (file)
@@ -172,7 +172,7 @@ else if ($_POST['install']) {
                 <li><a href="http://www.wallabag.org/">wallabag.org</a></li>
             </ul> 
             <?php if (!empty($errors)) : ?>
-                <div class='install messages error'>
+                <div class='messages error install'>
                     <p>Errors during installation:</p>
                     <p>
                         <ul>
@@ -185,7 +185,7 @@ else if ($_POST['install']) {
                 </div>
             <?php endif; ?>
             <?php if (!empty($successes)) : ?>
-                <div class='install messages success'>
+                <div class='messages success install'>
                     <p>
                         <ul>
                         <?php foreach($successes as $success) :?>
@@ -194,6 +194,14 @@ else if ($_POST['install']) {
                         </ul>
                     </p>
                 </div>
+            <?php else : ?>
+                <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
+                <div class='messages success install'>
+                    <p>
+                        wallabag seems already installed. If you want to update it, you only have to delete install folder.
+                    </p>
+                </div>
+                <?php endif; ?>    
             <?php endif; ?>
             <p>To install wallabag, you just have to fill the following fields. That's all.</p>
             <p>Don't forget to check your server compatibility <a href="wallabag_compatibility_test.php">here</a>.</p>
@@ -201,7 +209,7 @@ else if ($_POST['install']) {
                 <fieldset>
                     <legend><strong>Technical settings</strong></legend>
                     <?php if (!is_dir('vendor')) : ?>
-                        <div class='install messages notice'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it: 
+                        <div class='messages notice install'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it: 
                         <ul>
                             <li>automatically download and extract vendor.zip into your wallabag folder. 
                             <p><input type="submit" name="download" value="Download vendor.zip" /></p>
@@ -217,7 +225,11 @@ php composer.phar install</code></pre></li>
                     <p>
                         Database engine:
                         <ul>
-                            <li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" /></li>
+                            <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="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
                                 <ul id="mysql_infos">
@@ -255,26 +267,49 @@ php composer.phar install</code></pre></li>
                     </p>
                 </fieldset>
 
-                <input type="submit" value="Install wallabag" name="install" />
+                <input type="submit" id="install_button" 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;
+                            ?>
                         }
                     }
                 });