wallabag/install/index.php

746 lines
93 KiB
PHP
Raw Normal View History

<?php
/**
* wallabag, self hostable application allowing you to not miss any content anymore
*
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://opensource.org/licenses/MIT see COPYING file
*/
$errors = array();
$successes = array();
require_once('install_functions.php');
if (isset($_GET['clean'])) {
if (is_dir('install')){
delTree('install');
header('Location: index.php');
}
}
if (isset($_POST['download'])) {
2014-02-19 12:55:40 +00:00
if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) {
$errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually</a> and unzip it in your wallabag folder.';
}
else {
if (extension_loaded('zip')) {
$zip = new ZipArchive();
if ($zip->open("cache/vendor.zip") !== TRUE){
$errors[] = 'Impossible to open cache/vendor.zip. Please unzip it manually in your wallabag folder.';
}
if ($zip->extractTo(realpath(''))) {
@unlink("cache/vendor.zip");
$successes[] = 'twig is now installed, you can install wallabag.';
}
else {
$errors[] = 'Impossible to extract cache/vendor.zip. Please unzip it manually in your wallabag folder.';
}
$zip->close();
}
else {
$errors[] = 'zip extension is not enabled in your PHP configuration. Please unzip cache/vendor.zip in your wallabag folder.';
}
}
}
else if (isset($_POST['install'])) {
if (!is_dir('vendor')) {
$errors[] = 'You must install twig before.';
2015-01-26 23:41:25 +00:00
} else {
$continue = true;
2015-01-26 23:41:25 +00:00
$salt = generate_salt();
$content = file_get_contents('inc/poche/config.inc.default.php');
2015-01-26 23:41:25 +00:00
// User informations
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$salted_password = sha1($password . $username . $salt);
2015-01-26 23:41:25 +00:00
// Database informations
$moreQueries = array();
2015-01-26 23:41:25 +00:00
if ($_POST['db_engine'] == 'sqlite') {
if (!copy('install/poche.sqlite', 'db/poche.sqlite')) {
$errors[] = 'Impossible to create the SQLite database file.';
}
else {
2015-01-26 23:41:25 +00:00
$db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite';
$handle = new PDO($db_path);
$handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql_structure = "";
}
} else {
// MySQL and Postgre
try {
if ($_POST['db_engine'] == 'mysql') {
if (isset($_POST['mysql_utf8_mb4'])) {
//with UTF8-MB4
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'] . ';charset=utf8mb4';
$handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password'], array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
));
} else { // regular UTF8
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'];
$handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']);
}
2015-01-26 23:41:25 +00:00
$content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['mysql_server']."');", $content);
$content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['mysql_database']."');", $content);
$content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['mysql_user']."');", $content);
$content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['mysql_password']."');", $content);
$moreQueries[] = "INSERT INTO `entries` (`id`, `title`, `url`, `is_read`, `is_fav`, `content`, `user_id`) VALUES
(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, 0x0a3c68323e556e6520696e74657276696577206465204e69636f6c61732c20736f6e2064c3a976656c6f70706575722e3c2f68323e0a3c703e3c656d3e496c206e6520766f757320612073c3bb72656d656e742070617320c3a96368617070c3a920717565206e6f74726520636f6e736f6d6d6174696f6e20646520636f6e74656e75732064752057656220657374207465727269626c656d656e74206368726f6e6f706861676520657420706172746963756c69c3a872656d656e7420667275737472616e746520746f757420c3a0206c6120666f6973c2a03a206e6f6e207365756c656d656e74206e6f757320706173736f6e732062656175636f7570202874726f70c2a03f292064652074656d707320656e206c69676e6520c3a0206578706c6f726572206c6573206d696e6573206175726966c3a8726573206465206c6120746f696c652c20792064c3a974656374616e742070c3a970697465732065742066696c6f6e732c206d616973206e6f757320736f6d6d657320737572746f757420636f6e7374616d6d656e7420656e206d616e7175652e204dc3aa6d65207369206e6f7573206e6520736f6d6d6573207061732064616e73206c65207a617070696e67206672c3a96ec3a9746971756520736920666163696c656d656e742064c3a96e6f6e63c3a920706172206c657320646f637465732070737963686f6c6f677565732071756920706f6e74696669656e7420737572206c65732064616e67657273206475206e756dc3a9726971756520706f7572206c6573206a65756e65732063657276656c6c65732c20696c206e6f7573207669656e7420736f7576656e74206c6520676fc3bb7420616d6572206465206ce28099696e6163686576c3a9c2a03a20706173206c652074656d707320646520746f7574206c69726520283c6120687265663d22687474703a2f2f66722e77696b74696f6e6172792e6f72672f77696b692f544c4452223e544c3b44523c2f613e2065737420646576656e75206c6520636c696e2064e28099c593696c206d692d6669677565206d692d72616973696e2064e28099756e652067c3a96ec3a9726174696f6e206465206c65637465757273207072657373c3a973292c207061732074726f70206c652074656d70732064652072c3a9666cc3a963686972206e6f6e20706c75732068c3a96c61732c20706173206c652074656d707320646520737569767265206c6120726962616d62656c6c65206465206c69656e73206173736f6369c3a97320c3a020756e2061727469636c65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e506f7572206e6f757320646f6e6e657220626f6e6e6520636f6e736369656e63652c206e6f75732072616e67656f6e73207363727570756c657573656d656e7420756e206d61727175652d7061676520646520706c75732064616e7320756e20736f75732d646f73736965722071756920656e20636f6d706f7274652064c3a96ac3a0203235362c206e6f7573206e6f746f6e7320756e20c3a96cc3a96d656e7420646520706c75732064616e73206c6120746f756a6f757273207269646963756c656d656e74206c6f6e67756520746f75646f756c697374652c2062726566206e6f75732072656d6574746f6e7320c3a020706c757320746172642c2063e280996573742dc3a02d64697265206c6520706c757320736f7576656e742061757820696e74726f757661626c65732063616c656e6465732067726563717565732c206c6520736f696e206465206c69726520767261696d656e7420756e2061727469636c65206a7567c3a920696e74c3a972657373616e742c20646520726567617264657220756e6520766964c3a96f207369676e616cc3a96520706172206c65732072c3a97a6f73736f63696f732c206465206c69726520756e20636861706974726520656e746965722064e28099756e206f75767261676520646973706f6e69626c6520656e206c69676e65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e416c6f7273206269656e2073c3bb722c20c3a02064c3a966617574206465206e6f757320646f6e6e657220746f7574206c652074656d70732071756920736572616974206ec3a963657373616972652c2064657320736f6c7574696f6e73206578697374656e7420706f7572206e6f7573207065726d657474726520646520c2abc2a06c69726520706c75732074617264c2a0c2bb20656e20736175766567617264616e74206c65207072c3a9636965757820706f6c6c656e206465206e6f7320627574696e61676573206465207369746520656e20736974652c2065742064e28099656e20666169726520756c74c3a97269657572656d656e7420766f747265206d69656cc2a03b2063e280996573742062656c20657420626f6e206d616973206c65732072756368657320736f6e7420756e207065752064697374616e7465732c20c3a7612073e28099617070656c6c65206c6520636c6f756420286e6f7320616d69732074656368696573206de280996f6e74206269656e206578706c697175c3a9206d616973206ae280996169207365756c656d656e7420636f6d70726973207175652064657320747275637320c3a0206d6f6920736f6e742073757220646573206d616368696e6573206c6f696e7461696e65732c20c3a76
(2, 'wallabag/wallabag', 'https://github.com/wallabag/wallabag', 0, 0, 0x3c7370616e20636c6173733d226e616d65223e524541444d452e6d643c2f7370616e3e3c703e77616c6c6162616720697320612073656c6620686f737461626c65206170706c69636174696f6e20616c6c6f77696e6720796f7520746f206e6f74206d69737320616e7920636f6e74656e7420616e796d6f72652e20436c69636b2c20736176652c2072656164206974207768656e20796f752063616e2e20497420657874726163747320636f6e74656e7420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c703e4d6f726520696e666f726d6174696f6e73206f6e206f757220776562736974653a203c6120687265663d22687474703a2f2f77616c6c616261672e6f7267223e77616c6c616261672e6f72673c2f613e3c2f703e0a3c68323e3c6120636c6173733d22616e63686f722220687265663d2268747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c61626167236c6963656e7365223e3c2f613e4c6963656e73653c2f68323e0a3c703e436f7079726967687420c2a920323031302d32303134204e69636f6c6173204cc59375696c6c6574203c6120687265663d226d61696c746f3a6e69636f6c6173406c6f6575696c6c65742e6f7267223e6e69636f6c6173406c6f6575696c6c65742e6f72673c2f613e205468697320776f726b20697320667265652e20596f752063616e2072656469737472696275746520697420616e642f6f72206d6f6469667920697420756e64657220746865207465726d73206f662074686520446f205768617420546865204675636b20596f752057616e7420546f205075626c6963204c6963656e73652c2056657273696f6e20322c206173207075626c69736865642062792053616d20486f63657661722e205365652074686520434f5059494e472066696c6520666f72206d6f72652064657461696c732e3c2f703e0a, 1),
(3, 'a self hostable application for saving web pages | wallabag', 'https://www.wallabag.org/', 0, 1, 0x0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e77616c6c616261672028666f726d65726c7920706f636865292069732061203c7374726f6e673e73656c6620686f737461626c65206170706c69636174696f6e20666f7220736176696e67207765622070616765733c2f7374726f6e673e2e20556e6c696b65206f746865722073657276696365732cc2a077616c6c6162616720697320667265652028617320696e2066726565646f6d2920616e64206f70656e20736f757263652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e576974682074686973206170706c69636174696f6e20796f752077696c6c206e6f74206d69737320636f6e74656e7420616e796d6f72652e203c7374726f6e673e436c69636b2c20736176652c2072656164206974207768656e20796f752077616e743c2f7374726f6e673e2e2049742073617665732074686520636f6e74656e7420796f752073656c65637420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3620636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c68323e486f7720697420776f726b733c2f68323e0a3c703e5468616e6b7320746f2074686520626f6f6b6d61726b6c6574206f72203c61207469746c653d22446f776e6c6f6164732220687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f646f776e6c6f6164732f223e74686972642d7061727479206170706c69636174696f6e733c2f613e2c20796f75207361766520616e2061727469636c6520696e20796f7572c2a077616c6c6162616720746f2072656164206974206c617465722e205468656e2c207768656e20796f75206f70656e20796f75722077616c6c616261672c203c7374726f6e673e796f752063616e20636f6d666f727461626c79207265616420796f75722061727469636c65733c2f7374726f6e673e2e3c2f703e0a3c68323e486f7720746f207573652077616c6c616261673c2f68323e0a3c703e5468657265206172652074776f207761797320746f207573652077616c6c616261673a20796f752063616e203c6120687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f6672657175656e746c792d61736b65642d7175657374696f6e732f23486f775f63616e5f495f696e7374616c6c5f77616c6c616261675f616e645f776861745f6172655f7468655f726571756972656d656e7473223e696e7374616c6c2069743c2f613ec2a06f6e20796f75722077656220736572766572206f7220796f752063616ec2a03c6120687265663d22687474703a2f2f6170702e696e746865706f6368652e636f6d223e63726561746520616e206163636f756e743c2f613ec2a06174204672616d616261672028776520696e7374616c6c20616e642075706772616465c2a077616c6c6162616720666f7220796f75292e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a, 1);";
2015-01-26 23:41:25 +00:00
$moreQueries[] = "INSERT INTO `tags` (`id`, `value`) VALUES (1, 'opensource');";
$moreQueries[] = "INSERT INTO `tags_entries` (`id`, `entry_id`, `tag_id`) VALUES (1, 2, 1);";
2015-01-26 23:41:25 +00:00
$sql_structure = file_get_contents('install/mysql.sql');
}
else if ($_POST['db_engine'] == 'postgres') {
$db_path = 'pgsql:host=' . $_POST['pg_server'] . ';dbname=' . $_POST['pg_database'];
$content = str_replace("define ('STORAGE_SERVER', 'localhost');", "define ('STORAGE_SERVER', '".$_POST['pg_server']."');", $content);
$content = str_replace("define ('STORAGE_DB', 'poche');", "define ('STORAGE_DB', '".$_POST['pg_database']."');", $content);
$content = str_replace("define ('STORAGE_USER', 'poche');", "define ('STORAGE_USER', '".$_POST['pg_user']."');", $content);
$content = str_replace("define ('STORAGE_PASSWORD', 'poche');", "define ('STORAGE_PASSWORD', '".$_POST['pg_password']."');", $content);
$handle = new PDO($db_path, $_POST['pg_user'], $_POST['pg_password']);
$moreQueries[] = "INSERT INTO entries (title, url, is_read, is_fav, content, user_id) VALUES
2014-10-08 17:31:15 +00:00
('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('3c68323e556e6520696e74657276696577206465204e69636f6c61732c20736f6e2064c3a976656c6f70706575722e3c2f68323e0a3c703e3c656d3e496c206e6520766f757320612073c3bb72656d656e742070617320c3a96368617070c3a920717565206e6f74726520636f6e736f6d6d6174696f6e20646520636f6e74656e75732064752057656220657374207465727269626c656d656e74206368726f6e6f706861676520657420706172746963756c69c3a872656d656e7420667275737472616e746520746f757420c3a0206c6120666f6973c2a03a206e6f6e207365756c656d656e74206e6f757320706173736f6e732062656175636f7570202874726f70c2a03f292064652074656d707320656e206c69676e6520c3a0206578706c6f726572206c6573206d696e6573206175726966c3a8726573206465206c6120746f696c652c20792064c3a974656374616e742070c3a970697465732065742066696c6f6e732c206d616973206e6f757320736f6d6d657320737572746f757420636f6e7374616d6d656e7420656e206d616e7175652e204dc3aa6d65207369206e6f7573206e6520736f6d6d6573207061732064616e73206c65207a617070696e67206672c3a96ec3a9746971756520736920666163696c656d656e742064c3a96e6f6e63c3a920706172206c657320646f637465732070737963686f6c6f677565732071756920706f6e74696669656e7420737572206c65732064616e67657273206475206e756dc3a9726971756520706f7572206c6573206a65756e65732063657276656c6c65732c20696c206e6f7573207669656e7420736f7576656e74206c6520676fc3bb7420616d6572206465206ce28099696e6163686576c3a9c2a03a20706173206c652074656d707320646520746f7574206c69726520283c6120687265663d22687474703a2f2f66722e77696b74696f6e6172792e6f72672f77696b692f544c4452223e544c3b44523c2f613e2065737420646576656e75206c6520636c696e2064e28099c593696c206d692d6669677565206d692d72616973696e2064e28099756e652067c3a96ec3a9726174696f6e206465206c65637465757273207072657373c3a973292c207061732074726f70206c652074656d70732064652072c3a9666cc3a963686972206e6f6e20706c75732068c3a96c61732c20706173206c652074656d707320646520737569767265206c6120726962616d62656c6c65206465206c69656e73206173736f6369c3a97320c3a020756e2061727469636c65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e506f7572206e6f757320646f6e6e657220626f6e6e6520636f6e736369656e63652c206e6f75732072616e67656f6e73207363727570756c657573656d656e7420756e206d61727175652d7061676520646520706c75732064616e7320756e20736f75732d646f73736965722071756920656e20636f6d706f7274652064c3a96ac3a0203235362c206e6f7573206e6f746f6e7320756e20c3a96cc3a96d656e7420646520706c75732064616e73206c6120746f756a6f757273207269646963756c656d656e74206c6f6e67756520746f75646f756c697374652c2062726566206e6f75732072656d6574746f6e7320c3a020706c757320746172642c2063e280996573742dc3a02d64697265206c6520706c757320736f7576656e742061757820696e74726f757661626c65732063616c656e6465732067726563717565732c206c6520736f696e206465206c69726520767261696d656e7420756e2061727469636c65206a7567c3a920696e74c3a972657373616e742c20646520726567617264657220756e6520766964c3a96f207369676e616cc3a96520706172206c65732072c3a97a6f73736f63696f732c206465206c69726520756e20636861706974726520656e746965722064e28099756e206f75767261676520646973706f6e69626c6520656e206c69676e65e280a63c6272202f3e3c2f656d3e3c2f703e0a3c703e3c656d3e416c6f7273206269656e2073c3bb722c20c3a02064c3a966617574206465206e6f757320646f6e6e657220746f7574206c652074656d70732071756920736572616974206ec3a963657373616972652c2064657320736f6c7574696f6e73206578697374656e7420706f7572206e6f7573207065726d657474726520646520c2abc2a06c69726520706c75732074617264c2a0c2bb20656e20736175766567617264616e74206c65207072c3a9636965757820706f6c6c656e206465206e6f7320627574696e61676573206465207369746520656e20736974652c2065742064e28099656e20666169726520756c74c3a97269657572656d656e7420766f747265206d69656cc2a03b2063e280996573742062656c20657420626f6e206d616973206c65732072756368657320736f6e7420756e207065752064697374616e7465732c20c3a7612073e28099617070656c6c65206c6520636c6f756420286e6f7320616d69732074656368696573206de280996f6e74206269656e206578706c697175c3a9206d616973206ae280996169207365756c656d656e7420636f6d70726973207175652064657320747275637320c3a0206d6f6920736f6e742073757220646573206d616368696e6573206c6f696
('wallabag/wallabag', 'https://github.com/wallabag/wallabag', false, false, convert_from(decode('3c7370616e20636c6173733d226e616d65223e524541444d452e6d643c2f7370616e3e3c703e77616c6c6162616720697320612073656c6620686f737461626c65206170706c69636174696f6e20616c6c6f77696e6720796f7520746f206e6f74206d69737320616e7920636f6e74656e7420616e796d6f72652e20436c69636b2c20736176652c2072656164206974207768656e20796f752063616e2e20497420657874726163747320636f6e74656e7420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c703e4d6f726520696e666f726d6174696f6e73206f6e206f757220776562736974653a203c6120687265663d22687474703a2f2f77616c6c616261672e6f7267223e77616c6c616261672e6f72673c2f613e3c2f703e0a3c68323e3c6120636c6173733d22616e63686f722220687265663d2268747470733a2f2f6769746875622e636f6d2f77616c6c616261672f77616c6c61626167236c6963656e7365223e3c2f613e4c6963656e73653c2f68323e0a3c703e436f7079726967687420c2a920323031302d32303134204e69636f6c6173204cc59375696c6c6574203c6120687265663d226d61696c746f3a6e69636f6c6173406c6f6575696c6c65742e6f7267223e6e69636f6c6173406c6f6575696c6c65742e6f72673c2f613e205468697320776f726b20697320667265652e20596f752063616e2072656469737472696275746520697420616e642f6f72206d6f6469667920697420756e64657220746865207465726d73206f662074686520446f205768617420546865204675636b20596f752057616e7420546f205075626c6963204c6963656e73652c2056657273696f6e20322c206173207075626c69736865642062792053616d20486f63657661722e205365652074686520434f5059494e472066696c6520666f72206d6f72652064657461696c732e3c2f703e0a', 'hex'), 'UTF8'), 1),
('a self hostable application for saving web pages | wallabag', 'https://www.wallabag.org/', false, true, convert_from(decode('3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e77616c6c616261672028666f726d65726c7920706f636865292069732061203c7374726f6e673e73656c6620686f737461626c65206170706c69636174696f6e20666f7220736176696e67207765622070616765733c2f7374726f6e673e2e20556e6c696b65206f746865722073657276696365732cc2a077616c6c6162616720697320667265652028617320696e2066726565646f6d2920616e64206f70656e20736f757263652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3820636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c703e576974682074686973206170706c69636174696f6e20796f752077696c6c206e6f74206d69737320636f6e74656e7420616e796d6f72652e203c7374726f6e673e436c69636b2c20736176652c2072656164206974207768656e20796f752077616e743c2f7374726f6e673e2e2049742073617665732074686520636f6e74656e7420796f752073656c65637420736f207468617420796f752063616e2072656164206974207768656e20796f7520686176652074696d652e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a3c64697620636c6173733d22726f77223e0a3c64697620636c6173733d22636f6c2d6c672d3620636f6c2d6d642d313220636f6c2d78732d313220636f6c2d736d2d3132223e0a3c68323e486f7720697420776f726b733c2f68323e0a3c703e5468616e6b7320746f2074686520626f6f6b6d61726b6c6574206f72203c61207469746c653d22446f776e6c6f6164732220687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f646f776e6c6f6164732f223e74686972642d7061727479206170706c69636174696f6e733c2f613e2c20796f75207361766520616e2061727469636c6520696e20796f7572c2a077616c6c6162616720746f2072656164206974206c617465722e205468656e2c207768656e20796f75206f70656e20796f75722077616c6c616261672c203c7374726f6e673e796f752063616e20636f6d666f727461626c79207265616420796f75722061727469636c65733c2f7374726f6e673e2e3c2f703e0a3c68323e486f7720746f207573652077616c6c616261673c2f68323e0a3c703e5468657265206172652074776f207761797320746f207573652077616c6c616261673a20796f752063616e203c6120687265663d22687474703a2f2f7777772e77616c6c616261672e6f72672f6672657175656e746c792d61736b65642d7175657374696f6e732f23486f775f63616e5f495f696e7374616c6c5f77616c6c616261675f616e645f776861745f6172655f7468655f726571756972656d656e7473223e696e7374616c6c2069743c2f613ec2a06f6e20796f75722077656220736572766572206f7220796f752063616ec2a03c6120687265663d22687474703a2f2f6170702e696e746865706f6368652e636f6d223e63726561746520616e206163636f756e743c2f613ec2a06174204672616d616261672028776520696e7374616c6c20616e642075706772616465c2a077616c6c6162616720666f7220796f75292e3c2f703e0a3c2f6469763e0a0a3c2f6469763e0a', 'hex'), 'UTF8'), 1)";
2015-01-26 23:41:25 +00:00
$moreQueries[] = "INSERT INTO tags (value) VALUES ('opensource')";
$moreQueries[] = "INSERT INTO tags_entries (entry_id, tag_id) VALUES (2, 1)";
2015-01-26 23:41:25 +00:00
$sql_structure = file_get_contents('install/postgres.sql');
}
2015-01-26 23:41:25 +00:00
// create database structure
$query = $handle->exec($sql_structure);
} catch (PDOException $e) {
$errors[] = $e->getMessage();
$continue = false;
}
}
}
if ($continue) {
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
$params = array($username, $salted_password, $username);
$query = executeQuery($handle, $sql, $params);
2015-01-26 23:41:25 +00:00
$id_user = (int)$handle->lastInsertId('users_id_seq');
2015-01-26 23:41:25 +00:00
$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
$params = array($id_user, 'pager', '10');
$query = executeQuery($handle, $sql, $params);
2015-01-26 23:41:25 +00:00
$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
$params = array($id_user, 'language', 'en_EN.UTF8');
$query = executeQuery($handle, $sql, $params);
2015-01-26 23:41:25 +00:00
foreach ($moreQueries as $query) {
executeQuery($handle, $query, array());
}
$successes[] = 'wallabag is now installed. You can now <a href="index.php?clean=0">access it !</a>';
2015-01-26 23:41:25 +00:00
if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) {
$errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.';
} else {
if ($_POST['db_engine'] != 'sqlite') {
$content = str_replace("define ('STORAGE', 'sqlite');", "define ('STORAGE', '".$_POST['db_engine']."');", $content);
file_put_contents('inc/poche/config.inc.php', $content);
}
2015-01-26 23:41:25 +00:00
$content = str_replace("define ('SALT', '');", "define ('SALT', '".$salt."');", $content);
file_put_contents('inc/poche/config.inc.php', $content);
}
}
2015-01-26 23:41:25 +00:00
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=10">
<![endif]-->
<title>wallabag - installation</title>
<link rel="shortcut icon" type="image/x-icon" href="themes/baggy/img/favicon.ico" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="themes/baggy/img/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="themes/baggy/img/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="themes/baggy/img/apple-touch-icon-precomposed.png">
<link href='//fonts.googleapis.com/css?family=PT+Sans:700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="themes/baggy/css/ratatouille.css" media="all">
<link rel="stylesheet" href="themes/baggy/css/font.css" media="all">
<link rel="stylesheet" href="themes/baggy/css/main.css" media="all">
<link rel="stylesheet" href="themes/baggy/css/messages.css" media="all">
<link rel="stylesheet" href="themes/baggy/css/print.css" media="print">
<script src="themes/_global/js/jquery-2.0.3.min.js"></script>
<script src="themes/baggy/js/init.js"></script>
<style type="text/css">
a {
color:#000;
text-decoration:underline;
padding:0 1px;
}
a:hover {
color:#fff;
background-color:#333;
text-decoration:none;
padding:0 1px;
}
p {
margin:0;
padding:5px 0;
}
em {
font-style:normal;
background-color:#ffc;
padding: 0.1em 0;
}
ul, ol {
margin:10px 0 10px 20px;
padding:0 0 0 15px;
}
ul li, ol li {
margin:0 0 7px 0;
padding:0 0 0 3px;
}
h2 {
font-size:18px;
padding:0;
}
h3 {
font-size:16px;
padding:0;
margin:20px 0 5px 0;
}
h4 {
font-size:14px;
padding:0;
margin:15px 0 5px 0;
}
code {
font-size:1.1em;
background-color:#f3f3ff;
color:#000;
}
em strong {
text-transform: uppercase;
}
table#chart {
border-collapse:collapse;
}
table#chart th {
background-color:#eee;
padding:2px 3px;
border:1px solid #fff;
}
table#chart td {
text-align:center;
padding:2px 3px;
border:1px solid #eee;
}
table#chart tr.enabled td {
/* Leave this alone */
}
table#chart tr.disabled td,
table#chart tr.disabled td a {
}
table#chart tr.disabled td a {
text-decoration:underline;
}
div.chunk {
margin:20px 0 0 0;
padding:0 0 10px 0;
border-bottom:1px solid #ccc;
}
.footnote,
.footnote a {
font:10px/12px verdana, sans-serif;
color:#aaa;
}
.footnote em {
background-color:transparent;
font-style:italic;
}
.good{
background-color:#52CC5B;
}
.bad{
background-color:#F74343;
font-style:italic;
font-weight: bold;
}
.pass{
background-color:#FF9500;
}
2015-01-25 21:42:31 +00:00
.detail {
cursor: pointer;
}
2015-01-31 22:44:20 +00:00
.descriptions {
margin-left: 10%;
position: relative;
top: 50%;
}
.database_inputs {
float: left;
width: 50%
}
.database_info {
width: 100%;
overflow: auto;
}
.compatibity_result {
margin: auto;
max-width: 300px;
min-height: 50px;
line-height: 50px;
text-align: center;
2015-01-31 23:44:13 +00:00
margin-bottom: 30px;
border-radius: 3px;
}
h2, legend {
font-size: 30px;
text-transform: uppercase;
font-family: "PT Sans",sans-serif;
}
legend:after {
content: "";
height: 4px;
width: 70px;
background-color: #000;
display: block;
}
2015-01-31 23:44:13 +00:00
#reloadpage {
cursor: pointer;
background-color: #000;
color: #FFF;
padding: 0.5em 1em;
display: inline-block;
border: 1px solid #000;
}
#reloadpage:hover {
background-color: #FFF;
color: #000;
}
</style>
</head>
<body>
<header class="w600p center mbm">
<h1 class="logo">
<img width="100" height="100" src="themes/baggy/img/logo-w.png" alt="logo poche" />
</h1>
</header>
<div id="main">
<button id="menu" class="icon icon-menu desktopHide"><span>Menu</span></button>
<ul id="links" class="links">
<li><a href="docs/" target="_blank">Offline Doc</a></li>
<li><a href="http://doc.wallabag.org/" target="_blank">Online doc</a></li>
<li><a href="http://support.wallabag.org/" target="_blank">help</a></li>
<li><a href="http://www.wallabag.org/" target="_blank">wallabag.org</a></li>
</ul>
<?php if (!empty($errors)) : ?>
<div class='messages error install'>
<p>Errors during installation:</p>
<p>
<ul>
<?php foreach($errors as $error) :?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
</p>
<p><a href="index.php">Please reload</a> this page when you think you resolved these problems.</p>
</div>
<?php endif; ?>
<?php if (!empty($successes)) : ?>
<div class='messages success install'>
<p>
<ul>
<?php foreach($successes as $success) :?>
<li><?php echo $success; ?></li>
<?php endforeach; ?>
</ul>
</p>
</div>
<?php else : ?>
<?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
<div class='messages success install'>
<p>
wallabag seems already installed. If you want to update it, you only have to delete install folder, then <a href="index.php">reload this page</a>.
</p>
</div>
<?php endif; ?>
<?php endif; ?>
<p>To install wallabag, you just have to fill the following fields. That's all.</p>
<div>
<h2>Server compatibility test</h2>
<?php if (isOkay()) { ?>
<div class="compatibity_result detail good">All good</div>
<?php } elseif (isPassing()) { ?>
<div class="compatibity_result detail pass">Some problems, but it's OK !</div>
<?php } else { ?>
<div class="compatibity_result detail bad">Bad news : you can't run wallabag</div>
<?php } $status = status(); ?>
</div>
<div class="details">
<div>
2015-01-25 21:42:31 +00:00
<hr>
<h2 style="text-align:center;"><?php echo $status['app_name']; ?>: Compatibility Test</h2>
<table cellpadding="0" cellspacing="0" border="0" width="100%" id="chart">
<thead>
<tr>
<th>Test</th>
<th>Should Be</th>
<th>What You Have</th>
<th>What it means</th>
</tr>
</thead>
<tbody>
<tr class="<?php echo ($status['php']) ? 'enabled' : 'disabled'; ?>">
<td>PHP</td>
<td>5.3.3 or higher</td>
<td class="<?php echo ($status['php']) ? 'good' : 'disabled'; ?>"><?php echo phpversion(); ?></td>
<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>
</tr>
<tr class="<?php echo ($status['pdo']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/manual/en/book.pdo.php">PDO</a></td>
<td>Enabled</td>
<?php echo ($status['pdo']) ? '<td class="good">Enabled</span>' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['pdo_drivers_passing']) ? 'enabled' : 'disabled'; ?>">
<td>PDO Drivers</td>
<td>One of the PDO drivers must be installed</td>
<?php echo ($status['pdo_drivers_passing']) ? '<td class="good">At least one driver is enabled</span>' : '<td class="bad">No driver available'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['xml']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/xml">XML</a></td>
<td>Enabled</td>
<?php echo ($status['xml']) ? '<td class="good">Enabled, and sane</span>' : '<td class="bad">Disabled, or broken'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['pcre']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/pcre">PCRE</a></td>
<td>Enabled</td>
<?php echo ($status['pcre']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['zlib']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/zlib">Zlib</a></td>
<td>Enabled</td>
<?php echo ($status['zlib']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['mbstring']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/mbstring">mbstring</a></td>
<td>Enabled</td>
<?php echo ($status['mbstring']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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.
<?php } elseif ($status['mbstring']) { ?><strong>mbstring:</strong> <code>mbstring</code> is installed, but <code>iconv</code> is not.
<?php } elseif ($status['iconv']) { ?><strong>iconv:</strong> <code>iconv</code> is installed, but <code>mbstring</code> is not.
<?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.
<?php } ?>
</td>
</tr>
<tr class="<?php echo ($status['iconv']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/iconv">iconv</a></td>
<td>Enabled</td>
<?php echo ($status['iconv']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
</tr>
<tr class="<?php echo ($status['dom']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/manual/en/book.dom.php">DOM / XML extension</a></td>
<td>Enabled</td>
<?php echo ($status['dom']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['filter']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://uk.php.net/manual/en/book.filter.php">Data filtering</a></td>
<td>Enabled</td>
<?php echo ($status['filter']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['gd']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/manual/en/book.image.php">GD</a></td>
<td>Enabled</td>
<?php echo ($status['gd']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['tidy']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/tidy">Tidy</a></td>
<td>Enabled</td>
<?php echo ($status['tidy']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['curl']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/curl">cURL</a></td>
<td>Enabled</td>
<?php echo (extension_loaded('curl')) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['parse_ini']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://uk.php.net/manual/en/function.parse-ini-file.php">Parse ini file</td>
<td>Enabled</td>
<?php echo ($status['parse_ini']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['parallel']) ? 'enabled' : 'disabled'; ?>">
<td>Parallel URL fetching</td>
<td>Enabled</td>
<?php echo ($status['parallel']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
<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>
</tr>
<tr class="<?php echo ($status['allow_url_fopen']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen">allow_url_fopen</a></td>
<td>Enabled</td>
<?php echo ($status['allow_url_fopen']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<td><?php echo ($status['allow_url_fopen']) ? '<strong>allow_url_fopen:</strong> You have allow_url_fopen enabled.' : '<strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
</tr>
<tr class="<?php echo ($status['gettext']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/manual/en/book.gettext.php">gettext</a></td>
<td>Enabled</td>
<?php echo ($status['gettext']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
<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>
</tr>
</tbody>
</table>
<hr>
</div>
<div class="details">
<?php //if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['iconv'] && $status['filter'] && $status['allow_url_fopen']) { ?>
<?php if (isOkay()) { ?>
<h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
<p><em>Your webhost has its act together!</em></p>
<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>
<?php //} else if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['allow_url_fopen'] && $status['filter']) { ?>
<?php } else if (!isOkay() && isPassing()) { ?>
<h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
<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>
<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>
<?php } else { ?>
<h3>Bottom Line: We're sorry…</h3>
<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>
2015-01-31 23:44:13 +00:00
<p>If this is your own server and you think you have all the requirements installed, please get in touch with us.</p>
<?php } ?>
</div>
<div class="chunk">
<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>
</div>
</div>
<form method="post" class="technical">
2015-01-31 23:44:13 +00:00
<hr>
<div class='twig'>
<h2>Twig installation</h2>
2015-01-26 23:41:25 +00:00
<?php if (!is_dir('vendor')) : ?>
2015-01-31 23:44:13 +00:00
<p>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:</p>
2015-01-26 23:41:25 +00:00
<ul>
<li>automatically download and extract vendor.zip into your wallabag folder.
<p><input type="submit" name="download" value="Download vendor.zip" /></p>
<?php if (!extension_loaded('zip')) : ?>
<b>Be careful, zip extension is not enabled in your PHP configuration. You'll have to unzip vendor.zip manually.</b>
<?php endif; ?>
<em>This method is mainly recommended if you don't have a dedicated server.</em></li>
<li>use <a href="http://getcomposer.org/">Composer</a> in your wallabag folder :<pre><code>curl -s http://getcomposer.org/installer | php
2015-01-31 23:44:13 +00:00
php composer.phar install</code></pre>
<span id="reloadpage">Reload to check</span>
</li>
2015-01-26 23:41:25 +00:00
</ul>
2015-01-31 23:44:13 +00:00
<?php else : ?>
Twig is properly installed.
2015-01-26 23:41:25 +00:00
<?php endif; ?>
2015-01-31 23:44:13 +00:00
</div>
2015-01-31 22:44:20 +00:00
<div class="database_info">
2015-01-31 23:44:13 +00:00
<hr>
2015-01-31 22:44:20 +00:00
<fieldset class="database_inputs">
<legend><strong>Database settings</strong></legend>
<p>
Database engine:
<ul>
<li><label for="sqlite">SQLite</label> <input name="db_engine" type="radio" checked="" id="sqlite" value="sqlite" />
<div id="pdo_sqlite" class='messages error install'>
<p>You have to enable <a href="http://php.net/manual/ref.pdo-sqlite.php">pdo_sqlite extension</a>.</p>
</div>
</li>
<li>
<label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
<div id="pdo_mysql" class='messages notice install'>
<p>All fields have to be filled.</p>
</div>
<ul id="mysql_infos">
<li><label for="mysql_server">Server</label> <input type="text" placeholder="localhost" id="mysql_server" name="mysql_server" /></li>
<li><label for="mysql_database">Database</label> <input type="text" placeholder="wallabag" id="mysql_database" name="mysql_database" /></li>
<li><label for="mysql_user">User</label> <input type="text" placeholder="user" id="mysql_user" name="mysql_user" /></li>
<li><label for="mysql_password">Password</label> <input type="password" placeholder="p4ssw0rd" id="mysql_password" name="mysql_password" /></li>
<li><label for="mysql_utf8_mb4">Use UTF-8 MB4</label> <input id="mysql_utf8_mb4" type="checkbox" name="mysql_utf8_mb4">
<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.
Install will failed if you check this while using an older MySQL server.</div></li>
</ul>
</li>
<li>
2014-04-23 20:39:43 +00:00
<label for="postgres">PostgreSQL</label> <input name="db_engine" type="radio" id="postgres" value="postgres" />
<div id="pdo_postgres" class='messages notice install'>
<p>All fields have to be filled.</p>
</div>
<ul id="pg_infos">
<li><label for="pg_server">Server</label> <input type="text" placeholder="localhost" id="pg_server" name="pg_server" /></li>
<li><label for="pg_database">Database</label> <input type="text" placeholder="wallabag" id="pg_database" name="pg_database" /></li>
<li><label for="pg_user">User</label> <input type="text" placeholder="user" id="pg_user" name="pg_user" /></li>
<li><label for="pg_password">Password</label> <input type="password" placeholder="p4ssw0rd" id="pg_password" name="pg_password" /></li>
</ul>
</li>
</ul>
</p>
</fieldset>
2015-01-31 22:44:20 +00:00
<div class="descriptions">
<div id="sqlite_description">
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.
</div>
<div id="mysql_description">
MySQL (also called MariaDB) is one of the most popular database systems. It comes with most shared hosting plans.
2015-01-31 22:44:20 +00:00
</div>
<div id="postgres_description">
PostgreSQL. Because some people prefer it to MySQL. With reasons.
2015-01-31 22:44:20 +00:00
</div>
</div>
</div>
2015-01-25 21:42:31 +00:00
<hr>
2015-01-31 23:44:13 +00:00
<div class="usersettings">
2015-01-31 22:44:20 +00:00
<fieldset style="clear: both">
<legend><strong>User settings</strong></legend>
<p>
<label for="username">Username</label>
<input type="text" required id="username" name="username" value="wallabag" />
</p>
<p>
<label for="password">Password</label>
<input type="password" required id="password" name="password" value="wallabag" />
2014-07-25 06:42:03 +00:00
<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'">
</p>
<p>
2014-07-25 06:42:03 +00:00
<label for="email">Email (not required)</label>
<input type="email" id="email" name="email" />
</p>
</fieldset>
<input type="submit" id="install_button" value="Install wallabag" name="install" />
2015-01-31 23:44:13 +00:00
</div>
</form>
</div>
<script>
2015-01-31 23:44:13 +00:00
<?php if (!is_dir('vendor')) : ?>
$(".database_info").hide();
$(".usersettings").hide();
<?php endif ?>
/*
* Database showing/hiding
*/
$("#mysql_infos").hide();
2015-01-31 22:44:20 +00:00
$("#mysql_description").hide();
$("#pg_infos").hide();
2015-01-31 22:44:20 +00:00
$("#postgres_description").hide();
$("#sqlite_description").show();
$("#pdo_postgres").hide();
$("#pdo_mysql").hide();
2015-01-31 23:44:13 +00:00
/*
* Details hiding
*/
$(".details").hide();
$("#utf8_mb4_infos").hide();
2015-01-31 23:44:13 +00:00
<?php
if (!isPassing()) : ?>
$('.technical').hide();
<?php
else :
?>
$('.technical').show();
<?php
endif;
?>
<?php
if (!extension_loaded('pdo_sqlite')) : ?>
$("#install_button").hide();
<?php
else :
?>
$("#pdo_sqlite").hide();
<?php
endif;
?>
$("#mysql_utf8_mb4").click(function() {
$("#utf8_mb4_infos").toggle();
});
$("input[name=db_engine]").click(function()
{
if ( $("#mysql").prop('checked')) {
$("#mysql_infos").show();
$("#pdo_mysql").show();
$("#pg_infos").hide();
$("#pdo_postgres").hide();
$("#pdo_sqlite").hide();
2015-01-31 22:44:20 +00:00
$("#sqlite_description").hide();
$("#postgres_description").hide();
$("#mysql_description").show();
2015-01-25 21:42:31 +00:00
$("#install_button").show();
}
else {
2014-04-23 20:39:43 +00:00
if ( $("#postgres").prop('checked')) {
$("#mysql_infos").hide();
$("#pdo_mysql").hide();
$("#pg_infos").show();
$("#pdo_postgres").show();
$("#pdo_sqlite").hide();
2015-01-31 22:44:20 +00:00
$("#sqlite_description").hide();
$("#mysql_description").hide();
$("#postgres_description").show();
$("#install_button").show();
}
else {
$("#mysql_infos").hide();
$("#pg_infos").hide();
$("#pdo_postgres").hide();
$("#pdo_mysql").hide();
2015-01-31 22:44:20 +00:00
$("#sqlite_description").show();
$("#mysql_description").hide();
$("#postgres_description").hide();
<?php
if (!extension_loaded('pdo_sqlite')) : ?>
$("#pdo_sqlite").show();
$("#install_button").hide();
<?php
endif;
?>
}
}
});
$(".detail").click(function()
{
$('.details').toggle();
});
2015-01-31 23:44:13 +00:00
$("#reloadpage").click(function()
{
location.reload();
});
2015-01-25 21:42:31 +00:00
</script>
</body>
2014-12-17 21:55:33 +00:00
</html>