diff options
Diffstat (limited to 'install')
-rwxr-xr-x[-rw-r--r--] | install/index.php | 8 | ||||
-rw-r--r-- | install/postgres.sql | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/install/index.php b/install/index.php index e02952e0..e702891b 100644..100755 --- a/install/index.php +++ b/install/index.php | |||
@@ -53,7 +53,7 @@ else if (isset($_POST['install'])) { | |||
53 | else { | 53 | else { |
54 | $continue = true; | 54 | $continue = true; |
55 | // Create config.inc.php | 55 | // Create config.inc.php |
56 | if (!copy('inc/poche/config.inc.php.new', 'inc/poche/config.inc.php')) { | 56 | if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) { |
57 | $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.'; | 57 | $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.'; |
58 | $continue = false; | 58 | $continue = false; |
59 | } | 59 | } |
@@ -101,7 +101,7 @@ else if (isset($_POST['install'])) { | |||
101 | 101 | ||
102 | $sql_structure = file_get_contents('install/mysql.sql'); | 102 | $sql_structure = file_get_contents('install/mysql.sql'); |
103 | } | 103 | } |
104 | else if ($_POST['db_engine'] == 'postgresql') { | 104 | else if ($_POST['db_engine'] == 'postgres') { |
105 | $db_path = 'pgsql:host=' . $_POST['pg_server'] . ';dbname=' . $_POST['pg_database']; | 105 | $db_path = 'pgsql:host=' . $_POST['pg_server'] . ';dbname=' . $_POST['pg_database']; |
106 | $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['pg_server']."');", $content); | 106 | $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['pg_server']."');", $content); |
107 | $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['pg_database']."');", $content); | 107 | $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['pg_database']."');", $content); |
@@ -262,7 +262,7 @@ php composer.phar install</code></pre></li> | |||
262 | </ul> | 262 | </ul> |
263 | </li> | 263 | </li> |
264 | <li> | 264 | <li> |
265 | <label for="postgresql">PostgreSQL</label> <input name="db_engine" type="radio" id="postgresql" value="postgresql" /> | 265 | <label for="postgres">PostgreSQL</label> <input name="db_engine" type="radio" id="postgres" value="postgres" /> |
266 | <ul id="pg_infos"> | 266 | <ul id="pg_infos"> |
267 | <li><label for="pg_server">Server</label> <input type="text" placeholder="localhost" id="pg_server" name="pg_server" /></li> | 267 | <li><label for="pg_server">Server</label> <input type="text" placeholder="localhost" id="pg_server" name="pg_server" /></li> |
268 | <li><label for="pg_database">Database</label> <input type="text" placeholder="wallabag" id="pg_database" name="pg_database" /></li> | 268 | <li><label for="pg_database">Database</label> <input type="text" placeholder="wallabag" id="pg_database" name="pg_database" /></li> |
@@ -316,7 +316,7 @@ php composer.phar install</code></pre></li> | |||
316 | $("#install_button").show(); | 316 | $("#install_button").show(); |
317 | } | 317 | } |
318 | else { | 318 | else { |
319 | if ( $("#postgresql").prop('checked')) { | 319 | if ( $("#postgres").prop('checked')) { |
320 | $("#mysql_infos").hide(); | 320 | $("#mysql_infos").hide(); |
321 | $("#pg_infos").show(); | 321 | $("#pg_infos").show(); |
322 | $("#pdo_sqlite").hide(); | 322 | $("#pdo_sqlite").hide(); |
diff --git a/install/postgres.sql b/install/postgres.sql index fe8f559c..1d73dfcb 100644 --- a/install/postgres.sql +++ b/install/postgres.sql | |||
@@ -1,10 +1,10 @@ | |||
1 | CREATE TABLE config ( | 1 | CREATE TABLE IF NOT EXISTS config ( |
2 | id bigserial primary key, | 2 | id bigserial primary key, |
3 | name varchar(255) NOT NULL, | 3 | name varchar(255) NOT NULL, |
4 | value varchar(255) NOT NULL | 4 | value varchar(255) NOT NULL |
5 | ); | 5 | ); |
6 | 6 | ||
7 | CREATE TABLE entries ( | 7 | CREATE TABLE IF NOT EXISTS entries ( |
8 | id bigserial primary key, | 8 | id bigserial primary key, |
9 | title varchar(255) NOT NULL, | 9 | title varchar(255) NOT NULL, |
10 | url varchar(255) NOT NULL, | 10 | url varchar(255) NOT NULL, |
@@ -14,7 +14,7 @@ CREATE TABLE entries ( | |||
14 | user_id integer NOT NULL | 14 | user_id integer NOT NULL |
15 | ); | 15 | ); |
16 | 16 | ||
17 | CREATE TABLE users ( | 17 | CREATE TABLE IF NOT EXISTS users ( |
18 | id bigserial primary key, | 18 | id bigserial primary key, |
19 | username varchar(255) NOT NULL, | 19 | username varchar(255) NOT NULL, |
20 | password varchar(255) NOT NULL, | 20 | password varchar(255) NOT NULL, |
@@ -22,20 +22,20 @@ CREATE TABLE users ( | |||
22 | email varchar(255) NOT NULL | 22 | email varchar(255) NOT NULL |
23 | ); | 23 | ); |
24 | 24 | ||
25 | CREATE TABLE users_config ( | 25 | CREATE TABLE IF NOT EXISTS users_config ( |
26 | id bigserial primary key, | 26 | id bigserial primary key, |
27 | user_id integer NOT NULL, | 27 | user_id integer NOT NULL, |
28 | name varchar(255) NOT NULL, | 28 | name varchar(255) NOT NULL, |
29 | value varchar(255) NOT NULL | 29 | value varchar(255) NOT NULL |
30 | ); | 30 | ); |
31 | 31 | ||
32 | CREATE TABLE tags ( | 32 | CREATE TABLE IF NOT EXISTS tags ( |
33 | id bigserial primary key, | 33 | id bigserial primary key, |
34 | value varchar(255) NOT NULL | 34 | value varchar(255) NOT NULL |
35 | ); | 35 | ); |
36 | 36 | ||
37 | CREATE TABLE tags_entries ( | 37 | CREATE TABLE IF NOT EXISTS tags_entries ( |
38 | id bigserial primary key, | 38 | id bigserial primary key, |
39 | entry_id integer NOT NULL, | 39 | entry_id integer NOT NULL, |
40 | tag_id integer NOT NULL | 40 | tag_id integer NOT NULL |
41 | ) \ No newline at end of file | 41 | ) |