X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=install%2Findex.php;h=e702891bb711d680830625a48cddd7c4273ef7de;hb=d151b51c678127274ce76a05b28393961cfca9af;hp=d21371722df3172b9ef435c768a609d111483ef3;hpb=53ae58e1a1bf097b8eb1af3a532ebf25630f96ec;p=github%2Fwallabag%2Fwallabag.git diff --git a/install/index.php b/install/index.php old mode 100644 new mode 100755 index d2137172..e702891b --- a/install/index.php +++ b/install/index.php @@ -1,9 +1,30 @@ download it here manually<∕a> and unzip it in your wallabag folder.'; + +/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489 + * Idea : nbari at dalmp dot com + * Rights unknown + * Here in case of .gitignore files + */ +function delTree($dir) { + $files = array_diff(scandir($dir), array('.','..')); + foreach ($files as $file) { + (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); + } + return rmdir($dir); + } + +if (isset($_GET['clean'])) { + if (is_dir('install')){ + delTree('install'); + header('Location: index.php'); + } +} + +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 download it manually and unzip it in your wallabag folder.'; } else { if (extension_loaded('zip')) { @@ -25,14 +46,14 @@ if ($_POST['download']) { } } } -else if ($_POST['install']) { +else if (isset($_POST['install'])) { if (!is_dir('vendor')) { $errors[] = 'You must install twig before.'; } else { $continue = true; // Create config.inc.php - if (!copy('inc/poche/config.inc.php.new', 'inc/poche/config.inc.php')) { + if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) { $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.'; $continue = false; } @@ -64,6 +85,7 @@ else if ($_POST['install']) { else { $db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite'; $handle = new PDO($db_path); + $sql_structure = ""; } } else { @@ -79,7 +101,7 @@ else if ($_POST['install']) { $sql_structure = file_get_contents('install/mysql.sql'); } - else if ($_POST['db_engine'] == 'postgresql') { + else if ($_POST['db_engine'] == 'postgres') { $db_path = 'pgsql:host=' . $_POST['pg_server'] . ';dbname=' . $_POST['pg_database']; $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['pg_server']."');", $content); $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['pg_database']."');", $content); @@ -129,7 +151,7 @@ else if ($_POST['install']) { $params = array($id_user, 'language', 'en_EN.UTF8'); $query = executeQuery($handle, $sql, $params); - $successes[] = 'wallabag is now installed. Don\'t forget to delete install folder.'; + $successes[] = 'wallabag is now installed. You can now access it !'; } } } @@ -143,7 +165,7 @@ else if ($_POST['install']) { - wallabag — installation + wallabag - installation @@ -154,7 +176,7 @@ else if ($_POST['install']) { - + @@ -172,7 +194,7 @@ else if ($_POST['install']) {
  • wallabag.org
  • -
    +

    Errors during installation:

    -
    +

      @@ -194,14 +216,22 @@ else if ($_POST['install']) {

    + + +
    +

    + wallabag seems already installed. If you want to update it, you only have to delete install folder, then reload this page. +

    +
    +

    To install wallabag, you just have to fill the following fields. That's all.

    -

    Don't forget to check your server compatibility here.

    +

    Don't forget to check your server compatibility here.

    Technical settings -
    wallabag needs twig, a template engine (?). Two ways to install it: +
    wallabag needs twig, a template engine (?). Two ways to install it:
    • automatically download and extract vendor.zip into your wallabag folder.

      @@ -217,7 +247,11 @@ php composer.phar install
    • Database engine:

        -
      • +
      • +
        +

        You have to enable pdo_sqlite extension.

        +
        +
        • @@ -228,12 +262,12 @@ php composer.phar install
      • - +
        • - id
        • +
      @@ -255,26 +289,49 @@ php composer.phar install

    - +