]> git.immae.eu Git - github/wallabag/wallabag.git/blame - install/index.php
update improvements
[github/wallabag/wallabag.git] / install / index.php
CommitLineData
792097fb 1<?php
3602405e
NL
2/**
3 * wallabag, self hostable application allowing you to not miss any content anymore
4 *
5 * @category wallabag
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://opensource.org/licenses/MIT see COPYING file
9 */
10
792097fb
NL
11$errors = array();
12$successes = array();
1be13ba1 13
9fdd8843
TC
14$final = false;
15
5e26c910 16require_once('install_functions.php');
444f1406 17
1be13ba1
NL
18if (isset($_GET['clean'])) {
19 if (is_dir('install')){
8df90295
TC
20 delTree('install');
21 header('Location: index.php');
22 }
23 if (is_dir('cache')) {
24 delTree('cache', false);
25 header('Location: index.php');
1be13ba1
NL
26 }
27}
28
fecb62a3 29if (isset($_POST['download'])) {
fb5a9666 30 if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) {
d967a1fa 31 $errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually</a> and unzip it in your wallabag folder.';
792097fb
NL
32 }
33 else {
34 if (extension_loaded('zip')) {
35 $zip = new ZipArchive();
36 if ($zip->open("cache/vendor.zip") !== TRUE){
37 $errors[] = 'Impossible to open cache/vendor.zip. Please unzip it manually in your wallabag folder.';
38 }
39 if ($zip->extractTo(realpath(''))) {
40 @unlink("cache/vendor.zip");
41 $successes[] = 'twig is now installed, you can install wallabag.';
42 }
43 else {
44 $errors[] = 'Impossible to extract cache/vendor.zip. Please unzip it manually in your wallabag folder.';
45 }
46 $zip->close();
47 }
48 else {
49 $errors[] = 'zip extension is not enabled in your PHP configuration. Please unzip cache/vendor.zip in your wallabag folder.';
50 }
51 }
52}
fecb62a3 53else if (isset($_POST['install'])) {
792097fb
NL
54 if (!is_dir('vendor')) {
55 $errors[] = 'You must install twig before.';
ca056e7f 56 } else {
792097fb 57 $continue = true;
ca056e7f
TC
58 $salt = generate_salt();
59 $content = file_get_contents('inc/poche/config.inc.default.php');
792097fb 60
ca056e7f
TC
61 // User informations
62 $username = trim($_POST['username']);
63 $password = trim($_POST['password']);
64 $salted_password = sha1($password . $username . $salt);
792097fb 65
ca056e7f
TC
66 // Database informations
67 $moreQueries = array();
792097fb 68
ca056e7f
TC
69 if ($_POST['db_engine'] == 'sqlite') {
70 if (!copy('install/poche.sqlite', 'db/poche.sqlite')) {
71 $errors[] = 'Impossible to create the SQLite database file.';
792097fb
NL
72 }
73 else {
ca056e7f
TC
74 $db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite';
75 $handle = new PDO($db_path);
76 $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
77 $sql_structure = "";
78 }
79 } else {
80 // MySQL and Postgre
81 try {
82
83 if ($_POST['db_engine'] == 'mysql') {
976d6935
TC
84 if (isset($_POST['mysql_utf8_mb4'])) {
85 //with UTF8-MB4
86 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'] . ';charset=utf8mb4';
87 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password'], array(
88 PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
89 ));
054c9d88 90 $content = str_replace("define ('MYSQL_USE_UTF8MB4', FALSE);", "define ('MYSQL_USE_UTF8MB4', TRUE);", $content);
976d6935
TC
91 } else { // regular UTF8
92 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'];
93 $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']);
94 }
ca056e7f
TC
95 $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['mysql_server']."');", $content);
96 $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['mysql_database']."');", $content);
97 $content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['mysql_user']."');", $content);
98 $content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['mysql_password']."');", $content);
ca056e7f
TC
99
100 $moreQueries[] = "INSERT INTO `entries` (`id`, `title`, `url`, `is_read`, `is_fav`, `content`, `user_id`) VALUES
86edff44
NL
101(1, 'Framabag, un nouveau service libre et gratuit', 'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur', 0, 0, 0x0a3c68323e556e6520696e74657276696577206465204e69636f6c61732c20736f6e2064c3a976656c6f70706575722e3c2f68323e0a3c703e3c656d3e496c206e6520766f757320612073c3bb72656d656e742070617320c3a96368617070c3a920717565206e6f74726520636f6e736f6d6d6174696f6e20646520636f6e74656e75732064752057656220657374207465727269626c656d656e74206368726f6e6f706861676520657420706172746963756c69c3a872656d656e7420667275737472616e746520746f757420c3a0206c6120666f6973c2a03a206e6f6e207365756c656d656e74206e6f757320706173736f6e732062656175636f7570202874726f70c2a03f292064652074656d707320656e206c69676e6520c3a0206578706c6f726572206c6573206d696e6573206175726966c3a8726573206465206c6120746f696c652c20792064c3a974656374616e742070c3a970697465732065742066696c6f6e732c206d616973206e6f757320736f6d6d657320737572746f757420636f6e7374616d6d656e7420656e206d616e7175652e204dc3aa6d65207369206e6f7573206e6520736f6d6d6573207061732064616e73206c65207a617070696e67206672c3a96ec3a9746971756520736920666163696c656d656e742064c3a96e6f6e63c3a920706172206c657320646f637465732070737963686f6c6f677565732071756920706f6e74696669656e7420737572206c65732064616e67657273206475206e756dc3a9726971756520706f7572206c6573206a65756e65732063657276656c6c65732c20696c206e6f7573207669656e7420736f7576656e74206c6520676fc3bb7420616d6572206465206ce28099696e6163686576c3a9c2a03a20706173206c652074656d707320646520746f7574206c69726520283c6120687265663d22687474703a2f2f66722e77696b74696f6e6172792e6f72672f77696b692f544c4452223e544c3b44523c2f613e2065737420646576656e75206c6520636c696e2064e28099c593696c206d692d6669677565206d692d72616973696e2064e28099756e652067c3a96ec3a9726174696f6e206465206c65637465757273207072657373c3a973292c207061732074726f70206c652074656d70732064652072c3a9666cc3a963686972206e6f6e20706c75732068c3a96c61732c20706173206c652074656d707320646520737569767265206c6120726962616d62656c6c65206465206c69656e73206173736f6369c3a97320c3a020756e2061727469636c65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e506f7572206e6f757320646f6e6e657220626f6e6e6520636f6e736369656e63652c206e6f75732072616e67656f6e73207363727570756c657573656d656e7420756e206d61727175652d7061676520646520706c75732064616e7320756e20736f75732d646f73736965722071756920656e20636f6d706f7274652064c3a96ac3a0203235362c206e6f7573206e6f746f6e7320756e20c3a96cc3a96d656e7420646520706c75732064616e73206c6120746f756a6f757273207269646963756c656d656e74206c6f6e67756520746f75646f756c697374652c2062726566206e6f75732072656d6574746f6e7320c3a020706c757320746172642c2063e280996573742dc3a02d64697265206c6520706c757320736f7576656e742061757820696e74726f757661626c65732063616c656e6465732067726563717565732c206c6520736f696e206465206c69726520767261696d656e7420756e2061727469636c65206a7567c3a920696e74c3a972657373616e742c20646520726567617264657220756e6520766964c3a96f207369676e616cc3a96520706172206c65732072c3a97a6f73736f63696f732c206465206c69726520756e20636861706974726520656e746965722064e28099756e206f75767261676520646973706f6e69626c6520656e206c69676e65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e416c6f7273206269656e2073c3bb722c20c3a02064c3a966617574206465206e6f757320646f6e6e657220746f7574206c652074656d70732071756920736572616974206ec3a963657373616972652c2064657320736f6c7574696f6e73206578697374656e7420706f7572206e6f7573207065726d657474726520646520c2abc2a06c69726520706c75732074617264c2a0c2bb20656e20736175766567617264616e74206c65207072c3a9636965757820706f6c6c656e206465206e6f7320627574696e61676573206465207369746520656e20736974652c2065742064e28099656e20666169726520756c74c3a97269657572656d656e7420766f747265206d69656cc2a03b2063e280996573742062656c20657420626f6e206d616973206c65732072756368657320736f6e7420756e207065752064697374616e7465732c20c3a7612073e28099617070656c6c65206c6520636c6f756420286e6f7320616d69732074656368696573206de280996f6e74206269656e206578706c697175c3a9206d616973206ae280996169207365756c656d656e7420636f6d70726973207175652064657320747275637320c3a0206d6f6920736f6e742073757220646573206d616368696e6573206c6f696e7461696e65732c20c3a761206e65206d652072617373757265207061732074726f702920657420656c6c657320736f6e7420736f7576656e742070726f707269c3a97461697265732c206e65206c61697373616e7420656e7472657220717565206c6573203c733e7574696c69736174657572733c2f733e20636f6e736f6d6d61746575727320706179616e74732065742071756920636f6e73656e74656e7420c3a0206c6575727320636f6e646974696f6e732e2053616e7320636f6d70746572207175652064652067726f7320626f7572646f6e73207669656e6e656e742070726f666974657220706c7573206f75206d6f696e73206469736372c3a874656d656e7420646520746f757465732063657320747261636573206465206e6f75732d6dc3aa6d657320717569207065726d657474656e74206465206d6f6ec3a97469736572206e6f7472652070726f66696cc2a03a207369206a6520636f6c6c65637465207375722063657320736572766963657320286e65206c6573206e6f6d6d6f6e73207061732c206a757374656d656e742920756e652073c3a97269652064e2809961727469636c657320737572206ce280996964c3a965206465204e6174757265206368657a2044696465726f742c206a6520726563657672616920646976657273657320736f6c6c696369746174696f6e7320706f757220646576656e697220636c69656e74206465206c6120626f757469717565204e61747572652026616d703b2044c3a9636f75766572746520647520626f756c65766172642044696465726f742e2045742073692064e280996176656e74757265206c65732070726f6772616d6d6573206465206c61204e5341206d6f756c696e656e7420737572206c6520736572766963652c206a6520736572616920706575742dc3aa74726520756e206a6f75722064616e7320756e65206c6973746520646573206d696c6974616e7473206e61747572697374657320696e64c3a973697261626c657320737572206c657320766f6c73206465206c612050616e416d20286a65206e65207361697320706c75732074726f70207369206a6520706c616973616e7465206cc3a02c2066696e616c656d656e74e280a6293c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4c6120626f6e6e65206964c3a965c2a03a20c2abc2a0736520636f6e7374697475657220756e2072c3a9736572766f697220646520646f63756d656e74732073c3a96c656374696f6e6ec3a97320c3a020706172636f7572697220706c75732074617264c2a0c2bb20617070656c61697420646f6e6320756e6520617574726520626f6e6e65206964c3a9652c2063656c6c652064e2809961766f6972206c6520636f6e7472c3b46c652064652063652072c3a9736572766f69722c206465206e6f74726520636f6c6c656374696f6e20706572736f6e6e656c6c652e2043e28099657374204e69636f6c6173204cc59375696c6c65742c2063692d646573736f757320696e74657276696577c3a92c207175692073e28099792065737420636f6c6cc3a9206176656320756e652062656c6c65206170706c69636174696f6e20617070656cc3a96520657568e280a6206f75692c20617070656cc3a9652057616c6c616261672e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4672616d61736f667420736f757469656e742064e28099617574616e7420706c757320736f6e20696e6974696174697665207175e280993c6120687265663d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f696e6465782e7068702f706f73742f323031342f30312f33312f4765656b74696f6e6e6572642d57616c6c61626167223e6f6e206c7569206120636865726368c3a920646573206d6973c3a872657320706f757220756e6520686973746f697265206465206e6f6d3c2f613e206574207175e28099696c2065737420706f737369626c652064e28099696e7374616c6c657220736f692d6dc3aa6d6520756e6520636f7069652064652057616c6c616261672073757220736f6e2070726f70726520736974652e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4c6520706574697420706c7573206465204672616d61736f66742c2072c3a97365617520746f756a6f7572732064c3a973697265757820646520766f75732070726f706f7365722064657320616c7465726e617469766573206c6962c3a972617472696365732c2063e2809965737420646520766f75732070726f706f736572202873757220696e736372697074696f6e207072c3a9616c61626c652920756e20616363c3a873206175204672616d616261672c2061757472656d656e742064697420766f7472652057616c6c616261672073757220756e2073657276657572204672616d612a2061766563206e6f74726520676172616e74696520646520636f6e666964656e7469616c6974c3a92e20436f6d6d6520706f7572206c65204672616d616e6577732c206e6f757320766f7573206163637565696c6c6f6e7320766f6c6f6e74696572732064616e73206c61206c696d697465206465206e6f732063617061636974c3a9732c20656e20766f757320696e766974616e7420c3a020766f7573206c616e6365722064616e7320766f747265206175746f2d68c3a962657267656d656e742064652057616c6c616261672e3c6272202f3e4365742061727469636c65206573742074726f70206c6f6e67c2a03f204d657474657a2d6c652064616e73203c6120687265663d22687474703a2f2f7777772e6672616d616261672e6f72672f696e6465782e706870223e766f747265204672616d616261673c2f613e20657420686f702e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4672616d61626c6f67c2a03a2053616c7574204e69636f6c6173e280a62054752070657578207465207072c3a973656e74657220627269c3a876656d656e74c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e53616c7574c2a0212044c3a976656c6f70706575722050485020646570756973207175656c7175657320616e6ec3a96573206d61696e74656e616e742028313020616e73292c206ae28099616920766f756c75206d652072656d657474726520c3a0206e697665617520746563686e697175656d656e74207061726c616e742028646570756973203320616e732c206ae28099616920706173206d616c206cc3a26368c3a9206c6520636c6176696572292e20506f7572206d6573206265736f696e7320706572736f732c206ae28099616920646f6e63206372c3a9c3a920756e2070657469742070726f6a657420706f75722072656d706c6163657220756e6520736f6c7574696f6e2070726f707269c3a97461697265206578697374616e74652e2053616e7320617563756e65207072c3a974656e74696f6e2c206ae2809961692068c3a962657267c3a92063652070726f6a6574207375722047697468756220657420636f6d6d652063e28099657374206c61207365756c6520736f6c7574696f6e203c656d3e6f70656e20736f757263653c2f656d3e20646520636520747970652c206c65206e6f6d62726520646520706572736f6e6e657320696e74c3a972657373c3a965732061206175676d656e74c3a920e280a63c2f703e0a3c703e3c656d3e4c6573207574696c6973617465757273206465207365727669636573204672616d61736f6674206e65206c6520736176656e742070617320666f7263c3a96d656e742c206d6169732074752061732064c3a96ac3a020706173206d616c207061727469636970c3a920c3a0206c61204672616d6147616c617869652c206e6f6ec2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e456e2065666665742e204ae28099616920636f6d6d656e63c3a920756e20706c7567696e20706f7572204672616d616e6577732c203c6120687265663d2268747470733a2f2f6769746875622e636f6d2f6e69636f736f6d622f74747273732d70757267652d6163636f756e7473223e74747273732d70757267652d6163636f756e74733c2f613e2c20717569207065726d6574206465206e6574746f796572206c61206261736520646520646f6e6ec3a9657320646520636f6d7074657320706c7573207574696c6973c3a9732e204d616973206365203c656d3e706c7567696e3c2f656d3e2061206265736f696e2064e28099c3aa747265207465726d696ec3a920c3a0203130302520706f757220c3aa74726520696e74c3a96772c3a9206175207365696e206465204672616d616e6577732028657420646f6e632064652054696e792054696e7920525353292c207369207175656c7175e28099756e20736f756861697465206de2809961696465722c20696c206ee2809979206120617563756e20736f7563692e3c6272202f3e4ae28099616920617573736920666169742031206f7520322061707061726974696f6e732064616e73206465732074726164756374696f6e7320706f7572204672616d61626c6f672e205269656e2064e2809965787472616f7264696e616972652c206a65206e652073756973207061732062696c696e6775652c20c3a761206d65207065726d6574206465206de28099656e747261c3ae6e65722e3c2f703e0a3c703e3c656d3e5061726c6f6e73206465207375697465206465206365207175692066c3a2636865c2a03a20746f6e206170706c69636174696f6e2057616c6c616261672c20656c6c652073e28099617070656c6c6169742070617320e2809c506f636865e2809d2c206176616e74c2a03f205475206e6f7573207261636f6e746573206ce28099686973746f697265c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e45756820656e20656666657420e280a62044c3a96ac3a02c20706f757271756f69203c656d3e706f6368653c2f656d3ec2a03f20506172636520717565206ce28099756e206465732074726f697320c2abc2a074c3a96e6f7273c2a0c2bb20737572206c65206d61726368c3a92073e28099617070656c6c65203c656d3e506f636b65743c2f656d3e2e20436f6d6d65206d6f6e206170706c69206ee28099c3a9746169742064657374696ec3a965207175e28099c3a0206d6f6e20757361676520706572736f6e6e656c2061752064c3a9706172742c206a65206e65206d6520737569732070617320746f72747572c3a9206269656e206c6f6e6774656d70732e3c2f703e0a3c703e43657420c3a974c3a92c206f6e2061206661696c6c69206368616e676572206465206e6f6d2c207175616e6420696c2079206120657520646520706c757320656e20706c75732064e280997574696c69736174657572732e2045742070756973206f6e2073e28099657374206469742071756520706f6368652c2063e28099c3a97461697420706173206d616c2c20c3a76120736f6e6e616974206269656e206672616ec3a761697320657420707569732061766563206c6573207175656c717565732064697a61696e65732064e280997574696c69736174657572732c206f6e206e652067c3aa6e657261697420706572736f6e6e652e3c2f703e0a3c703e43e280996573742073616e7320636f6d707465722061766563206c657320736f6369c3a974c3a97320616dc3a972696361696e6573206574206c6575722066c3a2636865757365206d616e696520646520766f756c6f697220656e766f796572206c657572732061766f6361747320c3a020746f757420626f7574206465206368616d702e204c65203233206a616e766965722c206ae280996169207265c3a77520756e20656d61696c206465206c61207061727420647520636162696e65742064e2809961766f6361747320646520506f636b6574206d652064656d616e64616e74206465206368616e676572206c65206e6f6d2c206c65206c6f676f2c206465206e6520706c7573207574696c69736572206c65207465726d6520e2809c726561642d69742d6c61746572e2809d2028c2abc2a06c6973657a206c6520706c75732074617264c2a0c2bb29206574206465206e6520706c757320646972652071756520506f636b6574206ee280996573742070617320677261747569742028746f7574206573742070617274692064e280993c6120687265663d2268747470733a2f2f747769747465722e636f6d2f77616c6c616261676170702f7374617475732f343233373836333635393434323235373932223e756e2074776565743c2f613e206fc3b9206a65207175616c6966696520506f636b657420646520c2abc2a06e6f6e2066726565c2a0c2bb20c3a0207361766f6972206e6f6e206c69627265292e20427265662c206dc3aa6d65207369206a652073656d626c6169732064616e73206d6f6e2064726f69742c206ae280996169207175616e64206dc3aa6d652070726973206c612064c3a9636973696f6e206465206368616e676572206465206e6f6d2065742057616c6c6162616720657374206ec3a92c20737569746520617578203c6120687265663d22687474703a2f2f6672616d61646174652e6f72672f73747564732e7068703f736f6e646167653d6c6c6370366f6a70796339706b6c6861223e64697a61696e65732064652070726f706f736974696f6e73206465206e6f6d207265c3a77565733c2f613e2e2043e2809965737420756e206dc3a96c616e676520656e747265206c652077616c6c61627920286465206c612066616d696c6c6520646573206b616e676f75726f75732c207175692073746f636b656e742064616e73206c65757220706f63686520636520717569206c65757220657374206368657229206574203c656d3e6261673c2f656d3e20286c6573207465726d657320736163202f207361636f636865202f2062657361636520736f6e7420c3a96e6f726dc3a96d656e7420726576656e7573292e204d616973206d61696e74656e616e742c206f6e207661206465206ce280996176616e742c20706c75732064652074656d707320c3a020706572647265206176656320c3a7612c206f6e2061206475207061696e20737572206c6120706c616e6368652e3c6272202f3e3c696d67207372633d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f7075626c69632f5f696d672f6672616d61626c6f672f77616c6c6162795f626162792e6a70672220616c743d2277616c6c61627920617665632062c3a962c3a92064616e7320736120706f6368652220636c6173733d22633122207469746c653d2277616c6c61627920617665632062c3a962c3a92064616e7320736120706f63686522202f3e206372c3a96469742070686f746f203c6120687265663d22687474703a2f2f7777772e666c69636b722e636f6d2f70686f746f732f3236373832383634404e30302f353032373230323233342f696e2f70686f746f6c6973742d3845654a35412d6831544c36762d4e454c38312d636e4e6b536f2d39594d3174762d374b636736622d387a70416f612d61315a4c4d4e2d39594d3339722d3768355341442d38456548664c2d3845654677752d647456776e4d2d38756f4d45312d4a457a58652d47713471792d3932564a50522d43786531762d38483344324a2d61315a464e732d395937324b362d38456547784c2d354c353346782d354e6b454e732d3555384354592d354e6b7373682d6e6b6176462d3943726777502d3773644341612d647566324b682d685a65707a792d685a645531652d685a656f66462d685a656b44672d685a656741592d685a654d5a6e2d6a61486741662d3850383744322d354e677152762d6154343851422d685a645634592d685a654336342d45526770732d3556594747642d3556594a42312d354e6b72466b2d364a786837682d3768395075512d4552664d782d6831553169682d683155534278223e57696c6c69616d2057617262793c2f613e20717569206175746f72697365206578706c69636974656d656e7420746f7574652072c3a97574696c69736174696f6e2e3c2f703e0a3c703e3c656d3e426f6e2c20616c6f7273206578706c697175652d6d6f6920636520717565206a65207661697320706f75766f69722066616972652061766563204672616d61626167e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e416c6f7273204672616d616261672c20c3a761207465207065726d6574206465207465206372c3a9657220756e20636f6d7074652067726174756974656d656e74206574206c696272656d656e7420706f757220706f75766f6972207574696c697365722057616c6c616261672e205365756c6520746f6e206164726573736520656d61696c20657374206ec3a963657373616972652c206f6e207365206368617267652064e28099696e7374616c6c6572206574206465206d657474726520c3a0206a6f75722057616c6c6162616720706f757220746f692e20547520706575782064e2809961696c6c657572732070726f6669746572203c6120687265663d22687474703a2f2f7777772e6672616d61736f66742e6e65742f23746f705067436c6f7564223e64e280996175747265732073657276696365732070726f706f73c3a97320706172204672616d61736f6674206963693c2f613e2e3c2f703e0a3c703ec380206365206a6f75722c20696c207920612038333420636f6d70746573206372c3a9c3a97320737572204672616d616261672e3c2f703e0a3c703e3c656d3e566f7573206176657a20767261696d656e7420636f6ec3a7752063652073657276696365206166696e207175e280996f6e20707569737365206ce280997574696c69736572206176656320756e206d6178696d756d2064e280996f7574696c732c206e6f6ec2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4175746f7572206465206ce280996170706c69636174696f6e207765622c20696c206578697374652064c3a96ac3a020646573206170706c69636174696f6e7320706f757220736d61727470686f6e65732028416e64726f69642065742057696e646f77732050686f6e65292c2064657320657874656e73696f6e732046697265666f7820657420476f6f676c65204368726f6d652e3c2f703e0a3c703e436f6d6d652057616c6c6162616720706f7373c3a864652064657320666c7578205253532c2063e2809965737420666163696c65206465206c697265206c65732061727469636c657320736175766567617264c3a97320737572207361206c697365757365202873692063656c6c652d6369207065726d6574206465206c6972652064657320666c757820525353292e2043616c696272652028c2abc2a06c6f67696369656c206465206c6563747572652c2064652067657374696f6e206465206269626c696f7468c3a87175657320657420646520636f6e76657273696f6e206465206669636869657273206e756dc3a972697175657320646520747970652065626f6f6b206f75206c6976726520c3a96c656374726f6e69717565c2a0c2bb2c6e6f757320646974207562756e74752d66722e6f72672920696e74c3a867726520646570756973207175656c717565732073656d61696e6573206d61696e74656e616e74206c6120706f73736962696c6974c3a92064652072c3a9637570c3a9726572206c65732061727469636c6573206e6f6e206c75732c20707261746971756520706f757220666169726520756e20666963686965722065507562c2a0213c2f703e0a3c703e44e28099617574726573206170706c69636174696f6e7320776562207065726d657474656e74206ce28099696e74c3a967726174696f6e20617665632057616c6c61626167202846726573685253532c204c6565642065742054696e792054696e792052535320706f7572206c657320616772c3a96761746575727320646520666c7578292e204ce2809941504920717569207365726120646973706f6e69626c652064616e73206c612070726f636861696e652076657273696f6e2064652057616c6c61626167207065726d657474726120656e636f726520706c75732064e28099696e74657261637469766974c3a92e3c2f703e0a3c703e3c656d3e5920612d742d696c20756e206d6f6465206465206c65637475726520686f7273206c69676e65206f75206573742d6365207175652063e28099657374207072c3a9767520706f7572206c65732070726f636861696e65732076657273696f6e73c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e496c2079206120756e2070736575646f206d6f646520686f7273206c69676e652c20646973706f6e69626c652061766563206ce280996170706c69636174696f6e20416e64726f69642e204f6e20706575742072c3a9637570c3a9726572202876696120756e20666c75782052535329206c65732061727469636c6573206e6f6e206c757320717565206ce280996f6e206120736175766567617264c3a9732e20556e6520666f69732064c3a9636f6e6e656374c3a92c206f6e207065757420636f6e74696e75657220c3a0206c6972652073757220736f6e20736d61727470686f6e65206f75207361207461626c65747465206c65732061727469636c65732e2050617220636f6e7472652c20696c206d616e7175652064657320666f6e6374696f6e6e616c6974c3a973c2a03a207175616e64207475206d61727175657320756e2061727469636c6520636f6d6d65206c752c206365206ee28099657374207061732073796e6368726f6e6973c3a92061766563206c612076657273696f6e207765622064652057616c6c616261672e204ae28099657370c3a8726520717565206a652073756973207072657371756520636c6169722064616e73206d6573206578706c69636174696f6e732e3c2f703e0a3c703e506f7572206c612076322c20717569206573742064c3a96ac3a020656e20636f7572732064652064c3a976656c6f7070656d656e742c206fc3b9206a652073756973206269656e20616964c3a9207061722056696e63656e74204a6f757373652c206f6e2061757261206c6120706f73736962696c6974c3a92064e2809961766f697220756e2076726169206d6f646520686f7273206c69676e652e3c2f703e0a3c703e3c656d3e416c6f7273207369206f6e2076657574206169646572202f2070617274696369706572202f20747269666f75696c6c6572206c6520636f6465202f20766f757320656e766f79657220646573207265746f7572732c206f6e206661697420636f6d6d656e74c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4f6e207065757420616964657220646520706c75736965757273206661c3a76f6e73c2a03a3c2f703e0a3c756c3e3c6c693e7574696c697365722077616c6c61626167206574206e6f75732072656d6f6e746572206c65732070726f626cc3a86d65732072656e636f6e7472c3a973c2a03b3c2f6c693e0a3c6c693e706172746963697065722061752064c3a976656c6f7070656d656e74206465206ce280996170706c69636174696f6e2068747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c616261672053692053696c6578202f2053796d666f6e7932202f2048544d4c35202f206574632e207465207061726c656e742c206ee2809968c3a97369746520706173c2a0213c2f6c693e0a3c6c693e636f6d6d6520746f75742070726f6a65742c206c652067726f7320706f696e74206e6f697220657374206c65206d616e71756520646520646f63756d656e746174696f6e2e203c6120687265663d22687474703a2f2f646f632e77616c6c616261672e6f7267223e456c6c652065737420646973706f206963693c2f613e206d61697320696c206d616e71756520706c65696e2064652063686f73657320657420746f7574206ee280996573742070617320c3a0206a6f7572c2a03b3c2f6c693e0a3c6c693e7061726c65722064652057616c6c61626167206175746f757220646520766f7573c2a03b3c2f6c693e0a3c6c693e696c20657869737465203c6120687265663d2268747470733a2f2f666c617474722e636f6d2f7468696e672f313236353438302f706f6368652d612d726561642d69742d6c617465722d6f70656e2d736f757263652d73797374656d223e756e20636f6d70746520466c617474723c2f613e2e3c2f6c693e0a3c2f756c3e3c703e3c656d3e4c65206d6f74206465206c612066696ee280a63f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4d6572636920c3a0204672616d61736f66742064e280996163637565696c6c697220657420646520736f7574656e69722057616c6c61626167c2a0213c2f703e0a3c703e4c6120726f7574652065737420656e636f7265206269656e206c6f6e67756520706f7572206e6520706c7573207574696c6973657220646520736f6c7574696f6e732070726f707269c3a97461697265732c206d616973206f6e2064657672616974207920617272697665722c206e6f6ec2a03f3c2f703e0a3c703e3c696d67207372633d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f7075626c69632f5f696d672f6672616d61626c6f672f706c65696e4c6573506f636865732e706e672220616c743d226672616d61736f667420706c65696e206c657320706f636865732220636c6173733d22633122207469746c653d226672616d61736f667420706c65696e206c657320706f6368657322202f3e3c6272202f3e3c6120687265663d22687474703a2f2f6672616d616c61622e6f72672f676b6e642d63726561746f722f223e6861636b657a2047c3a967c3a9c2a0213c2f613e3c2f703e0a, 1),
102(2, 'wallabag/wallabag', 'https://github.com/wallabag/wallabag', 0, 0, 0x3c7370616e20636c6173733d226e616d65223e524541444d452e6d643c2f7370616e3e3c703e77616c6c6162616720697320612073656c6620686f737461626c65206170706c69636174696f6e20616c6c6f77696e6720796f7520746f206e6f74206d69737320616e7920636f6e74656e7420616e796d6f72652e20436c69636b2c20736176652c2072656164206974207768656e20796f752063616e2e20497420657874726163747320636f6e74656e7420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c703e4d6f726520696e666f726d6174696f6e73206f6e206f757220776562736974653a203c6120687265663d22687474703a2f2f77616c6c616261672e6f7267223e77616c6c616261672e6f72673c2f613e3c2f703e0a3c68323e3c6120636c6173733d22616e63686f722220687265663d2268747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c61626167236c6963656e7365223e3c2f613e4c6963656e73653c2f68323e0a3c703e436f7079726967687420c2a920323031302d32303134204e69636f6c6173204cc59375696c6c6574203c6120687265663d226d61696c746f3a6e69636f6c6173406c6f6575696c6c65742e6f7267223e6e69636f6c6173406c6f6575696c6c65742e6f72673c2f613e205468697320776f726b20697320667265652e20596f752063616e2072656469737472696275746520697420616e642f6f72206d6f6469667920697420756e64657220746865207465726d73206f662074686520446f205768617420546865204675636b20596f752057616e7420546f205075626c6963204c6963656e73652c2056657273696f6e20322c206173207075626c69736865642062792053616d20486f63657661722e205365652074686520434f5059494e472066696c6520666f72206d6f72652064657461696c732e3c2f703e0a, 1),
103(3, 'a self hostable application for saving web pages | wallabag', 'https://www.wallabag.org/', 0, 1, 0x0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e77616c6c616261672028666f726d65726c7920706f636865292069732061203c7374726f6e673e73656c6620686f737461626c65206170706c69636174696f6e20666f7220736176696e67207765622070616765733c2f7374726f6e673e2e20556e6c696b65206f746865722073657276696365732cc2a077616c6c6162616720697320667265652028617320696e2066726565646f6d2920616e64206f70656e20736f757263652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e576974682074686973206170706c69636174696f6e20796f752077696c6c206e6f74206d69737320636f6e74656e7420616e796d6f72652e203c7374726f6e673e436c69636b2c20736176652c2072656164206974207768656e20796f752077616e743c2f7374726f6e673e2e2049742073617665732074686520636f6e74656e7420796f752073656c65637420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3620636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c68323e486f7720697420776f726b733c2f68323e0a3c703e5468616e6b7320746f2074686520626f6f6b6d61726b6c6574206f72203c61207469746c653d22446f776e6c6f6164732220687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f646f776e6c6f6164732f223e74686972642d7061727479206170706c69636174696f6e733c2f613e2c20796f75207361766520616e2061727469636c6520696e20796f7572c2a077616c6c6162616720746f2072656164206974206c617465722e205468656e2c207768656e20796f75206f70656e20796f75722077616c6c616261672c203c7374726f6e673e796f752063616e20636f6d666f727461626c79207265616420796f75722061727469636c65733c2f7374726f6e673e2e3c2f703e0a3c68323e486f7720746f207573652077616c6c616261673c2f68323e0a3c703e5468657265206172652074776f207761797320746f207573652077616c6c616261673a20796f752063616e203c6120687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f6672657175656e746c792d61736b65642d7175657374696f6e732f23486f775f63616e5f495f696e7374616c6c5f77616c6c616261675f616e645f776861745f6172655f7468655f726571756972656d656e7473223e696e7374616c6c2069743c2f613ec2a06f6e20796f75722077656220736572766572206f7220796f752063616ec2a03c6120687265663d22687474703a2f2f6170702e696e746865706f6368652e636f6d223e63726561746520616e206163636f756e743c2f613ec2a06174204672616d616261672028776520696e7374616c6c20616e642075706772616465c2a077616c6c6162616720666f7220796f75292e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a, 1);";
ca056e7f
TC
104 $moreQueries[] = "INSERT INTO `tags` (`id`, `value`) VALUES (1, 'opensource');";
105 $moreQueries[] = "INSERT INTO `tags_entries` (`id`, `entry_id`, `tag_id`) VALUES (1, 2, 1);";
86edff44 106
ca056e7f
TC
107 $sql_structure = file_get_contents('install/mysql.sql');
108 }
109 else if ($_POST['db_engine'] == 'postgres') {
110 $db_path = 'pgsql:host=' . $_POST['pg_server'] . ';dbname=' . $_POST['pg_database'];
111 $content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['pg_server']."');", $content);
112 $content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['pg_database']."');", $content);
113 $content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['pg_user']."');", $content);
114 $content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['pg_password']."');", $content);
115 $handle = new PDO($db_path, $_POST['pg_user'], $_POST['pg_password']);
116
117 $moreQueries[] = "INSERT INTO entries (title, url, is_read, is_fav, content, user_id) VALUES
3dca040a 118('Framabag, un nouveau service libre et gratuit', 'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur', false, false, convert_from(decode('3c68323e556e6520696e74657276696577206465204e69636f6c61732c20736f6e2064c3a976656c6f70706575722e3c2f68323e0a3c703e3c656d3e496c206e6520766f757320612073c3bb72656d656e742070617320c3a96368617070c3a920717565206e6f74726520636f6e736f6d6d6174696f6e20646520636f6e74656e75732064752057656220657374207465727269626c656d656e74206368726f6e6f706861676520657420706172746963756c69c3a872656d656e7420667275737472616e746520746f757420c3a0206c6120666f6973c2a03a206e6f6e207365756c656d656e74206e6f757320706173736f6e732062656175636f7570202874726f70c2a03f292064652074656d707320656e206c69676e6520c3a0206578706c6f726572206c6573206d696e6573206175726966c3a8726573206465206c6120746f696c652c20792064c3a974656374616e742070c3a970697465732065742066696c6f6e732c206d616973206e6f757320736f6d6d657320737572746f757420636f6e7374616d6d656e7420656e206d616e7175652e204dc3aa6d65207369206e6f7573206e6520736f6d6d6573207061732064616e73206c65207a617070696e67206672c3a96ec3a9746971756520736920666163696c656d656e742064c3a96e6f6e63c3a920706172206c657320646f637465732070737963686f6c6f677565732071756920706f6e74696669656e7420737572206c65732064616e67657273206475206e756dc3a9726971756520706f7572206c6573206a65756e65732063657276656c6c65732c20696c206e6f7573207669656e7420736f7576656e74206c6520676fc3bb7420616d6572206465206ce28099696e6163686576c3a9c2a03a20706173206c652074656d707320646520746f7574206c69726520283c6120687265663d22687474703a2f2f66722e77696b74696f6e6172792e6f72672f77696b692f544c4452223e544c3b44523c2f613e2065737420646576656e75206c6520636c696e2064e28099c593696c206d692d6669677565206d692d72616973696e2064e28099756e652067c3a96ec3a9726174696f6e206465206c65637465757273207072657373c3a973292c207061732074726f70206c652074656d70732064652072c3a9666cc3a963686972206e6f6e20706c75732068c3a96c61732c20706173206c652074656d707320646520737569767265206c6120726962616d62656c6c65206465206c69656e73206173736f6369c3a97320c3a020756e2061727469636c65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e506f7572206e6f757320646f6e6e657220626f6e6e6520636f6e736369656e63652c206e6f75732072616e67656f6e73207363727570756c657573656d656e7420756e206d61727175652d7061676520646520706c75732064616e7320756e20736f75732d646f73736965722071756920656e20636f6d706f7274652064c3a96ac3a0203235362c206e6f7573206e6f746f6e7320756e20c3a96cc3a96d656e7420646520706c75732064616e73206c6120746f756a6f757273207269646963756c656d656e74206c6f6e67756520746f75646f756c697374652c2062726566206e6f75732072656d6574746f6e7320c3a020706c757320746172642c2063e280996573742dc3a02d64697265206c6520706c757320736f7576656e742061757820696e74726f757661626c65732063616c656e6465732067726563717565732c206c6520736f696e206465206c69726520767261696d656e7420756e2061727469636c65206a7567c3a920696e74c3a972657373616e742c20646520726567617264657220756e6520766964c3a96f207369676e616cc3a96520706172206c65732072c3a97a6f73736f63696f732c206465206c69726520756e20636861706974726520656e746965722064e28099756e206f75767261676520646973706f6e69626c6520656e206c69676e65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e416c6f7273206269656e2073c3bb722c20c3a02064c3a966617574206465206e6f757320646f6e6e657220746f7574206c652074656d70732071756920736572616974206ec3a963657373616972652c2064657320736f6c7574696f6e73206578697374656e7420706f7572206e6f7573207065726d657474726520646520c2abc2a06c69726520706c75732074617264c2a0c2bb20656e20736175766567617264616e74206c65207072c3a9636965757820706f6c6c656e206465206e6f7320627574696e61676573206465207369746520656e20736974652c2065742064e28099656e20666169726520756c74c3a97269657572656d656e7420766f747265206d69656cc2a03b2063e280996573742062656c20657420626f6e206d616973206c65732072756368657320736f6e7420756e207065752064697374616e7465732c20c3a7612073e28099617070656c6c65206c6520636c6f756420286e6f7320616d69732074656368696573206de280996f6e74206269656e206578706c697175c3a9206d616973206ae280996169207365756c656d656e7420636f6d70726973207175652064657320747275637320c3a0206d6f6920736f6e742073757220646573206d616368696e6573206c6f696e7461696e65732c20c3a761206e65206d652072617373757265207061732074726f702920657420656c6c657320736f6e7420736f7576656e742070726f707269c3a97461697265732c206e65206c61697373616e7420656e7472657220717565206c6573203c733e7574696c69736174657572733c2f733e20636f6e736f6d6d61746575727320706179616e74732065742071756920636f6e73656e74656e7420c3a0206c6575727320636f6e646974696f6e732e2053616e7320636f6d70746572207175652064652067726f7320626f7572646f6e73207669656e6e656e742070726f666974657220706c7573206f75206d6f696e73206469736372c3a874656d656e7420646520746f757465732063657320747261636573206465206e6f75732d6dc3aa6d657320717569207065726d657474656e74206465206d6f6ec3a97469736572206e6f7472652070726f66696cc2a03a207369206a6520636f6c6c65637465207375722063657320736572766963657320286e65206c6573206e6f6d6d6f6e73207061732c206a757374656d656e742920756e652073c3a97269652064e2809961727469636c657320737572206ce280996964c3a965206465204e6174757265206368657a2044696465726f742c206a6520726563657672616920646976657273657320736f6c6c696369746174696f6e7320706f757220646576656e697220636c69656e74206465206c6120626f757469717565204e61747572652026616d703b2044c3a9636f75766572746520647520626f756c65766172642044696465726f742e2045742073692064e280996176656e74757265206c65732070726f6772616d6d6573206465206c61204e5341206d6f756c696e656e7420737572206c6520736572766963652c206a6520736572616920706575742dc3aa74726520756e206a6f75722064616e7320756e65206c6973746520646573206d696c6974616e7473206e61747572697374657320696e64c3a973697261626c657320737572206c657320766f6c73206465206c612050616e416d20286a65206e65207361697320706c75732074726f70207369206a6520706c616973616e7465206cc3a02c2066696e616c656d656e74e280a6293c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4c6120626f6e6e65206964c3a965c2a03a20c2abc2a0736520636f6e7374697475657220756e2072c3a9736572766f697220646520646f63756d656e74732073c3a96c656374696f6e6ec3a97320c3a020706172636f7572697220706c75732074617264c2a0c2bb20617070656c61697420646f6e6320756e6520617574726520626f6e6e65206964c3a9652c2063656c6c652064e2809961766f6972206c6520636f6e7472c3b46c652064652063652072c3a9736572766f69722c206465206e6f74726520636f6c6c656374696f6e20706572736f6e6e656c6c652e2043e28099657374204e69636f6c6173204cc59375696c6c65742c2063692d646573736f757320696e74657276696577c3a92c207175692073e28099792065737420636f6c6cc3a9206176656320756e652062656c6c65206170706c69636174696f6e20617070656cc3a96520657568e280a6206f75692c20617070656cc3a9652057616c6c616261672e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4672616d61736f667420736f757469656e742064e28099617574616e7420706c757320736f6e20696e6974696174697665207175e280993c6120687265663d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f696e6465782e7068702f706f73742f323031342f30312f33312f4765656b74696f6e6e6572642d57616c6c61626167223e6f6e206c7569206120636865726368c3a920646573206d6973c3a872657320706f757220756e6520686973746f697265206465206e6f6d3c2f613e206574207175e28099696c2065737420706f737369626c652064e28099696e7374616c6c657220736f692d6dc3aa6d6520756e6520636f7069652064652057616c6c616261672073757220736f6e2070726f70726520736974652e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4c6520706574697420706c7573206465204672616d61736f66742c2072c3a97365617520746f756a6f7572732064c3a973697265757820646520766f75732070726f706f7365722064657320616c7465726e617469766573206c6962c3a972617472696365732c2063e2809965737420646520766f75732070726f706f736572202873757220696e736372697074696f6e207072c3a9616c61626c652920756e20616363c3a873206175204672616d616261672c2061757472656d656e742064697420766f7472652057616c6c616261672073757220756e2073657276657572204672616d612a2061766563206e6f74726520676172616e74696520646520636f6e666964656e7469616c6974c3a92e20436f6d6d6520706f7572206c65204672616d616e6577732c206e6f757320766f7573206163637565696c6c6f6e7320766f6c6f6e74696572732064616e73206c61206c696d697465206465206e6f732063617061636974c3a9732c20656e20766f757320696e766974616e7420c3a020766f7573206c616e6365722064616e7320766f747265206175746f2d68c3a962657267656d656e742064652057616c6c616261672e3c6272202f3e4365742061727469636c65206573742074726f70206c6f6e67c2a03f204d657474657a2d6c652064616e73203c6120687265663d22687474703a2f2f7777772e6672616d616261672e6f72672f696e6465782e706870223e766f747265204672616d616261673c2f613e20657420686f702e3c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e4672616d61626c6f67c2a03a2053616c7574204e69636f6c6173e280a62054752070657578207465207072c3a973656e74657220627269c3a876656d656e74c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e53616c7574c2a0212044c3a976656c6f70706575722050485020646570756973207175656c7175657320616e6ec3a96573206d61696e74656e616e742028313020616e73292c206ae28099616920766f756c75206d652072656d657474726520c3a0206e697665617520746563686e697175656d656e74207061726c616e742028646570756973203320616e732c206ae28099616920706173206d616c206cc3a26368c3a9206c6520636c6176696572292e20506f7572206d6573206265736f696e7320706572736f732c206ae28099616920646f6e63206372c3a9c3a920756e2070657469742070726f6a657420706f75722072656d706c6163657220756e6520736f6c7574696f6e2070726f707269c3a97461697265206578697374616e74652e2053616e7320617563756e65207072c3a974656e74696f6e2c206ae2809961692068c3a962657267c3a92063652070726f6a6574207375722047697468756220657420636f6d6d652063e28099657374206c61207365756c6520736f6c7574696f6e203c656d3e6f70656e20736f757263653c2f656d3e20646520636520747970652c206c65206e6f6d62726520646520706572736f6e6e657320696e74c3a972657373c3a965732061206175676d656e74c3a920e280a63c2f703e0a3c703e3c656d3e4c6573207574696c6973617465757273206465207365727669636573204672616d61736f6674206e65206c6520736176656e742070617320666f7263c3a96d656e742c206d6169732074752061732064c3a96ac3a020706173206d616c207061727469636970c3a920c3a0206c61204672616d6147616c617869652c206e6f6ec2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e456e2065666665742e204ae28099616920636f6d6d656e63c3a920756e20706c7567696e20706f7572204672616d616e6577732c203c6120687265663d2268747470733a2f2f6769746875622e636f6d2f6e69636f736f6d622f74747273732d70757267652d6163636f756e7473223e74747273732d70757267652d6163636f756e74733c2f613e2c20717569207065726d6574206465206e6574746f796572206c61206261736520646520646f6e6ec3a9657320646520636f6d7074657320706c7573207574696c6973c3a9732e204d616973206365203c656d3e706c7567696e3c2f656d3e2061206265736f696e2064e28099c3aa747265207465726d696ec3a920c3a0203130302520706f757220c3aa74726520696e74c3a96772c3a9206175207365696e206465204672616d616e6577732028657420646f6e632064652054696e792054696e7920525353292c207369207175656c7175e28099756e20736f756861697465206de2809961696465722c20696c206ee2809979206120617563756e20736f7563692e3c6272202f3e4ae28099616920617573736920666169742031206f7520322061707061726974696f6e732064616e73206465732074726164756374696f6e7320706f7572204672616d61626c6f672e205269656e2064e2809965787472616f7264696e616972652c206a65206e652073756973207061732062696c696e6775652c20c3a761206d65207065726d6574206465206de28099656e747261c3ae6e65722e3c2f703e0a3c703e3c656d3e5061726c6f6e73206465207375697465206465206365207175692066c3a2636865c2a03a20746f6e206170706c69636174696f6e2057616c6c616261672c20656c6c652073e28099617070656c6c6169742070617320e2809c506f636865e2809d2c206176616e74c2a03f205475206e6f7573207261636f6e746573206ce28099686973746f697265c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e45756820656e20656666657420e280a62044c3a96ac3a02c20706f757271756f69203c656d3e706f6368653c2f656d3ec2a03f20506172636520717565206ce28099756e206465732074726f697320c2abc2a074c3a96e6f7273c2a0c2bb20737572206c65206d61726368c3a92073e28099617070656c6c65203c656d3e506f636b65743c2f656d3e2e20436f6d6d65206d6f6e206170706c69206ee28099c3a9746169742064657374696ec3a965207175e28099c3a0206d6f6e20757361676520706572736f6e6e656c2061752064c3a9706172742c206a65206e65206d6520737569732070617320746f72747572c3a9206269656e206c6f6e6774656d70732e3c2f703e0a3c703e43657420c3a974c3a92c206f6e2061206661696c6c69206368616e676572206465206e6f6d2c207175616e6420696c2079206120657520646520706c757320656e20706c75732064e280997574696c69736174657572732e2045742070756973206f6e2073e28099657374206469742071756520706f6368652c2063e28099c3a97461697420706173206d616c2c20c3a76120736f6e6e616974206269656e206672616ec3a761697320657420707569732061766563206c6573207175656c717565732064697a61696e65732064e280997574696c69736174657572732c206f6e206e652067c3aa6e657261697420706572736f6e6e652e3c2f703e0a3c703e43e280996573742073616e7320636f6d707465722061766563206c657320736f6369c3a974c3a97320616dc3a972696361696e6573206574206c6575722066c3a2636865757365206d616e696520646520766f756c6f697220656e766f796572206c657572732061766f6361747320c3a020746f757420626f7574206465206368616d702e204c65203233206a616e766965722c206ae280996169207265c3a77520756e20656d61696c206465206c61207061727420647520636162696e65742064e2809961766f6361747320646520506f636b6574206d652064656d616e64616e74206465206368616e676572206c65206e6f6d2c206c65206c6f676f2c206465206e6520706c7573207574696c69736572206c65207465726d6520e2809c726561642d69742d6c61746572e2809d2028c2abc2a06c6973657a206c6520706c75732074617264c2a0c2bb29206574206465206e6520706c757320646972652071756520506f636b6574206ee280996573742070617320677261747569742028746f7574206573742070617274692064e280993c6120687265663d2268747470733a2f2f747769747465722e636f6d2f77616c6c616261676170702f7374617475732f343233373836333635393434323235373932223e756e2074776565743c2f613e206fc3b9206a65207175616c6966696520506f636b657420646520c2abc2a06e6f6e2066726565c2a0c2bb20c3a0207361766f6972206e6f6e206c69627265292e20427265662c206dc3aa6d65207369206a652073656d626c6169732064616e73206d6f6e2064726f69742c206ae280996169207175616e64206dc3aa6d652070726973206c612064c3a9636973696f6e206465206368616e676572206465206e6f6d2065742057616c6c6162616720657374206ec3a92c20737569746520617578203c6120687265663d22687474703a2f2f6672616d61646174652e6f72672f73747564732e7068703f736f6e646167653d6c6c6370366f6a70796339706b6c6861223e64697a61696e65732064652070726f706f736974696f6e73206465206e6f6d207265c3a77565733c2f613e2e2043e2809965737420756e206dc3a96c616e676520656e747265206c652077616c6c61627920286465206c612066616d696c6c6520646573206b616e676f75726f75732c207175692073746f636b656e742064616e73206c65757220706f63686520636520717569206c65757220657374206368657229206574203c656d3e6261673c2f656d3e20286c6573207465726d657320736163202f207361636f636865202f2062657361636520736f6e7420c3a96e6f726dc3a96d656e7420726576656e7573292e204d616973206d61696e74656e616e742c206f6e207661206465206ce280996176616e742c20706c75732064652074656d707320c3a020706572647265206176656320c3a7612c206f6e2061206475207061696e20737572206c6120706c616e6368652e3c6272202f3e3c696d67207372633d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f7075626c69632f5f696d672f6672616d61626c6f672f77616c6c6162795f626162792e6a70672220616c743d2277616c6c61627920617665632062c3a962c3a92064616e7320736120706f6368652220636c6173733d22633122207469746c653d2277616c6c61627920617665632062c3a962c3a92064616e7320736120706f63686522202f3e206372c3a96469742070686f746f203c6120687265663d22687474703a2f2f7777772e666c69636b722e636f6d2f70686f746f732f3236373832383634404e30302f353032373230323233342f696e2f70686f746f6c6973742d3845654a35412d6831544c36762d4e454c38312d636e4e6b536f2d39594d3174762d374b636736622d387a70416f612d61315a4c4d4e2d39594d3339722d3768355341442d38456548664c2d3845654677752d647456776e4d2d38756f4d45312d4a457a58652d47713471792d3932564a50522d43786531762d38483344324a2d61315a464e732d395937324b362d38456547784c2d354c353346782d354e6b454e732d3555384354592d354e6b7373682d6e6b6176462d3943726777502d3773644341612d647566324b682d685a65707a792d685a645531652d685a656f66462d685a656b44672d685a656741592d685a654d5a6e2d6a61486741662d3850383744322d354e677152762d6154343851422d685a645634592d685a654336342d45526770732d3556594747642d3556594a42312d354e6b72466b2d364a786837682d3768395075512d4552664d782d6831553169682d683155534278223e57696c6c69616d2057617262793c2f613e20717569206175746f72697365206578706c69636974656d656e7420746f7574652072c3a97574696c69736174696f6e2e3c2f703e0a3c703e3c656d3e426f6e2c20616c6f7273206578706c697175652d6d6f6920636520717565206a65207661697320706f75766f69722066616972652061766563204672616d61626167e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e416c6f7273204672616d616261672c20c3a761207465207065726d6574206465207465206372c3a9657220756e20636f6d7074652067726174756974656d656e74206574206c696272656d656e7420706f757220706f75766f6972207574696c697365722057616c6c616261672e205365756c6520746f6e206164726573736520656d61696c20657374206ec3a963657373616972652c206f6e207365206368617267652064e28099696e7374616c6c6572206574206465206d657474726520c3a0206a6f75722057616c6c6162616720706f757220746f692e20547520706575782064e2809961696c6c657572732070726f6669746572203c6120687265663d22687474703a2f2f7777772e6672616d61736f66742e6e65742f23746f705067436c6f7564223e64e280996175747265732073657276696365732070726f706f73c3a97320706172204672616d61736f6674206963693c2f613e2e3c2f703e0a3c703ec380206365206a6f75722c20696c207920612038333420636f6d70746573206372c3a9c3a97320737572204672616d616261672e3c2f703e0a3c703e3c656d3e566f7573206176657a20767261696d656e7420636f6ec3a7752063652073657276696365206166696e207175e280996f6e20707569737365206ce280997574696c69736572206176656320756e206d6178696d756d2064e280996f7574696c732c206e6f6ec2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4175746f7572206465206ce280996170706c69636174696f6e207765622c20696c206578697374652064c3a96ac3a020646573206170706c69636174696f6e7320706f757220736d61727470686f6e65732028416e64726f69642065742057696e646f77732050686f6e65292c2064657320657874656e73696f6e732046697265666f7820657420476f6f676c65204368726f6d652e3c2f703e0a3c703e436f6d6d652057616c6c6162616720706f7373c3a864652064657320666c7578205253532c2063e2809965737420666163696c65206465206c697265206c65732061727469636c657320736175766567617264c3a97320737572207361206c697365757365202873692063656c6c652d6369207065726d6574206465206c6972652064657320666c757820525353292e2043616c696272652028c2abc2a06c6f67696369656c206465206c6563747572652c2064652067657374696f6e206465206269626c696f7468c3a87175657320657420646520636f6e76657273696f6e206465206669636869657273206e756dc3a972697175657320646520747970652065626f6f6b206f75206c6976726520c3a96c656374726f6e69717565c2a0c2bb2c6e6f757320646974207562756e74752d66722e6f72672920696e74c3a867726520646570756973207175656c717565732073656d61696e6573206d61696e74656e616e74206c6120706f73736962696c6974c3a92064652072c3a9637570c3a9726572206c65732061727469636c6573206e6f6e206c75732c20707261746971756520706f757220666169726520756e20666963686965722065507562c2a0213c2f703e0a3c703e44e28099617574726573206170706c69636174696f6e7320776562207065726d657474656e74206ce28099696e74c3a967726174696f6e20617665632057616c6c61626167202846726573685253532c204c6565642065742054696e792054696e792052535320706f7572206c657320616772c3a96761746575727320646520666c7578292e204ce2809941504920717569207365726120646973706f6e69626c652064616e73206c612070726f636861696e652076657273696f6e2064652057616c6c61626167207065726d657474726120656e636f726520706c75732064e28099696e74657261637469766974c3a92e3c2f703e0a3c703e3c656d3e5920612d742d696c20756e206d6f6465206465206c65637475726520686f7273206c69676e65206f75206573742d6365207175652063e28099657374207072c3a9767520706f7572206c65732070726f636861696e65732076657273696f6e73c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e496c2079206120756e2070736575646f206d6f646520686f7273206c69676e652c20646973706f6e69626c652061766563206ce280996170706c69636174696f6e20416e64726f69642e204f6e20706575742072c3a9637570c3a9726572202876696120756e20666c75782052535329206c65732061727469636c6573206e6f6e206c757320717565206ce280996f6e206120736175766567617264c3a9732e20556e6520666f69732064c3a9636f6e6e656374c3a92c206f6e207065757420636f6e74696e75657220c3a0206c6972652073757220736f6e20736d61727470686f6e65206f75207361207461626c65747465206c65732061727469636c65732e2050617220636f6e7472652c20696c206d616e7175652064657320666f6e6374696f6e6e616c6974c3a973c2a03a207175616e64207475206d61727175657320756e2061727469636c6520636f6d6d65206c752c206365206ee28099657374207061732073796e6368726f6e6973c3a92061766563206c612076657273696f6e207765622064652057616c6c616261672e204ae28099657370c3a8726520717565206a652073756973207072657371756520636c6169722064616e73206d6573206578706c69636174696f6e732e3c2f703e0a3c703e506f7572206c612076322c20717569206573742064c3a96ac3a020656e20636f7572732064652064c3a976656c6f7070656d656e742c206fc3b9206a652073756973206269656e20616964c3a9207061722056696e63656e74204a6f757373652c206f6e2061757261206c6120706f73736962696c6974c3a92064e2809961766f697220756e2076726169206d6f646520686f7273206c69676e652e3c2f703e0a3c703e3c656d3e416c6f7273207369206f6e2076657574206169646572202f2070617274696369706572202f20747269666f75696c6c6572206c6520636f6465202f20766f757320656e766f79657220646573207265746f7572732c206f6e206661697420636f6d6d656e74c2a03f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4f6e207065757420616964657220646520706c75736965757273206661c3a76f6e73c2a03a3c2f703e0a3c756c3e3c6c693e7574696c697365722077616c6c61626167206574206e6f75732072656d6f6e746572206c65732070726f626cc3a86d65732072656e636f6e7472c3a973c2a03b3c2f6c693e0a3c6c693e706172746963697065722061752064c3a976656c6f7070656d656e74206465206ce280996170706c69636174696f6e2068747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c616261672053692053696c6578202f2053796d666f6e7932202f2048544d4c35202f206574632e207465207061726c656e742c206ee2809968c3a97369746520706173c2a0213c2f6c693e0a3c6c693e636f6d6d6520746f75742070726f6a65742c206c652067726f7320706f696e74206e6f697220657374206c65206d616e71756520646520646f63756d656e746174696f6e2e203c6120687265663d22687474703a2f2f646f632e77616c6c616261672e6f7267223e456c6c652065737420646973706f206963693c2f613e206d61697320696c206d616e71756520706c65696e2064652063686f73657320657420746f7574206ee280996573742070617320c3a0206a6f7572c2a03b3c2f6c693e0a3c6c693e7061726c65722064652057616c6c61626167206175746f757220646520766f7573c2a03b3c2f6c693e0a3c6c693e696c20657869737465203c6120687265663d2268747470733a2f2f666c617474722e636f6d2f7468696e672f313236353438302f706f6368652d612d726561642d69742d6c617465722d6f70656e2d736f757263652d73797374656d223e756e20636f6d70746520466c617474723c2f613e2e3c2f6c693e0a3c2f756c3e3c703e3c656d3e4c65206d6f74206465206c612066696ee280a63f3c6272202f3e3c2f656d3e3c2f703e0a3c703e4d6572636920c3a0204672616d61736f66742064e280996163637565696c6c697220657420646520736f7574656e69722057616c6c61626167c2a0213c2f703e0a3c703e4c6120726f7574652065737420656e636f7265206269656e206c6f6e67756520706f7572206e6520706c7573207574696c6973657220646520736f6c7574696f6e732070726f707269c3a97461697265732c206d616973206f6e2064657672616974207920617272697665722c206e6f6ec2a03f3c2f703e0a3c703e3c696d67207372633d22687474703a2f2f7777772e6672616d61626c6f672e6f72672f7075626c69632f5f696d672f6672616d61626c6f672f706c65696e4c6573506f636865732e706e672220616c743d226672616d61736f667420706c65696e206c657320706f636865732220636c6173733d22633122207469746c653d226672616d61736f667420706c65696e206c657320706f6368657322202f3e3c6272202f3e3c6120687265663d22687474703a2f2f6672616d616c61622e6f72672f676b6e642d63726561746f722f223e6861636b657a2047c3a967c3a9c2a0213c2f613e3c2f703e0a', 'hex'), 'UTF8'), 1),
119('wallabag/wallabag', 'https://github.com/wallabag/wallabag', false, false, convert_from(decode('3c7370616e20636c6173733d226e616d65223e524541444d452e6d643c2f7370616e3e3c703e77616c6c6162616720697320612073656c6620686f737461626c65206170706c69636174696f6e20616c6c6f77696e6720796f7520746f206e6f74206d69737320616e7920636f6e74656e7420616e796d6f72652e20436c69636b2c20736176652c2072656164206974207768656e20796f752063616e2e20497420657874726163747320636f6e74656e7420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c703e4d6f726520696e666f726d6174696f6e73206f6e206f757220776562736974653a203c6120687265663d22687474703a2f2f77616c6c616261672e6f7267223e77616c6c616261672e6f72673c2f613e3c2f703e0a3c68323e3c6120636c6173733d22616e63686f722220687265663d2268747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c61626167236c6963656e7365223e3c2f613e4c6963656e73653c2f68323e0a3c703e436f7079726967687420c2a920323031302d32303134204e69636f6c6173204cc59375696c6c6574203c6120687265663d226d61696c746f3a6e69636f6c6173406c6f6575696c6c65742e6f7267223e6e69636f6c6173406c6f6575696c6c65742e6f72673c2f613e205468697320776f726b20697320667265652e20596f752063616e2072656469737472696275746520697420616e642f6f72206d6f6469667920697420756e64657220746865207465726d73206f662074686520446f205768617420546865204675636b20596f752057616e7420546f205075626c6963204c6963656e73652c2056657273696f6e20322c206173207075626c69736865642062792053616d20486f63657661722e205365652074686520434f5059494e472066696c6520666f72206d6f72652064657461696c732e3c2f703e0a', 'hex'), 'UTF8'), 1),
120('a self hostable application for saving web pages | wallabag', 'https://www.wallabag.org/', false, true, convert_from(decode('3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e77616c6c616261672028666f726d65726c7920706f636865292069732061203c7374726f6e673e73656c6620686f737461626c65206170706c69636174696f6e20666f7220736176696e67207765622070616765733c2f7374726f6e673e2e20556e6c696b65206f746865722073657276696365732cc2a077616c6c6162616720697320667265652028617320696e2066726565646f6d2920616e64206f70656e20736f757263652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e576974682074686973206170706c69636174696f6e20796f752077696c6c206e6f74206d69737320636f6e74656e7420616e796d6f72652e203c7374726f6e673e436c69636b2c20736176652c2072656164206974207768656e20796f752077616e743c2f7374726f6e673e2e2049742073617665732074686520636f6e74656e7420796f752073656c65637420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3620636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c68323e486f7720697420776f726b733c2f68323e0a3c703e5468616e6b7320746f2074686520626f6f6b6d61726b6c6574206f72203c61207469746c653d22446f776e6c6f6164732220687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f646f776e6c6f6164732f223e74686972642d7061727479206170706c69636174696f6e733c2f613e2c20796f75207361766520616e2061727469636c6520696e20796f7572c2a077616c6c6162616720746f2072656164206974206c617465722e205468656e2c207768656e20796f75206f70656e20796f75722077616c6c616261672c203c7374726f6e673e796f752063616e20636f6d666f727461626c79207265616420796f75722061727469636c65733c2f7374726f6e673e2e3c2f703e0a3c68323e486f7720746f207573652077616c6c616261673c2f68323e0a3c703e5468657265206172652074776f207761797320746f207573652077616c6c616261673a20796f752063616e203c6120687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f6672657175656e746c792d61736b65642d7175657374696f6e732f23486f775f63616e5f495f696e7374616c6c5f77616c6c616261675f616e645f776861745f6172655f7468655f726571756972656d656e7473223e696e7374616c6c2069743c2f613ec2a06f6e20796f75722077656220736572766572206f7220796f752063616ec2a03c6120687265663d22687474703a2f2f6170702e696e746865706f6368652e636f6d223e63726561746520616e206163636f756e743c2f613ec2a06174204672616d616261672028776520696e7374616c6c20616e642075706772616465c2a077616c6c6162616720666f7220796f75292e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a', 'hex'), 'UTF8'), 1)";
ca056e7f
TC
121 $moreQueries[] = "INSERT INTO tags (value) VALUES ('opensource')";
122 $moreQueries[] = "INSERT INTO tags_entries (entry_id, tag_id) VALUES (2, 1)";
792097fb 123
ca056e7f 124 $sql_structure = file_get_contents('install/postgres.sql');
792097fb 125 }
ca056e7f
TC
126 // create database structure
127 $query = $handle->exec($sql_structure);
128 } catch (PDOException $e) {
129 $errors[] = $e->getMessage();
130 $continue = false;
131 }
132 }
133 }
054c9d88
TC
134
135 $usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
136 if (!empty($usertest)) {
137 $continue = false;
138 $errors[] = "An user already exists with this username in database.";
139 }
140
141
ca056e7f
TC
142 if ($continue) {
143 $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
144 $params = array($username, $salted_password, $username);
145 $query = executeQuery($handle, $sql, $params);
792097fb 146
ca056e7f 147 $id_user = (int)$handle->lastInsertId('users_id_seq');
792097fb 148
ca056e7f
TC
149 $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
150 $params = array($id_user, 'pager', '10');
151 $query = executeQuery($handle, $sql, $params);
792097fb 152
ca056e7f
TC
153 $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
154 $params = array($id_user, 'language', 'en_EN.UTF8');
155 $query = executeQuery($handle, $sql, $params);
792097fb 156
ca056e7f
TC
157 foreach ($moreQueries as $query) {
158 executeQuery($handle, $query, array());
159 }
11ef4de5 160
86edff44 161
ca056e7f
TC
162 if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) {
163 $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.';
164 } else {
165 if ($_POST['db_engine'] != 'sqlite') {
166 $content = str_replace("define ('STORAGE', 'sqlite');", "define ('STORAGE', '".$_POST['db_engine']."');", $content);
167 file_put_contents('inc/poche/config.inc.php', $content);
792097fb 168 }
ca056e7f
TC
169 $content = str_replace("define ('SALT', '');", "define ('SALT', '".$salt."');", $content);
170 file_put_contents('inc/poche/config.inc.php', $content);
11ef4de5 171 $final = true;
792097fb
NL
172 }
173}
ca056e7f 174}
792097fb
NL
175?>
176<!DOCTYPE html>
177<html>
178 <head>
179 <meta name="viewport" content="initial-scale=1.0">
180 <meta charset="utf-8">
181 <!--[if IE]>
182 <meta http-equiv="X-UA-Compatible" content="IE=10">
183 <![endif]-->
d967a1fa 184 <title>wallabag - installation</title>
792097fb
NL
185 <link rel="shortcut icon" type="image/x-icon" href="themes/baggy/img/favicon.ico" />
186 <link rel="apple-touch-icon-precomposed" sizes="144x144" href="themes/baggy/img/apple-touch-icon-144x144-precomposed.png">
187 <link rel="apple-touch-icon-precomposed" sizes="72x72" href="themes/baggy/img/apple-touch-icon-72x72-precomposed.png">
188 <link rel="apple-touch-icon-precomposed" href="themes/baggy/img/apple-touch-icon-precomposed.png">
189 <link href='//fonts.googleapis.com/css?family=PT+Sans:700' rel='stylesheet' type='text/css'>
190 <link rel="stylesheet" href="themes/baggy/css/ratatouille.css" media="all">
191 <link rel="stylesheet" href="themes/baggy/css/font.css" media="all">
192 <link rel="stylesheet" href="themes/baggy/css/main.css" media="all">
193 <link rel="stylesheet" href="themes/baggy/css/messages.css" media="all">
194 <link rel="stylesheet" href="themes/baggy/css/print.css" media="print">
4eb71ab5 195 <script src="themes/_global/js/jquery-2.0.3.min.js"></script>
792097fb 196 <script src="themes/baggy/js/init.js"></script>
444f1406
TC
197
198
199 <style type="text/css">
200a {
201color:#000;
202text-decoration:underline;
203padding:0 1px;
204}
205a:hover {
206color:#fff;
207background-color:#333;
208text-decoration:none;
209padding:0 1px;
210}
211p {
212margin:0;
213padding:5px 0;
214}
215em {
216font-style:normal;
217background-color:#ffc;
218padding: 0.1em 0;
219}
220ul, ol {
221margin:10px 0 10px 20px;
222padding:0 0 0 15px;
223}
224ul li, ol li {
225margin:0 0 7px 0;
226padding:0 0 0 3px;
227}
228h2 {
229font-size:18px;
230padding:0;
231}
232h3 {
233font-size:16px;
234padding:0;
235margin:20px 0 5px 0;
236}
237h4 {
238font-size:14px;
239padding:0;
240margin:15px 0 5px 0;
241}
242code {
243font-size:1.1em;
244background-color:#f3f3ff;
245color:#000;
246}
247em strong {
248text-transform: uppercase;
249}
250table#chart {
251border-collapse:collapse;
252}
253table#chart th {
254background-color:#eee;
255padding:2px 3px;
256border:1px solid #fff;
257}
258table#chart td {
259text-align:center;
260padding:2px 3px;
261border:1px solid #eee;
262}
263table#chart tr.enabled td {
264/* Leave this alone */
265}
266table#chart tr.disabled td,
267table#chart tr.disabled td a {
268}
269table#chart tr.disabled td a {
270text-decoration:underline;
271}
272div.chunk {
273margin:20px 0 0 0;
274padding:0 0 10px 0;
275border-bottom:1px solid #ccc;
276}
277.footnote,
278.footnote a {
279font:10px/12px verdana, sans-serif;
280color:#aaa;
281}
282.footnote em {
283background-color:transparent;
284font-style:italic;
285}
286.good{
287background-color:#52CC5B;
288}
289.bad{
290background-color:#F74343;
291font-style:italic;
292font-weight: bold;
293}
294.pass{
295background-color:#FF9500;
296}
c1e90b9e
TC
297.detail {
298cursor: pointer;
444f1406 299}
dd0d7ad9
TC
300.descriptions {
301 margin-left: 10%;
302 position: relative;
303 top: 50%;
304}
305.database_inputs {
306 float: left;
307 width: 50%
308}
309.database_info {
310 width: 100%;
311 overflow: auto;
312}
22f19b23
TC
313.compatibity_result {
314 margin: auto;
8d7ec546 315 max-width: 350px;
22f19b23
TC
316 min-height: 50px;
317 line-height: 50px;
318 text-align: center;
11ef4de5
TC
319 margin-bottom: 30px;
320 border-radius: 3px;
22f19b23
TC
321}
322
323h2, legend {
324 font-size: 30px;
325 text-transform: uppercase;
326 font-family: "PT Sans",sans-serif;
327}
328
329legend:after {
330 content: "";
331 height: 4px;
332 width: 70px;
333 background-color: #000;
334 display: block;
335}
9834d87e
TC
336#reloadpage {
337cursor: pointer;
338background-color: #000;
339color: #FFF;
340padding: 0.5em 1em;
341display: inline-block;
342border: 1px solid #000;
343}
344#reloadpage:hover {
345 background-color: #FFF;
346 color: #000;
347}
11ef4de5
TC
348.final {
349 margin-top: 10%;
350 margin-left: 30%;
351 max-width: 400px;
352 text-align: center;
353 border-radius: 6px;
354}
355.final h1 {
356 line-height: 50px;
357}
358
359.final em {
360 margin-top: 40px;
361 font-size: 12px;
362}
444f1406
TC
363
364</style>
365
792097fb
NL
366 </head>
367 <body>
368 <header class="w600p center mbm">
369 <h1 class="logo">
370 <img width="100" height="100" src="themes/baggy/img/logo-w.png" alt="logo poche" />
371 </h1>
372 </header>
373 <div id="main">
374 <button id="menu" class="icon icon-menu desktopHide"><span>Menu</span></button>
375 <ul id="links" class="links">
976d6935
TC
376 <li><a href="docs/" target="_blank">Offline Doc</a></li>
377 <li><a href="http://doc.wallabag.org/" target="_blank">Online doc</a></li>
378 <li><a href="http://support.wallabag.org/" target="_blank">help</a></li>
379 <li><a href="http://www.wallabag.org/" target="_blank">wallabag.org</a></li>
11ef4de5
TC
380 </ul>
381 <?php if (!$final) : ?>
792097fb 382 <?php if (!empty($errors)) : ?>
d09a5674 383 <div class='messages error install'>
792097fb
NL
384 <p>Errors during installation:</p>
385 <p>
386 <ul>
387 <?php foreach($errors as $error) :?>
388 <li><?php echo $error; ?></li>
389 <?php endforeach; ?>
390 </ul>
391 </p>
392 <p><a href="index.php">Please reload</a> this page when you think you resolved these problems.</p>
393 </div>
394 <?php endif; ?>
395 <?php if (!empty($successes)) : ?>
d09a5674 396 <div class='messages success install'>
792097fb
NL
397 <p>
398 <ul>
399 <?php foreach($successes as $success) :?>
400 <li><?php echo $success; ?></li>
401 <?php endforeach; ?>
402 </ul>
403 </p>
404 </div>
d09a5674
NL
405 <?php else : ?>
406 <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
407 <div class='messages success install'>
408 <p>
8df90295
TC
409 <a href="index.php?clean=0">Click here to finish update.</a><br>
410 If it fails, just delete the install directory.
d09a5674 411 </p>
8df90295 412 <p>You may have to clear cache (by going into config screen) after update.</p>
d09a5674
NL
413 </div>
414 <?php endif; ?>
792097fb
NL
415 <?php endif; ?>
416 <p>To install wallabag, you just have to fill the following fields. That's all.</p>
976d6935 417
22f19b23
TC
418 <div>
419 <h2>Server compatibility test</h2>
420 <?php if (isOkay()) { ?>
421 <div class="compatibity_result detail good">All good</div>
422 <?php } elseif (isPassing()) { ?>
8d7ec546 423 <div class="compatibity_result detail pass">Some warnings, but the minimum is here !</div>
22f19b23
TC
424 <?php } else { ?>
425 <div class="compatibity_result detail bad">Bad news : you can't run wallabag</div>
8d7ec546 426 <?php } $status = status(); $pdo_drivers = pdoDrivers(); ?>
22f19b23 427 </div>
444f1406
TC
428
429 <div class="details">
430 <div>
c1e90b9e 431 <hr>
444f1406
TC
432 <h2 style="text-align:center;"><?php echo $status['app_name']; ?>: Compatibility Test</h2>
433 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="chart">
434 <thead>
435 <tr>
436 <th>Test</th>
437 <th>Should Be</th>
438 <th>What You Have</th>
439 <th>What it means</th>
440 </tr>
441 </thead>
442 <tbody>
443 <tr class="<?php echo ($status['php']) ? 'enabled' : 'disabled'; ?>">
444 <td>PHP</td>
445 <td>5.3.3 or higher</td>
446 <td class="<?php echo ($status['php']) ? 'good' : 'disabled'; ?>"><?php echo phpversion(); ?></td>
447 <td><?php echo ($status['php']) ? '<strong>PHP:</strong> You are running a supported version of PHP.' : '<strong>PHP:</strong> You are running an unsupported version of PHP. <strong>' . $status['app_name'] . ' will not work here.</strong>' ;?></td>
448 </tr>
449 <tr class="<?php echo ($status['pdo']) ? 'enabled' : 'disabled'; ?>">
450 <td><a href="http://php.net/manual/en/book.pdo.php">PDO</a></td>
451 <td>Enabled</td>
452 <?php echo ($status['pdo']) ? '<td class="good">Enabled</span>' : '<td class="bad">Disabled'; ?></td>
453 <td><?php echo ($status['pdo']) ? '<strong>PDO:</strong> You have PDO support enabled.' : '<strong>PDO:</strong> Your PHP installation doesn\'t support PHP PDO. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
454 </tr>
22f19b23
TC
455 <tr class="<?php echo ($status['pdo_drivers_passing']) ? 'enabled' : 'disabled'; ?>">
456 <td>PDO Drivers</td>
457 <td>One of the PDO drivers must be installed</td>
976d6935 458 <?php echo ($status['pdo_drivers_passing']) ? '<td class="good">At least one driver is enabled</span>' : '<td class="bad">No driver available'; ?></td>
22f19b23
TC
459 <td><?php echo ($status['pdo_drivers_passing']) ? '<strong>PDO:</strong> You have at least one PDO driver installed.' : '<strong>PDO Drivers:</strong> Your PHP installation doesn\'t have any PDO driver installed. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
460 </tr>
444f1406
TC
461 <tr class="<?php echo ($status['xml']) ? 'enabled' : 'disabled'; ?>">
462 <td><a href="http://php.net/xml">XML</a></td>
463 <td>Enabled</td>
464 <?php echo ($status['xml']) ? '<td class="good">Enabled, and sane</span>' : '<td class="bad">Disabled, or broken'; ?></td>
465 <td><?php echo ($status['xml']) ? '<strong>XML:</strong> You have XMLReader support or a version of XML support that isn\'t broken installed.' : '<strong>XML:</strong> Your PHP installation doesn\'t support XML parsing. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
466 </tr>
467 <tr class="<?php echo ($status['pcre']) ? 'enabled' : 'disabled'; ?>">
468 <td><a href="http://php.net/pcre">PCRE</a></td>
469 <td>Enabled</td>
470 <?php echo ($status['pcre']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
471 <td><?php echo ($status['pcre']) ? '<strong>PCRE:</strong> You have PCRE support installed.' : '<strong>PCRE:</strong> Your PHP installation doesn\'t support Perl-Compatible Regular Expressions. <strong>' . $status['app_name'] .' will not work here.</strong>' ?></td>
472 </tr>
473 <tr class="<?php echo ($status['zlib']) ? 'enabled' : 'disabled'; ?>">
474 <td><a href="http://php.net/zlib">Zlib</a></td>
475 <td>Enabled</td>
476 <?php echo ($status['zlib']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
477 <td><?php echo ($status['zlib']) ? '<strong>Zlib:</strong> You have <code>Zlib</code> enabled. This allows SimplePie to support GZIP-encoded pages.' : '<strong>Zlib:</strong> The <code>Zlib</code> extension is not available. SimplePie will ignore any GZIP-encoding, and instead handle pages as uncompressed text.' ?></td>
478 </tr>
479 <tr class="<?php echo ($status['mbstring']) ? 'enabled' : 'disabled'; ?>">
480 <td><a href="http://php.net/mbstring">mbstring</a></td>
481 <td>Enabled</td>
482 <?php echo ($status['mbstring']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
483 <td rowspan="2"><?php if(($status['mbstring']) && ($status['iconv'])) { ?><strong>mbstring and iconv:</strong> You have both <code>mbstring</code> and <code>iconv</code> installed! This will allow <?php echo $status['app_name']; ?> to handle the greatest number of languages.
484 <?php } elseif ($status['mbstring']) { ?><strong>mbstring:</strong> <code>mbstring</code> is installed, but <code>iconv</code> is not.
485 <?php } elseif ($status['iconv']) { ?><strong>iconv:</strong> <code>iconv</code> is installed, but <code>mbstring</code> is not.
486 <?php } else { ?><strong>mbstring and iconv:</strong> <em>You do not have either of the extensions installed.</em> This will significantly impair your ability to read non-English pages, as well as even some English ones.
487 <?php } ?>
488 </td>
489 </tr>
490 <tr class="<?php echo ($status['iconv']) ? 'enabled' : 'disabled'; ?>">
491 <td><a href="http://php.net/iconv">iconv</a></td>
492 <td>Enabled</td>
493 <?php echo ($status['iconv']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
494 </tr>
495 <tr class="<?php echo ($status['dom']) ? 'enabled' : 'disabled'; ?>">
496 <td><a href="http://php.net/manual/en/book.dom.php">DOM / XML extension</a></td>
497 <td>Enabled</td>
498 <?php echo ($status['dom']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
499 <td><?php echo ($status['dom']) ? '<strong>DOM/XML:</strong> You can parse <em>ini</em> files.' : '<strong>DOM/XML:</strong> Your PHP configuration isn\'t standard, you\'re missing PHP-DOM. You may try to install a package or recompile PHP. <strong>' . $status['app_name'] . ' will not work here.</strong>'; ?></td>
500 </tr>
501 <tr class="<?php echo ($status['filter']) ? 'enabled' : 'disabled'; ?>">
502 <td><a href="http://uk.php.net/manual/en/book.filter.php">Data filtering</a></td>
503 <td>Enabled</td>
504 <?php echo ($status['filter']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
505 <td><?php echo ($status['filter']) ? '<strong>Data filtering:</strong> You can use the PHP build-in DOM to operate on XML documents.' : '<strong>Data filtering:</strong> Your PHP configuration has the filter extension disabled. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
506 </tr>
507 <tr class="<?php echo ($status['gd']) ? 'enabled' : 'disabled'; ?>">
508 <td><a href="http://php.net/manual/en/book.image.php">GD</a></td>
509 <td>Enabled</td>
510 <?php echo ($status['gd']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
511 <td><?php echo($status['gd']) ? '<strong>GD:</strong> You have <code>GD</code> support installed.' : '<strong>GD:</strong> The <code>GD</code> extension is not available. ' . $status['app_name'] . ' will not be able to download pictures locally on your server.' ?></td>
512 </tr>
513 <tr class="<?php echo ($status['tidy']) ? 'enabled' : 'disabled'; ?>">
514 <td><a href="http://php.net/tidy">Tidy</a></td>
515 <td>Enabled</td>
516 <?php echo ($status['tidy']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
517 <td><?php echo ($status['tidy']) ? '<strong>Tidy:</strong> You have <code>Tidy</code> support installed.' : '<strong>Tidy:</strong> The <code>Tidy</code> extension is not available.' . $status['app_name'] . ' should still work with most pages, but you may experience problems with some. You can install it with <code>sudo apt-get install php5-tidy</code> and then reload Apache <code>sudo service apache2 reload</code>.' ; ?></td>
518 </tr>
519 <tr class="<?php echo ($status['curl']) ? 'enabled' : 'disabled'; ?>">
520 <td><a href="http://php.net/curl">cURL</a></td>
521 <td>Enabled</td>
522 <?php echo (extension_loaded('curl')) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
523 <td><?php echo ($status['curl']) ? '<strong>cURL:</strong> You have <code>cURL</code> support installed.' : '<strong>cURL:</strong> The <code>cURL</code> extension is not available. SimplePie will use <code>fsockopen()</code> instead.' ?></td>
524 </tr>
525 <tr class="<?php echo ($status['parse_ini']) ? 'enabled' : 'disabled'; ?>">
526 <td><a href="http://uk.php.net/manual/en/function.parse-ini-file.php">Parse ini file</td>
527 <td>Enabled</td>
528 <?php echo ($status['parse_ini']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
529 <td><?php echo ($status['parse_ini']) ? '<strong>Parse ini:</strong> You can parse <em>ini</em> files.' : '<strong>Parse ini files function :</strong> Bad luck : your webhost has decided to block the use of the <em>parse_ini_file</em> function. <strong>' . $status['app_name'] . ' will not work here.' ?></td>
530 </tr>
531 <tr class="<?php echo ($status['parallel']) ? 'enabled' : 'disabled'; ?>">
532 <td>Parallel URL fetching</td>
533 <td>Enabled</td>
534 <?php echo ($status['parallel']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
535 <td><?php echo ($status['parallel']) ? '<strong>Parallel URL fetching:</strong> You have <code>HttpRequestPool</code> or <code>curl_multi</code> support installed.' : '<strong>Parallel URL fetching:</strong> <code>HttpRequestPool</code> or <code>curl_multi</code> support is not available. ' . $status['app_name'] . ' will use <code>file_get_contents()</code> instead to fetch URLs sequentially rather than in parallel.' ?></td>
536 </tr>
537 <tr class="<?php echo ($status['allow_url_fopen']) ? 'enabled' : 'disabled'; ?>">
538 <td><a href="http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen">allow_url_fopen</a></td>
539 <td>Enabled</td>
af13787e
TC
540 <?php if ($status['allow_url_fopen']) { ?>
541 <td class="good">Enabled</td>
542 <td><strong>allow_url_fopen:</strong> You have allow_url_fopen enabled.
543 <?php } elseif ($status['curl']) { ?>
544 <td class="pass">Disabled</td>
545 <td><strong>allow_url_fopen</strong> is disabled, but curl is supported, so it should be ok.</td>
546 <?php } else { ?>
547 <td class="bad">Disabled</td>
548 <td><strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled.
549 <strong><?php echo $status['app_name']; ?> will not work here.</strong><?php } ?></td>
444f1406
TC
550 </tr>
551 <tr class="<?php echo ($status['gettext']) ? 'enabled' : 'disabled'; ?>">
552 <td><a href="http://php.net/manual/en/book.gettext.php">gettext</a></td>
553 <td>Enabled</td>
554 <?php echo ($status['gettext']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
555 <td><?php echo ($status['gettext']) ? '<strong>Gettext:</strong> You have <code>gettext</code> enabled.</em>' : '<strong>GetText:</strong> The <code>gettext</code> extension is not available. The system we use to display wallabag in various languages is not available. <strong>' . $status['app_name'] .' will not work here.</strong>' ?></td>
556 </tr>
557 </tbody>
558 </table>
22f19b23 559 <hr>
444f1406 560 </div>
444f1406
TC
561 <div class="details">
562 <?php //if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['iconv'] && $status['filter'] && $status['allow_url_fopen']) { ?>
563 <?php if (isOkay()) { ?>
564 <h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
565 <p><em>Your webhost has its act together!</em></p>
566 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $status['app_name']; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
567 <?php //} else if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['allow_url_fopen'] && $status['filter']) { ?>
568 <?php } else if (!isOkay() && isPassing()) { ?>
569 <h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
570 <p><em>For most pages, it'll run with no problems.</em> There are certain languages that you might have a hard time with though.</p>
571 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $status['app_name']; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
572 <?php } else { ?>
573 <h3>Bottom Line: We're sorry…</h3>
574 <p><em>Your webhost does not support the minimum requirements for <?php echo $status['app_name']; ?>.</em> It may be a good idea to contact your webhost and point them to the results of this test. They may be able to enable/install the required components.</p>
9834d87e 575 <p>If this is your own server and you think you have all the requirements installed, please get in touch with us.</p>
444f1406
TC
576 <?php } ?>
577 </div>
578
22f19b23
TC
579 <div class="chunk">
580 <p class="footnote">This compatibility test has been borrowed (and slightly adapted by <a href="http://fivefilters.org/content-only/">fivefilters.org</a>) from the one supplied by <a href="http://simplepie.org/">SimplePie.org</a>.</a></p>
581 </div>
444f1406 582 </div>
444f1406 583 <form method="post" class="technical">
9834d87e
TC
584 <hr>
585 <div class='twig'>
586 <h2>Twig installation</h2>
ca056e7f 587 <?php if (!is_dir('vendor')) : ?>
9834d87e
TC
588
589 <p>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:</p>
ca056e7f
TC
590 <ul>
591 <li>automatically download and extract vendor.zip into your wallabag folder.
592 <p><input type="submit" name="download" value="Download vendor.zip" /></p>
593 <?php if (!extension_loaded('zip')) : ?>
594 <b>Be careful, zip extension is not enabled in your PHP configuration. You'll have to unzip vendor.zip manually.</b>
595 <?php endif; ?>
596 <em>This method is mainly recommended if you don't have a dedicated server.</em></li>
22f19b23 597 <li>use <a href="http://getcomposer.org/">Composer</a> in your wallabag folder :<pre><code>curl -s http://getcomposer.org/installer | php
9834d87e
TC
598php composer.phar install</code></pre>
599 <span id="reloadpage">Reload to check</span>
600 </li>
ca056e7f 601 </ul>
9834d87e
TC
602
603 <?php else : ?>
604 Twig is properly installed.
ca056e7f 605 <?php endif; ?>
9834d87e 606 </div>
dd0d7ad9 607 <div class="database_info">
9834d87e 608 <hr>
dd0d7ad9 609 <fieldset class="database_inputs">
22f19b23 610 <legend><strong>Database settings</strong></legend>
792097fb
NL
611 <p>
612 Database engine:
613 <ul>
8d7ec546
TC
614 <li>
615 <?php if ($pdo_drivers['sqlite']) { ?>
616 <label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" />
617 <?php } else { ?>
618 <div class="messages notice">
619 <p>You have to enable <a href="http://php.net/manual/ref.pdo-sqlite.php">pdo_sqlite extension</a> to use SQLite.</p>
620 </div>
621 <?php } ?>
622 </li>
623 <li>
624 <?php if ($pdo_drivers['mysql']) { ?>
625 <label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
626 <div id="pdo_mysql" class='messages notice install'>
627 <p>All fields have to be filled.</p>
628 </div>
629 <ul id="mysql_infos">
630 <li><label for="mysql_server">Server</label> <input type="text" placeholder="localhost" id="mysql_server" name="mysql_server" /></li>
631 <li><label for="mysql_database">Database</label> <input type="text" placeholder="wallabag" id="mysql_database" name="mysql_database" /></li>
632 <li><label for="mysql_user">User</label> <input type="text" placeholder="user" id="mysql_user" name="mysql_user" /></li>
633 <li><label for="mysql_password">Password</label> <input type="password" placeholder="p4ssw0rd" id="mysql_password" name="mysql_password" /></li>
634 <li><label for="mysql_utf8_mb4">Use UTF-8 MB4</label> <input id="mysql_utf8_mb4" type="checkbox" name="mysql_utf8_mb4">
635 <div id="utf8_mb4_infos"><em>Warning :</em> UTF-8 MB4 is used to fully support unicode characters. It is available only with MySQL starting with version 5.5.3.
976d6935 636 Install will failed if you check this while using an older MySQL server.</div></li>
8d7ec546
TC
637 </ul>
638 <?php } else { ?>
639 <div class="messages notice">
640 <p>You have to enable <a href="http://php.net/manual/ref.pdo-mysql.php">pdo_mysql extension</a> to use MySQL.</p>
641 </div>
642 <?php } ?>
643 </li>
644 <li>
645 <?php if ($pdo_drivers['postgres']) { ?>
646 <label for="postgres">PostgreSQL</label> <input name="db_engine" type="radio" id="postgres" value="postgres" />
647 <div id="pdo_postgres" class='messages notice install'>
369e00e6 648 <p>All fields have to be filled.</p>
8d7ec546
TC
649 </div>
650 <ul id="pg_infos">
792097fb
NL
651 <li><label for="pg_server">Server</label> <input type="text" placeholder="localhost" id="pg_server" name="pg_server" /></li>
652 <li><label for="pg_database">Database</label> <input type="text" placeholder="wallabag" id="pg_database" name="pg_database" /></li>
653 <li><label for="pg_user">User</label> <input type="text" placeholder="user" id="pg_user" name="pg_user" /></li>
fcd37d0c 654 <li><label for="pg_password">Password</label> <input type="password" placeholder="p4ssw0rd" id="pg_password" name="pg_password" /></li>
8d7ec546
TC
655 </ul>
656 <?php } else { ?>
657 <div class="messages notice">
658 <p>You have to enable <a href="https://php.net/manual/ref.pdo-pgsql.php">pdo_pgsql extension</a> to use PostgreSQL.</p>
659 </div>
660 <?php } ?>
661 </li>
792097fb
NL
662 </ul>
663 </p>
664 </fieldset>
dd0d7ad9
TC
665 <div class="descriptions">
666 <div id="sqlite_description">
667 SQLite is the most simple database system of all three. It is therefore recommended for people who don't want or know how to configure other database systems.
668 </div>
669 <div id="mysql_description">
976d6935 670 MySQL (also called MariaDB) is one of the most popular database systems. It comes with most shared hosting plans.
dd0d7ad9
TC
671 </div>
672 <div id="postgres_description">
976d6935 673 PostgreSQL. Because some people prefer it to MySQL. With reasons.
dd0d7ad9
TC
674 </div>
675 </div>
676 </div>
c1e90b9e 677 <hr>
9834d87e 678 <div class="usersettings">
dd0d7ad9 679 <fieldset style="clear: both">
792097fb
NL
680 <legend><strong>User settings</strong></legend>
681 <p>
682 <label for="username">Username</label>
683 <input type="text" required id="username" name="username" value="wallabag" />
684 </p>
685 <p>
686 <label for="password">Password</label>
687 <input type="password" required id="password" name="password" value="wallabag" />
046b9316 688 <label for="show">Show password:</label> <input style="margin-left:-80px;" name="show" id="show" type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'">
792097fb
NL
689 </p>
690 <p>
046b9316 691 <label for="email">Email (not required)</label>
692 <input type="email" id="email" name="email" />
792097fb
NL
693 </p>
694 </fieldset>
1be13ba1 695 <input type="submit" id="install_button" value="Install wallabag" name="install" />
9834d87e 696 </div>
792097fb
NL
697 </form>
698 </div>
11ef4de5
TC
699 <?php else : ?>
700 <div class="final good">
701 <h1>wallabag is now installed ! :-) </h1>
702 <a href="index.php?clean=0">Click here to access the login form</a><br />
703 <em>The installation will now try to delete the install directory. If this fails, delete it manually.</em></div>
704 <?php endif; ?>
792097fb 705 <script>
9834d87e
TC
706 <?php if (!is_dir('vendor')) : ?>
707 $(".database_info").hide();
708 $(".usersettings").hide();
709 <?php endif ?>
8df90295 710
9834d87e
TC
711 /*
712 * Database showing/hiding
713 */
792097fb 714 $("#mysql_infos").hide();
dd0d7ad9 715 $("#mysql_description").hide();
792097fb 716 $("#pg_infos").hide();
dd0d7ad9
TC
717 $("#postgres_description").hide();
718 $("#sqlite_description").show();
369e00e6
TC
719 $("#pdo_postgres").hide();
720 $("#pdo_mysql").hide();
721
9834d87e
TC
722 /*
723 * Details hiding
724 */
725
726 $(".details").hide();
976d6935 727 $("#utf8_mb4_infos").hide();
9834d87e 728
444f1406
TC
729 <?php
730 if (!isPassing()) : ?>
731 $('.technical').hide();
732 <?php
733 else :
734 ?>
735 $('.technical').show();
736 <?php
737 endif;
738 ?>
739
8df90295
TC
740 <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
741 $('.technical').hide();
742 <?php endif ?>
743
976d6935
TC
744 $("#mysql_utf8_mb4").click(function() {
745 $("#utf8_mb4_infos").toggle();
746 });
747
792097fb
NL
748 $("input[name=db_engine]").click(function()
749 {
750 if ( $("#mysql").prop('checked')) {
751 $("#mysql_infos").show();
369e00e6 752 $("#pdo_mysql").show();
792097fb 753 $("#pg_infos").hide();
369e00e6 754 $("#pdo_postgres").hide();
1be13ba1 755 $("#pdo_sqlite").hide();
dd0d7ad9
TC
756 $("#sqlite_description").hide();
757 $("#postgres_description").hide();
758 $("#mysql_description").show();
c1e90b9e 759 $("#install_button").show();
792097fb
NL
760 }
761 else {
feecea28 762 if ( $("#postgres").prop('checked')) {
792097fb 763 $("#mysql_infos").hide();
369e00e6 764 $("#pdo_mysql").hide();
792097fb 765 $("#pg_infos").show();
369e00e6 766 $("#pdo_postgres").show();
1be13ba1 767 $("#pdo_sqlite").hide();
dd0d7ad9
TC
768 $("#sqlite_description").hide();
769 $("#mysql_description").hide();
770 $("#postgres_description").show();
1be13ba1 771 $("#install_button").show();
792097fb
NL
772 }
773 else {
774 $("#mysql_infos").hide();
775 $("#pg_infos").hide();
369e00e6
TC
776 $("#pdo_postgres").hide();
777 $("#pdo_mysql").hide();
dd0d7ad9
TC
778 $("#sqlite_description").show();
779 $("#mysql_description").hide();
780 $("#postgres_description").hide();
792097fb
NL
781 }
782 }
783 });
444f1406
TC
784
785 $(".detail").click(function()
786 {
787 $('.details').toggle();
788 });
9834d87e
TC
789 $("#reloadpage").click(function()
790 {
791 location.reload();
792 });
c1e90b9e 793
792097fb
NL
794 </script>
795 </body>
a50d7f0f 796</html>