mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-01 13:31:04 +00:00
Merge branch 'dev' into reloadarticle
This commit is contained in:
commit
b05f482dd2
21 changed files with 1093 additions and 2278 deletions
|
@ -8,6 +8,7 @@ wallabag is based on :
|
||||||
* Twig http://twig.sensiolabs.org
|
* Twig http://twig.sensiolabs.org
|
||||||
* Flash messages https://github.com/plasticbrain/PHP-Flash-Messages
|
* Flash messages https://github.com/plasticbrain/PHP-Flash-Messages
|
||||||
* Pagination https://github.com/daveismyname/pagination
|
* Pagination https://github.com/daveismyname/pagination
|
||||||
|
* PHPePub https://github.com/Grandt/PHPePub/
|
||||||
|
|
||||||
wallabag is mainly developed by Nicolas Lœuillet under the MIT License
|
wallabag is mainly developed by Nicolas Lœuillet under the MIT License
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,27 @@
|
||||||
{
|
{
|
||||||
|
"name": "wallabag/wallabag",
|
||||||
|
"type": "project",
|
||||||
|
"description": "open source self hostable read-it-later web application",
|
||||||
|
"keywords": ["read-it-later","read it later"],
|
||||||
|
"homepage": "https://github.com/wallabag/wallabag",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Lœuillet",
|
||||||
|
"email": "nicolas@loeuillet.org",
|
||||||
|
"homepage": "http://www.cdetc.fr",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Thomas Citharel",
|
||||||
|
"homepage": "http://tcit.fr",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"email": "hello@wallabag.org",
|
||||||
|
"issues": "https://github.com/wallabag/wallabag/issues"
|
||||||
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"twig/twig": "1.*",
|
"twig/twig": "1.*",
|
||||||
"twig/extensions": "1.0.*",
|
"twig/extensions": "1.0.*",
|
||||||
|
|
2
inc/3rdparty/libraries/MOBIClass/MOBI.php
vendored
2
inc/3rdparty/libraries/MOBIClass/MOBI.php
vendored
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
require_once(dirname(__FILE__)."/readability/Readability.php");
|
require_once(dirname(__FILE__)."/../readability/Readability.php");
|
||||||
require_once(dirname(__FILE__).'/CharacterEntities.php');
|
require_once(dirname(__FILE__).'/CharacterEntities.php');
|
||||||
require_once(dirname(__FILE__).'/constants.php');
|
require_once(dirname(__FILE__).'/constants.php');
|
||||||
require_once(dirname(__FILE__).'/ContentProvider.php');
|
require_once(dirname(__FILE__).'/ContentProvider.php');
|
||||||
|
|
|
@ -1,110 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* JavaScript-like HTML DOM Element
|
|
||||||
*
|
|
||||||
* This class extends PHP's DOMElement to allow
|
|
||||||
* users to get and set the innerHTML property of
|
|
||||||
* HTML elements in the same way it's done in
|
|
||||||
* JavaScript.
|
|
||||||
*
|
|
||||||
* Example usage:
|
|
||||||
* @code
|
|
||||||
* require_once 'JSLikeHTMLElement.php';
|
|
||||||
* header('Content-Type: text/plain');
|
|
||||||
* $doc = new DOMDocument();
|
|
||||||
* $doc->registerNodeClass('DOMElement', 'JSLikeHTMLElement');
|
|
||||||
* $doc->loadHTML('<div><p>Para 1</p><p>Para 2</p></div>');
|
|
||||||
* $elem = $doc->getElementsByTagName('div')->item(0);
|
|
||||||
*
|
|
||||||
* // print innerHTML
|
|
||||||
* echo $elem->innerHTML; // prints '<p>Para 1</p><p>Para 2</p>'
|
|
||||||
* echo "\n\n";
|
|
||||||
*
|
|
||||||
* // set innerHTML
|
|
||||||
* $elem->innerHTML = '<a href="http://fivefilters.org">FiveFilters.org</a>';
|
|
||||||
* echo $elem->innerHTML; // prints '<a href="http://fivefilters.org">FiveFilters.org</a>'
|
|
||||||
* echo "\n\n";
|
|
||||||
*
|
|
||||||
* // print document (with our changes)
|
|
||||||
* echo $doc->saveXML();
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* @author Keyvan Minoukadeh - http://www.keyvan.net - keyvan@keyvan.net
|
|
||||||
* @see http://fivefilters.org (the project this was written for)
|
|
||||||
*/
|
|
||||||
class JSLikeHTMLElement extends DOMElement
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Used for setting innerHTML like it's done in JavaScript:
|
|
||||||
* @code
|
|
||||||
* $div->innerHTML = '<h2>Chapter 2</h2><p>The story begins...</p>';
|
|
||||||
* @endcode
|
|
||||||
*/
|
|
||||||
public function __set($name, $value) {
|
|
||||||
if ($name == 'innerHTML') {
|
|
||||||
// first, empty the element
|
|
||||||
for ($x=$this->childNodes->length-1; $x>=0; $x--) {
|
|
||||||
$this->removeChild($this->childNodes->item($x));
|
|
||||||
}
|
|
||||||
// $value holds our new inner HTML
|
|
||||||
if ($value != '') {
|
|
||||||
$f = $this->ownerDocument->createDocumentFragment();
|
|
||||||
// appendXML() expects well-formed markup (XHTML)
|
|
||||||
$result = @$f->appendXML($value); // @ to suppress PHP warnings
|
|
||||||
if ($result) {
|
|
||||||
if ($f->hasChildNodes()) $this->appendChild($f);
|
|
||||||
} else {
|
|
||||||
// $value is probably ill-formed
|
|
||||||
$f = new DOMDocument();
|
|
||||||
$value = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
|
|
||||||
// Using <htmlfragment> will generate a warning, but so will bad HTML
|
|
||||||
// (and by this point, bad HTML is what we've got).
|
|
||||||
// We use it (and suppress the warning) because an HTML fragment will
|
|
||||||
// be wrapped around <html><body> tags which we don't really want to keep.
|
|
||||||
// Note: despite the warning, if loadHTML succeeds it will return true.
|
|
||||||
$result = @$f->loadHTML('<htmlfragment>'.$value.'</htmlfragment>');
|
|
||||||
if ($result) {
|
|
||||||
$import = $f->getElementsByTagName('htmlfragment')->item(0);
|
|
||||||
foreach ($import->childNodes as $child) {
|
|
||||||
$importedNode = $this->ownerDocument->importNode($child, true);
|
|
||||||
$this->appendChild($importedNode);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// oh well, we tried, we really did. :(
|
|
||||||
// this element is now empty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$trace = debug_backtrace();
|
|
||||||
trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used for getting innerHTML like it's done in JavaScript:
|
|
||||||
* @code
|
|
||||||
* $string = $div->innerHTML;
|
|
||||||
* @endcode
|
|
||||||
*/
|
|
||||||
public function __get($name)
|
|
||||||
{
|
|
||||||
if ($name == 'innerHTML') {
|
|
||||||
$inner = '';
|
|
||||||
foreach ($this->childNodes as $child) {
|
|
||||||
$inner .= $this->ownerDocument->saveXML($child);
|
|
||||||
}
|
|
||||||
return $inner;
|
|
||||||
}
|
|
||||||
|
|
||||||
$trace = debug_backtrace();
|
|
||||||
trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __toString()
|
|
||||||
{
|
|
||||||
return '['.$this->tagName.']';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
// This class allows us to do JavaScript like assignements to innerHTML
|
// This class allows us to do JavaScript like assignements to innerHTML
|
||||||
require_once(dirname(__FILE__).'/JSLikeHTMLElement.php');
|
require_once(dirname(__FILE__).'/JSLikeHTMLElement.php');
|
||||||
|
libxml_use_internal_errors(true);
|
||||||
|
|
||||||
// Alternative usage (for testing only!)
|
// Alternative usage (for testing only!)
|
||||||
// uncomment the lines below and call Readability.php in your browser
|
// uncomment the lines below and call Readability.php in your browser
|
||||||
|
@ -697,7 +698,7 @@ class Readability
|
||||||
$articleContent = $this->dom->createElement('div');
|
$articleContent = $this->dom->createElement('div');
|
||||||
$articleContent->setAttribute('id', 'readability-content');
|
$articleContent->setAttribute('id', 'readability-content');
|
||||||
$siblingScoreThreshold = max(10, ((int)$topCandidate->getAttribute('readability')) * 0.2);
|
$siblingScoreThreshold = max(10, ((int)$topCandidate->getAttribute('readability')) * 0.2);
|
||||||
$siblingNodes = $topCandidate->parentNode->childNodes;
|
$siblingNodes = @$topCandidate->parentNode->childNodes;
|
||||||
if (!isset($siblingNodes)) {
|
if (!isset($siblingNodes)) {
|
||||||
$siblingNodes = new stdClass;
|
$siblingNodes = new stdClass;
|
||||||
$siblingNodes->length = 0;
|
$siblingNodes->length = 0;
|
||||||
|
|
10
inc/3rdparty/libraries/tcpdf/tcpdf.php
vendored
10
inc/3rdparty/libraries/tcpdf/tcpdf.php
vendored
|
@ -2926,12 +2926,18 @@ class TCPDF {
|
||||||
*/
|
*/
|
||||||
public function Error($msg) {
|
public function Error($msg) {
|
||||||
// unset all class variables
|
// unset all class variables
|
||||||
|
$this->_destroy(true);
|
||||||
|
throw new Exception('TCPDF ERROR: '.$msg);
|
||||||
|
/*
|
||||||
|
|
||||||
|
I had problems with the constants for some reason, so here we force
|
||||||
|
|
||||||
$this->_destroy(true);
|
$this->_destroy(true);
|
||||||
if (defined('K_TCPDF_THROW_EXCEPTION_ERROR') AND !K_TCPDF_THROW_EXCEPTION_ERROR) {
|
if (defined('K_TCPDF_THROW_EXCEPTION_ERROR') AND !K_TCPDF_THROW_EXCEPTION_ERROR) {
|
||||||
die('<strong>TCPDF ERROR: </strong>'.$msg);
|
die('<strong>TCPDF ERROR: </strong>'.$msg);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('TCPDF ERROR: '.$msg);
|
throw new Exception('TCPDF ERROR: '.$msg);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6915,7 +6921,7 @@ class TCPDF {
|
||||||
$ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k;
|
$ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k;
|
||||||
$imsize = array($pw, $ph);
|
$imsize = array($pw, $ph);
|
||||||
} else {
|
} else {
|
||||||
$this->Error('[Image] Unable to get the size of the image: '.$file);
|
$this->Error('[Image] Unable to fetch image: '.$file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// file hash
|
// file hash
|
||||||
|
|
2
inc/3rdparty/makefulltextfeed.php
vendored
2
inc/3rdparty/makefulltextfeed.php
vendored
|
@ -31,6 +31,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//error_reporting(E_ALL ^ E_NOTICE);
|
//error_reporting(E_ALL ^ E_NOTICE);
|
||||||
ini_set("display_errors", 1);
|
ini_set("display_errors", 1);
|
||||||
@set_time_limit(120);
|
@set_time_limit(120);
|
||||||
|
libxml_use_internal_errors(true);
|
||||||
|
|
||||||
|
|
||||||
// Deal with magic quotes
|
// Deal with magic quotes
|
||||||
if (get_magic_quotes_gpc()) {
|
if (get_magic_quotes_gpc()) {
|
||||||
|
|
|
@ -180,6 +180,13 @@ class Poche
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if there are tags, add them to the new article
|
||||||
|
if (isset($_GET['tags'])) {
|
||||||
|
$_POST['value'] = $_GET['tags'];
|
||||||
|
$_POST['entry_id'] = $last_id;
|
||||||
|
$this->action('add_tag', $url);
|
||||||
|
}
|
||||||
|
|
||||||
$this->messages->add('s', _('the link has been added successfully'));
|
$this->messages->add('s', _('the link has been added successfully'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -192,8 +199,21 @@ class Poche
|
||||||
} else {
|
} else {
|
||||||
Tools::redirect('?view=home&closewin=true');
|
Tools::redirect('?view=home&closewin=true');
|
||||||
}
|
}
|
||||||
|
return $last_id;
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
|
if (isset($_GET['search'])) {
|
||||||
|
//when we want to apply a delete to a search
|
||||||
|
$tags = array($_GET['search']);
|
||||||
|
$allentry_ids = $this->store->search($tags[0], $this->user->getId());
|
||||||
|
$entry_ids = array();
|
||||||
|
foreach ($allentry_ids as $eachentry) {
|
||||||
|
$entry_ids[] = $eachentry[0];
|
||||||
|
}
|
||||||
|
} else { // delete a single article
|
||||||
|
$entry_ids = array($id);
|
||||||
|
}
|
||||||
|
foreach($entry_ids as $id) {
|
||||||
$msg = 'delete link #' . $id;
|
$msg = 'delete link #' . $id;
|
||||||
if ($this->store->deleteById($id, $this->user->getId())) {
|
if ($this->store->deleteById($id, $this->user->getId())) {
|
||||||
if (DOWNLOAD_PICTURES) {
|
if (DOWNLOAD_PICTURES) {
|
||||||
|
@ -206,6 +226,7 @@ class Poche
|
||||||
$msg = 'error : can\'t delete link #' . $id;
|
$msg = 'error : can\'t delete link #' . $id;
|
||||||
}
|
}
|
||||||
Tools::logm($msg);
|
Tools::logm($msg);
|
||||||
|
}
|
||||||
Tools::redirect('?');
|
Tools::redirect('?');
|
||||||
break;
|
break;
|
||||||
case 'toggle_fav' :
|
case 'toggle_fav' :
|
||||||
|
@ -220,8 +241,21 @@ class Poche
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'toggle_archive' :
|
case 'toggle_archive' :
|
||||||
|
if (isset($_GET['tag_id'])) {
|
||||||
|
//when we want to archive a whole tag
|
||||||
|
$tag_id = $_GET['tag_id'];
|
||||||
|
$allentry_ids = $this->store->retrieveEntriesByTag($tag_id, $this->user->getId());
|
||||||
|
$entry_ids = array();
|
||||||
|
foreach ($allentry_ids as $eachentry) {
|
||||||
|
$entry_ids[] = $eachentry[0];
|
||||||
|
}
|
||||||
|
} else { //archive a single article
|
||||||
|
$entry_ids = array($id);
|
||||||
|
}
|
||||||
|
foreach($entry_ids as $id) {
|
||||||
$this->store->archiveById($id, $this->user->getId());
|
$this->store->archiveById($id, $this->user->getId());
|
||||||
Tools::logm('archive link #' . $id);
|
Tools::logm('archive link #' . $id);
|
||||||
|
}
|
||||||
if ( Tools::isAjaxRequest() ) {
|
if ( Tools::isAjaxRequest() ) {
|
||||||
echo 1;
|
echo 1;
|
||||||
exit;
|
exit;
|
||||||
|
@ -414,8 +448,11 @@ class Poche
|
||||||
}
|
}
|
||||||
|
|
||||||
# flattr checking
|
# flattr checking
|
||||||
|
$flattr = NULL;
|
||||||
|
if (FLATTR) {
|
||||||
$flattr = new FlattrItem();
|
$flattr = new FlattrItem();
|
||||||
$flattr->checkItem($entry['url'], $entry['id']);
|
$flattr->checkItem($entry['url'], $entry['id']);
|
||||||
|
}
|
||||||
|
|
||||||
# tags
|
# tags
|
||||||
$tags = $this->store->retrieveTagsByEntry($entry['id']);
|
$tags = $this->store->retrieveTagsByEntry($entry['id']);
|
||||||
|
@ -549,6 +586,8 @@ class Poche
|
||||||
Tools::redirect($referer);
|
Tools::redirect($referer);
|
||||||
}
|
}
|
||||||
$this->messages->add('e', _('login failed: bad login or password'));
|
$this->messages->add('e', _('login failed: bad login or password'));
|
||||||
|
// log login failure in web server log to allow fail2ban usage
|
||||||
|
error_log('user '.$login.' authentication failure');
|
||||||
Tools::logm('login failed');
|
Tools::logm('login failed');
|
||||||
Tools::redirect();
|
Tools::redirect();
|
||||||
}
|
}
|
||||||
|
@ -634,7 +673,18 @@ class Poche
|
||||||
$urlsInserted[] = $url; //add
|
$urlsInserted[] = $url; //add
|
||||||
if (isset($record['tags']) && trim($record['tags'])) {
|
if (isset($record['tags']) && trim($record['tags'])) {
|
||||||
|
|
||||||
// @TODO: set tags
|
$tags = explode(',', $record['tags']);
|
||||||
|
foreach($tags as $tag) {
|
||||||
|
$entry_id = $id;
|
||||||
|
$tag_id = $this->store->retrieveTagByValue($tag);
|
||||||
|
if ($tag_id) {
|
||||||
|
$this->store->setTagToEntry($tag_id['id'], $entry_id);
|
||||||
|
} else {
|
||||||
|
$this->store->createTag($tag);
|
||||||
|
$tag_id = $this->store->retrieveTagByValue($tag);
|
||||||
|
$this->store->setTagToEntry($tag_id['id'], $entry_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -757,10 +807,11 @@ class Poche
|
||||||
*
|
*
|
||||||
* @param $token
|
* @param $token
|
||||||
* @param $user_id
|
* @param $user_id
|
||||||
* @param $tag_id
|
* @param $tag_id if $type is 'tag', the id of the tag to generate feed for
|
||||||
* @param string $type
|
* @param string $type the type of feed to generate
|
||||||
|
* @param int $limit the maximum number of items (0 means all)
|
||||||
*/
|
*/
|
||||||
public function generateFeeds($token, $user_id, $tag_id, $type = 'home')
|
public function generateFeeds($token, $user_id, $tag_id, $type = 'home', $limit = 0)
|
||||||
{
|
{
|
||||||
$allowed_types = array('home', 'fav', 'archive', 'tag');
|
$allowed_types = array('home', 'fav', 'archive', 'tag');
|
||||||
$config = $this->store->getConfigUser($user_id);
|
$config = $this->store->getConfigUser($user_id);
|
||||||
|
@ -787,8 +838,13 @@ class Poche
|
||||||
$entries = $this->store->getEntriesByView($type, $user_id);
|
$entries = $this->store->getEntriesByView($type, $user_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if $limit is set to zero, use all entries
|
||||||
|
if (0 == $limit) {
|
||||||
|
$limit = count($entries);
|
||||||
|
}
|
||||||
if (count($entries) > 0) {
|
if (count($entries) > 0) {
|
||||||
foreach ($entries as $entry) {
|
for ($i = 0; $i < min(count($entries), $limit); $i++) {
|
||||||
|
$entry = $entries[$i];
|
||||||
$newItem = $feed->createNewItem();
|
$newItem = $feed->createNewItem();
|
||||||
$newItem->setTitle($entry['title']);
|
$newItem->setTitle($entry['title']);
|
||||||
$newItem->setSource(Tools::getPocheUrl() . '?view=view&id=' . $entry['id']);
|
$newItem->setSource(Tools::getPocheUrl() . '?view=view&id=' . $entry['id']);
|
||||||
|
|
|
@ -102,7 +102,8 @@ class Routing
|
||||||
$this->wallabag->login($this->referer);
|
$this->wallabag->login($this->referer);
|
||||||
} elseif (isset($_GET['feed']) && isset($_GET['user_id'])) {
|
} elseif (isset($_GET['feed']) && isset($_GET['user_id'])) {
|
||||||
$tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0);
|
$tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0);
|
||||||
$this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type']);
|
$limit = (isset($_GET['limit']) ? intval($_GET['limit']) : 0);
|
||||||
|
$this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type'], $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//allowed ONLY to logged in user
|
//allowed ONLY to logged in user
|
||||||
|
@ -115,7 +116,7 @@ class Routing
|
||||||
// update password
|
// update password
|
||||||
$this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']);
|
$this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']);
|
||||||
} elseif (isset($_GET['newuser'])) {
|
} elseif (isset($_GET['newuser'])) {
|
||||||
$this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser']);
|
$this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser'], $_POST['newuseremail']);
|
||||||
} elseif (isset($_GET['deluser'])) {
|
} elseif (isset($_GET['deluser'])) {
|
||||||
$this->wallabag->deleteUser($_POST['password4deletinguser']);
|
$this->wallabag->deleteUser($_POST['password4deletinguser']);
|
||||||
} elseif (isset($_GET['epub'])) {
|
} elseif (isset($_GET['epub'])) {
|
||||||
|
|
|
@ -342,7 +342,10 @@ final class Tools
|
||||||
return $json;
|
return $json;
|
||||||
};
|
};
|
||||||
|
|
||||||
$json = $scope("inc/3rdparty/makefulltextfeed.php", array("url" => $url));
|
// Silence $scope function to avoid
|
||||||
|
// issues with FTRSS when error_reporting is to high
|
||||||
|
// FTRSS generates PHP warnings which break output
|
||||||
|
$json = @$scope("inc/3rdparty/makefulltextfeed.php", array("url" => $url));
|
||||||
|
|
||||||
// Clearing and restoring context
|
// Clearing and restoring context
|
||||||
foreach ($GLOBALS as $key => $value) {
|
foreach ($GLOBALS as $key => $value) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ class WallabagEBooks
|
||||||
$entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId());
|
$entry = $this->wallabag->store->retrieveOneById($entryID, $this->wallabag->user->getId());
|
||||||
$this->entries = array($entry);
|
$this->entries = array($entry);
|
||||||
$this->bookTitle = $entry['title'];
|
$this->bookTitle = $entry['title'];
|
||||||
$this->bookFileName = substr($this->bookTitle, 0, 200);
|
$this->bookFileName = str_replace('/', '_', substr($this->bookTitle, 0, 200));
|
||||||
$this->author = preg_replace('#^w{3}.#', '', Tools::getdomain($entry["url"])); # if only one article, set author to domain name (we strip the eventual www part)
|
$this->author = preg_replace('#^w{3}.#', '', Tools::getdomain($entry["url"])); # if only one article, set author to domain name (we strip the eventual www part)
|
||||||
Tools::logm('Producing ebook from article ' . $this->bookTitle);
|
Tools::logm('Producing ebook from article ' . $this->bookTitle);
|
||||||
break;
|
break;
|
||||||
|
@ -81,6 +81,9 @@ class WallabagEpub extends WallabagEBooks
|
||||||
public function produceEpub()
|
public function produceEpub()
|
||||||
{
|
{
|
||||||
Tools::logm('Starting to produce ePub 3 file');
|
Tools::logm('Starting to produce ePub 3 file');
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
$content_start =
|
$content_start =
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
. "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n"
|
. "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n"
|
||||||
|
@ -156,6 +159,11 @@ class WallabagEpub extends WallabagEBooks
|
||||||
$zipData = $book->sendBook($this->bookFileName);
|
$zipData = $book->sendBook($this->bookFileName);
|
||||||
Tools::logm('Ebook produced');
|
Tools::logm('Ebook produced');
|
||||||
}
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
Tools::logm('PHPePub has encountered an error : '.$e->getMessage());
|
||||||
|
$this->wallabag->messages->add('e', $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class WallabagMobi extends WallabagEBooks
|
class WallabagMobi extends WallabagEBooks
|
||||||
|
@ -167,7 +175,7 @@ class WallabagMobi extends WallabagEBooks
|
||||||
|
|
||||||
public function produceMobi()
|
public function produceMobi()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
Tools::logm('Starting to produce Mobi file');
|
Tools::logm('Starting to produce Mobi file');
|
||||||
$mobi = new MOBI();
|
$mobi = new MOBI();
|
||||||
$content = new MOBIFile();
|
$content = new MOBIFile();
|
||||||
|
@ -194,10 +202,18 @@ class WallabagMobi extends WallabagEBooks
|
||||||
}
|
}
|
||||||
$mobi->setContentProvider($content);
|
$mobi->setContentProvider($content);
|
||||||
|
|
||||||
|
// the browser inside Kindle Devices doesn't likes special caracters either, we limit to A-z/0-9
|
||||||
|
$this->bookFileName = preg_replace('/[^A-Za-z0-9\-]/', '', $this->bookFileName);
|
||||||
|
|
||||||
// we offer file to download
|
// we offer file to download
|
||||||
$mobi->download($this->bookFileName.'.mobi');
|
$mobi->download($this->bookFileName.'.mobi');
|
||||||
Tools::logm('Mobi file produced');
|
Tools::logm('Mobi file produced');
|
||||||
}
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
Tools::logm('PHPMobi has encountered an error : '.$e->getMessage());
|
||||||
|
$this->wallabag->messages->add('e', $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class WallabagPDF extends WallabagEbooks
|
class WallabagPDF extends WallabagEbooks
|
||||||
|
@ -206,15 +222,16 @@ class WallabagPDF extends WallabagEbooks
|
||||||
{
|
{
|
||||||
|
|
||||||
Tools::logm('Starting to produce PDF file');
|
Tools::logm('Starting to produce PDF file');
|
||||||
|
@define ('K_TCPDF_THROW_EXCEPTION_ERROR', TRUE);
|
||||||
|
try {
|
||||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
Tools::logm('Filling metadata for PDF...');
|
Tools::logm('Filling metadata for PDF...');
|
||||||
$pdf->SetCreator(PDF_CREATOR);
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
$pdf->SetAuthor('');
|
$pdf->SetAuthor('wallabag');
|
||||||
$pdf->SetTitle($this->bookTitle);
|
$pdf->SetTitle($this->bookTitle);
|
||||||
$pdf->SetSubject('TCPDF Tutorial');
|
$pdf->SetSubject('Articles via wallabag');
|
||||||
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
$pdf->SetKeywords('wallabag');
|
||||||
|
|
||||||
Tools::logm('Adding introduction...');
|
Tools::logm('Adding introduction...');
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
@ -229,11 +246,14 @@ class WallabagPDF extends WallabagEbooks
|
||||||
$i = 1;
|
$i = 1;
|
||||||
Tools::logm('Adding actual content...');
|
Tools::logm('Adding actual content...');
|
||||||
foreach ($this->entries as $item) {
|
foreach ($this->entries as $item) {
|
||||||
|
$tags = $this->wallabag->store->retrieveTagsByEntry($entry['id']);
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$pdf->SetKeywords($tag['value']);
|
||||||
|
}
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
$html = '<h1>' . $item['title'] . '</h1>';
|
$html = '<h1>' . $item['title'] . '</h1>';
|
||||||
$html .= $item['content'];
|
$html .= $item['content'];
|
||||||
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
|
||||||
$i = $i+1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set image scale factor
|
// set image scale factor
|
||||||
|
@ -241,6 +261,11 @@ class WallabagPDF extends WallabagEbooks
|
||||||
|
|
||||||
|
|
||||||
$pdf->Output($this->bookFileName . '.pdf', 'FD');
|
$pdf->Output($this->bookFileName . '.pdf', 'FD');
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
Tools::logm('TCPDF has encountered an error : '.$e->getMessage());
|
||||||
|
$this->wallabag->messages->add('e', $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,18 +11,7 @@
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$successes = array();
|
$successes = array();
|
||||||
|
|
||||||
/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
|
require_once('wallabag_compatibility_test.php');
|
||||||
* Idea : nbari at dalmp dot com
|
|
||||||
* Rights unknown
|
|
||||||
* Here in case of .gitignore files
|
|
||||||
*/
|
|
||||||
function delTree($dir) {
|
|
||||||
$files = array_diff(scandir($dir), array('.','..'));
|
|
||||||
foreach ($files as $file) {
|
|
||||||
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
|
|
||||||
}
|
|
||||||
return rmdir($dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['clean'])) {
|
if (isset($_GET['clean'])) {
|
||||||
if (is_dir('install')){
|
if (is_dir('install')){
|
||||||
|
@ -58,27 +47,10 @@ if (isset($_POST['download'])) {
|
||||||
else if (isset($_POST['install'])) {
|
else if (isset($_POST['install'])) {
|
||||||
if (!is_dir('vendor')) {
|
if (!is_dir('vendor')) {
|
||||||
$errors[] = 'You must install twig before.';
|
$errors[] = 'You must install twig before.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$continue = true;
|
$continue = true;
|
||||||
// Create config.inc.php
|
|
||||||
if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) {
|
|
||||||
$errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.';
|
|
||||||
$continue = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
function generate_salt() {
|
|
||||||
mt_srand(microtime(true)*100000 + memory_get_usage(true));
|
|
||||||
return md5(uniqid(mt_rand(), true));
|
|
||||||
}
|
|
||||||
|
|
||||||
$content = file_get_contents('inc/poche/config.inc.php');
|
|
||||||
$salt = generate_salt();
|
$salt = generate_salt();
|
||||||
$content = str_replace("define ('SALT', '');", "define ('SALT', '".$salt."');", $content);
|
$content = file_get_contents('inc/poche/config.inc.default.php');
|
||||||
file_put_contents('inc/poche/config.inc.php', $content);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($continue) {
|
|
||||||
|
|
||||||
// User informations
|
// User informations
|
||||||
$username = trim($_POST['username']);
|
$username = trim($_POST['username']);
|
||||||
|
@ -87,19 +59,20 @@ else if (isset($_POST['install'])) {
|
||||||
|
|
||||||
// Database informations
|
// Database informations
|
||||||
$moreQueries = array();
|
$moreQueries = array();
|
||||||
|
|
||||||
if ($_POST['db_engine'] == 'sqlite') {
|
if ($_POST['db_engine'] == 'sqlite') {
|
||||||
if (!copy('install/poche.sqlite', 'db/poche.sqlite')) {
|
if (!copy('install/poche.sqlite', 'db/poche.sqlite')) {
|
||||||
$errors[] = 'Impossible to create inc/poche/config.inc.php file.';
|
$errors[] = 'Impossible to create the SQLite database file.';
|
||||||
$continue = false;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite';
|
$db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite';
|
||||||
$handle = new PDO($db_path);
|
$handle = new PDO($db_path);
|
||||||
|
$handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
$sql_structure = "";
|
$sql_structure = "";
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
// MySQL and Postgre
|
||||||
$content = file_get_contents('inc/poche/config.inc.php');
|
try {
|
||||||
|
|
||||||
if ($_POST['db_engine'] == 'mysql') {
|
if ($_POST['db_engine'] == 'mysql') {
|
||||||
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'] . ';charset=utf8mb4';
|
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'] . ';charset=utf8mb4';
|
||||||
|
@ -137,34 +110,15 @@ else if (isset($_POST['install'])) {
|
||||||
|
|
||||||
$sql_structure = file_get_contents('install/postgres.sql');
|
$sql_structure = file_get_contents('install/postgres.sql');
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = str_replace("define ('STORAGE', 'sqlite');", "define ('STORAGE', '".$_POST['db_engine']."');", $content);
|
|
||||||
file_put_contents('inc/poche/config.inc.php', $content);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($continue) {
|
|
||||||
|
|
||||||
function executeQuery($handle, $sql, $params) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$query = $handle->prepare($sql);
|
|
||||||
$query->execute($params);
|
|
||||||
return $query->fetchAll();
|
|
||||||
}
|
|
||||||
catch (Exception $e)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_POST['db_engine'] != "sqlite") {
|
|
||||||
// create database structure
|
// create database structure
|
||||||
$query = $handle->exec($sql_structure);
|
$query = $handle->exec($sql_structure);
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$errors[] = $e->getMessage();
|
||||||
|
$continue = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Create user
|
}
|
||||||
$handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
if ($continue) {
|
||||||
|
|
||||||
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
|
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
|
||||||
$params = array($username, $salted_password, $username);
|
$params = array($username, $salted_password, $username);
|
||||||
$query = executeQuery($handle, $sql, $params);
|
$query = executeQuery($handle, $sql, $params);
|
||||||
|
@ -182,11 +136,19 @@ else if (isset($_POST['install'])) {
|
||||||
foreach ($moreQueries as $query) {
|
foreach ($moreQueries as $query) {
|
||||||
executeQuery($handle, $query, array());
|
executeQuery($handle, $query, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
$successes[] = 'wallabag is now installed. You can now <a href="index.php?clean=0">access it !</a>';
|
$successes[] = 'wallabag is now installed. You can now <a href="index.php?clean=0">access it !</a>';
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
$content = str_replace("define ('SALT', '');", "define ('SALT', '".$salt."');", $content);
|
||||||
|
file_put_contents('inc/poche/config.inc.php', $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
@ -208,8 +170,162 @@ else if (isset($_POST['install'])) {
|
||||||
<link rel="stylesheet" href="themes/baggy/css/main.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/messages.css" media="all">
|
||||||
<link rel="stylesheet" href="themes/baggy/css/print.css" media="print">
|
<link rel="stylesheet" href="themes/baggy/css/print.css" media="print">
|
||||||
<script src="themes/default/js/jquery-2.0.3.min.js"></script>
|
<script src="themes/_global/js/jquery-2.0.3.min.js"></script>
|
||||||
<script src="themes/baggy/js/init.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;
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
#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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="w600p center mbm">
|
<header class="w600p center mbm">
|
||||||
|
@ -259,12 +375,171 @@ else if (isset($_POST['install'])) {
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<p>To install wallabag, you just have to fill the following fields. That's all.</p>
|
<p>To install wallabag, you just have to fill the following fields. That's all.</p>
|
||||||
<p>If you need help, you can read the doc: <a href="docs/" target="_blank">offline documentation</a> and <a href="http://doc.wallabag.org" target="_blank">online one</a> (already up-to-date).</p>
|
<p>If you need help, you can read the doc: <a href="docs/" target="_blank">offline documentation</a> and <a href="http://doc.wallabag.org" target="_blank">online one</a> (already up-to-date).</p>
|
||||||
<p>Don't forget to check your server compatibility <a href="install/wallabag_compatibility_test.php?from=install">here</a>.</p>
|
|
||||||
<form method="post">
|
<div>
|
||||||
<fieldset>
|
<h2>Server compatibility test</h2>
|
||||||
<legend><strong>Technical settings</strong></legend>
|
<?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>
|
||||||
|
<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">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 — 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 — 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>
|
||||||
|
<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">
|
||||||
|
<hr>
|
||||||
|
<div class='twig'>
|
||||||
|
<h2>Twig installation</h2>
|
||||||
<?php if (!is_dir('vendor')) : ?>
|
<?php if (!is_dir('vendor')) : ?>
|
||||||
<div class='messages notice install'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:<br />
|
|
||||||
|
<p>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>automatically download and extract vendor.zip into your wallabag folder.
|
<li>automatically download and extract vendor.zip into your wallabag folder.
|
||||||
<p><input type="submit" name="download" value="Download vendor.zip" /></p>
|
<p><input type="submit" name="download" value="Download vendor.zip" /></p>
|
||||||
|
@ -272,11 +547,20 @@ else if (isset($_POST['install'])) {
|
||||||
<b>Be careful, zip extension is not enabled in your PHP configuration. You'll have to unzip vendor.zip manually.</b>
|
<b>Be careful, zip extension is not enabled in your PHP configuration. You'll have to unzip vendor.zip manually.</b>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<em>This method is mainly recommended if you don't have a dedicated server.</em></li>
|
<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> :<pre><code>curl -s http://getcomposer.org/installer | php
|
<li>use <a href="http://getcomposer.org/">Composer</a> in your wallabag folder :<pre><code>curl -s http://getcomposer.org/installer | php
|
||||||
php composer.phar install</code></pre></li>
|
php composer.phar install</code></pre>
|
||||||
|
<span id="reloadpage">Reload to check</span>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
<?php else : ?>
|
||||||
|
Twig is properly installed.
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<div class="database_info">
|
||||||
|
<hr>
|
||||||
|
<fieldset class="database_inputs">
|
||||||
|
<legend><strong>Database settings</strong></legend>
|
||||||
<p>
|
<p>
|
||||||
Database engine:
|
Database engine:
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -287,6 +571,9 @@ php composer.phar install</code></pre></li>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="mysql">MySQL</label> <input name="db_engine" type="radio" id="mysql" value="mysql" />
|
<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">
|
<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_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_database">Database</label> <input type="text" placeholder="wallabag" id="mysql_database" name="mysql_database" /></li>
|
||||||
|
@ -296,6 +583,9 @@ php composer.phar install</code></pre></li>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="postgres">PostgreSQL</label> <input name="db_engine" type="radio" id="postgres" value="postgres" />
|
<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">
|
<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_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_database">Database</label> <input type="text" placeholder="wallabag" id="pg_database" name="pg_database" /></li>
|
||||||
|
@ -306,8 +596,21 @@ php composer.phar install</code></pre></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<div class="descriptions">
|
||||||
<fieldset>
|
<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 is one of the most popular database systems. It comes with most shared hosting plans.
|
||||||
|
</div>
|
||||||
|
<div id="postgres_description">
|
||||||
|
PostgreSQL. Because some people prefer it to MySQL.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="usersettings">
|
||||||
|
<fieldset style="clear: both">
|
||||||
<legend><strong>User settings</strong></legend>
|
<legend><strong>User settings</strong></legend>
|
||||||
<p>
|
<p>
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
|
@ -323,13 +626,42 @@ php composer.phar install</code></pre></li>
|
||||||
<input type="email" id="email" name="email" />
|
<input type="email" id="email" name="email" />
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<input type="submit" id="install_button" value="Install wallabag" name="install" />
|
<input type="submit" id="install_button" value="Install wallabag" name="install" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
<?php if (!is_dir('vendor')) : ?>
|
||||||
|
$(".database_info").hide();
|
||||||
|
$(".usersettings").hide();
|
||||||
|
<?php endif ?>
|
||||||
|
/*
|
||||||
|
* Database showing/hiding
|
||||||
|
*/
|
||||||
$("#mysql_infos").hide();
|
$("#mysql_infos").hide();
|
||||||
|
$("#mysql_description").hide();
|
||||||
$("#pg_infos").hide();
|
$("#pg_infos").hide();
|
||||||
|
$("#postgres_description").hide();
|
||||||
|
$("#sqlite_description").show();
|
||||||
|
$("#pdo_postgres").hide();
|
||||||
|
$("#pdo_mysql").hide();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Details hiding
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(".details").hide();
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (!isPassing()) : ?>
|
||||||
|
$('.technical').hide();
|
||||||
|
<?php
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
$('.technical').show();
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded('pdo_sqlite')) : ?>
|
if (!extension_loaded('pdo_sqlite')) : ?>
|
||||||
|
@ -346,20 +678,35 @@ php composer.phar install</code></pre></li>
|
||||||
{
|
{
|
||||||
if ( $("#mysql").prop('checked')) {
|
if ( $("#mysql").prop('checked')) {
|
||||||
$("#mysql_infos").show();
|
$("#mysql_infos").show();
|
||||||
|
$("#pdo_mysql").show();
|
||||||
$("#pg_infos").hide();
|
$("#pg_infos").hide();
|
||||||
|
$("#pdo_postgres").hide();
|
||||||
$("#pdo_sqlite").hide();
|
$("#pdo_sqlite").hide();
|
||||||
|
$("#sqlite_description").hide();
|
||||||
|
$("#postgres_description").hide();
|
||||||
|
$("#mysql_description").show();
|
||||||
$("#install_button").show();
|
$("#install_button").show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( $("#postgres").prop('checked')) {
|
if ( $("#postgres").prop('checked')) {
|
||||||
$("#mysql_infos").hide();
|
$("#mysql_infos").hide();
|
||||||
|
$("#pdo_mysql").hide();
|
||||||
$("#pg_infos").show();
|
$("#pg_infos").show();
|
||||||
|
$("#pdo_postgres").show();
|
||||||
$("#pdo_sqlite").hide();
|
$("#pdo_sqlite").hide();
|
||||||
|
$("#sqlite_description").hide();
|
||||||
|
$("#mysql_description").hide();
|
||||||
|
$("#postgres_description").show();
|
||||||
$("#install_button").show();
|
$("#install_button").show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#mysql_infos").hide();
|
$("#mysql_infos").hide();
|
||||||
$("#pg_infos").hide();
|
$("#pg_infos").hide();
|
||||||
|
$("#pdo_postgres").hide();
|
||||||
|
$("#pdo_mysql").hide();
|
||||||
|
$("#sqlite_description").show();
|
||||||
|
$("#mysql_description").hide();
|
||||||
|
$("#postgres_description").hide();
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded('pdo_sqlite')) : ?>
|
if (!extension_loaded('pdo_sqlite')) : ?>
|
||||||
$("#pdo_sqlite").show();
|
$("#pdo_sqlite").show();
|
||||||
|
@ -370,6 +717,16 @@ php composer.phar install</code></pre></li>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".detail").click(function()
|
||||||
|
{
|
||||||
|
$('.details').toggle();
|
||||||
|
});
|
||||||
|
$("#reloadpage").click(function()
|
||||||
|
{
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
* @license http://opensource.org/licenses/MIT see COPYING file
|
* @license http://opensource.org/licenses/MIT see COPYING file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function status() {
|
||||||
$app_name = 'wallabag';
|
$app_name = 'wallabag';
|
||||||
|
|
||||||
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.3.3', '>='));
|
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.3.3', '>='));
|
||||||
|
$pdo_ok = class_exists('PDO');
|
||||||
$pcre_ok = extension_loaded('pcre');
|
$pcre_ok = extension_loaded('pcre');
|
||||||
$zlib_ok = extension_loaded('zlib');
|
$zlib_ok = extension_loaded('zlib');
|
||||||
$mbstring_ok = extension_loaded('mbstring');
|
$mbstring_ok = extension_loaded('mbstring');
|
||||||
|
@ -24,7 +26,7 @@ $allow_url_fopen_ok = (bool)ini_get('allow_url_fopen');
|
||||||
$filter_ok = extension_loaded('filter');
|
$filter_ok = extension_loaded('filter');
|
||||||
$gettext_ok = function_exists("gettext");
|
$gettext_ok = function_exists("gettext");
|
||||||
$gd_ok = extension_loaded('gd');
|
$gd_ok = extension_loaded('gd');
|
||||||
|
$pdo_drivers_passing = extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql');
|
||||||
|
|
||||||
if (extension_loaded('xmlreader')) {
|
if (extension_loaded('xmlreader')) {
|
||||||
$xml_ok = true;
|
$xml_ok = true;
|
||||||
|
@ -37,391 +39,50 @@ if (extension_loaded('xmlreader')) {
|
||||||
$xml_ok = false;
|
$xml_ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-type: text/html; charset=UTF-8');
|
$status = array('app_name' => $app_name, 'php' => $php_ok, 'pdo' => $pdo_ok, 'pdo_drivers_passing' => $pdo_drivers_passing, 'xml' => $xml_ok, 'pcre' => $pcre_ok, 'zlib' => $zlib_ok, 'mbstring' => $mbstring_ok, 'dom' => $dom_ok, 'iconv' => $iconv_ok, 'tidy' => $tidy_ok, 'curl' => $curl_ok, 'parse_ini' => $parse_ini_ok, 'parallel' => $parallel_ok, 'allow_url_fopen' => $allow_url_fopen_ok, 'filter' => $filter_ok, 'gettext' => $gettext_ok, 'gd' => $gd_ok);
|
||||||
|
|
||||||
?><!DOCTYPE html>
|
return $status;
|
||||||
|
}
|
||||||
<html lang="en">
|
function isOkay() {
|
||||||
<head>
|
return !in_array(false, status());
|
||||||
<title><?php echo $app_name; ?>: Server Compatibility Test</title>
|
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
font:14px/1.4em "Lucida Grande", Verdana, Arial, Helvetica, Clean, Sans, sans-serif;
|
|
||||||
letter-spacing:0px;
|
|
||||||
color:#333;
|
|
||||||
margin:0;
|
|
||||||
padding:0;
|
|
||||||
background:#fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div#site {
|
function isPassing() {
|
||||||
width:550px;
|
$status = status();
|
||||||
margin:20px auto 0 auto;
|
unset($status['curl'], $status['parallel'], $status['tidy'], $status['gd'], $status['filter']);
|
||||||
|
return !in_array(false, $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
|
||||||
color:#000;
|
* Idea : nbari at dalmp dot com
|
||||||
text-decoration:underline;
|
* Rights unknown
|
||||||
padding:0 1px;
|
* Here in case of .gitignore files
|
||||||
|
*/
|
||||||
|
|
||||||
|
function delTree($dir) {
|
||||||
|
$files = array_diff(scandir($dir), array('.','..'));
|
||||||
|
foreach ($files as $file) {
|
||||||
|
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
|
||||||
|
}
|
||||||
|
return rmdir($dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
function generate_salt() {
|
||||||
|
mt_srand(microtime(true)*100000 + memory_get_usage(true));
|
||||||
|
return md5(uniqid(mt_rand(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
function executeQuery($handle, $sql, $params) {
|
||||||
color:#fff;
|
try
|
||||||
background-color:#333;
|
{
|
||||||
text-decoration:none;
|
$query = $handle->prepare($sql);
|
||||||
padding:0 1px;
|
$query->execute($params);
|
||||||
|
return $query->fetchAll();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
margin:30px 0 20px 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<?php
|
|
||||||
$frominstall = false;
|
|
||||||
if (isset($_GET['from'])){
|
|
||||||
if ($_GET['from'] == 'install'){
|
|
||||||
$frominstall = true;
|
|
||||||
}}
|
|
||||||
?>
|
?>
|
||||||
<div id="site">
|
|
||||||
<div id="content">
|
|
||||||
|
|
||||||
<div class="chunk">
|
|
||||||
<h2 style="text-align:center;"><?php echo $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>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr class="<?php echo ($php_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td>PHP</td>
|
|
||||||
<td>5.3.3 or higher</td>
|
|
||||||
<td class="<?php echo ($php_ok) ? 'good' : 'disabled'; ?>"><?php echo phpversion(); ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($xml_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/xml">XML</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($xml_ok) ? '<td class="good">Enabled, and sane</span>' : '<td class="bad">Disabled, or broken'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($pcre_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/pcre">PCRE</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($pcre_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<!-- <tr class="<?php echo ($zlib_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/zlib">Zlib</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($zlib_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr> -->
|
|
||||||
<!-- <tr class="<?php echo ($mbstring_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/mbstring">mbstring</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($mbstring_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr> -->
|
|
||||||
<!-- <tr class="<?php echo ($iconv_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/iconv">iconv</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($iconv_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr> -->
|
|
||||||
<tr class="<?php echo ($dom_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/manual/en/book.dom.php">DOM / XML extension</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($dom_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($filter_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://uk.php.net/manual/en/book.filter.php">Data filtering</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($filter_ok) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($gd_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/manual/en/book.image.php">GD</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($gd_ok) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($tidy_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/tidy">Tidy</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($tidy_ok) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($curl_ok) ? '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>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($parse_ini_ok) ? '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 ($parse_ini_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($parallel_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td>Parallel URL fetching</td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($parallel_ok) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($allow_url_fopen_ok) ? '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 ($allow_url_fopen_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="<?php echo ($gettext_ok) ? 'enabled' : 'disabled'; ?>">
|
|
||||||
<td><a href="http://php.net/manual/en/book.gettext.php">gettext</a></td>
|
|
||||||
<td>Enabled</td>
|
|
||||||
<?php echo ($gettext_ok) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="chunk">
|
|
||||||
<h3>What does this mean?</h3>
|
|
||||||
<ol>
|
|
||||||
<?php //if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $iconv_ok && $filter_ok && $zlib_ok && $tidy_ok && $curl_ok && $parallel_ok && $allow_url_fopen_ok): ?>
|
|
||||||
<?php if ($php_ok && $xml_ok && $pcre_ok && $dom_ok && $filter_ok && $gd_ok && $tidy_ok && $curl_ok && $parallel_ok && $allow_url_fopen_ok && $gettext_ok && $parse_ini_ok): ?>
|
|
||||||
<li><em>You have everything you need to run <?php echo $app_name; ?> properly! Congratulations!</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php if ($php_ok): ?>
|
|
||||||
<li><strong>PHP:</strong> You are running a supported version of PHP. <em>No problems here.</em></li>
|
|
||||||
<?php if ($xml_ok): ?>
|
|
||||||
<li><strong>XML:</strong> You have XMLReader support or a version of XML support that isn't broken installed. <em>No problems here.</em></li>
|
|
||||||
<?php if ($pcre_ok): ?>
|
|
||||||
<li><strong>PCRE:</strong> You have PCRE support installed. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($allow_url_fopen_ok): ?>
|
|
||||||
<li><strong>allow_url_fopen:</strong> You have allow_url_fopen enabled. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($gettext_ok): ?>
|
|
||||||
<li><strong>Gettext:</strong> You have <code>gettext</code> enabled. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($parse_ini_ok): ?>
|
|
||||||
<li><strong>Parse ini:</strong> You can parse <em>ini</em> files. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($dom_ok): ?>
|
|
||||||
<li><strong>DOM/XML:</strong> You can parse <em>ini</em> files. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($filter_ok): ?>
|
|
||||||
<li><strong>Data filtering:</strong> You can use the PHP build-in DOM to operate on XML documents. <em>No problems here.</em></li>
|
|
||||||
|
|
||||||
<?php if ($zlib_ok): ?>
|
|
||||||
<li><strong>Zlib:</strong> You have <code>Zlib</code> enabled. This allows SimplePie to support GZIP-encoded feeds. <em>No problems here.</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>Zlib:</strong> The <code>Zlib</code> extension is not available. SimplePie will ignore any GZIP-encoding, and instead handle feeds as uncompressed text.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($mbstring_ok && $iconv_ok): ?>
|
|
||||||
<li><strong>mbstring and iconv:</strong> You have both <code>mbstring</code> and <code>iconv</code> installed! This will allow <?php echo $app_name; ?> to handle the greatest number of languages. <em>No problems here.</em></li>
|
|
||||||
<?php elseif ($mbstring_ok): ?>
|
|
||||||
<li><strong>mbstring:</strong> <code>mbstring</code> is installed, but <code>iconv</code> is not.</li>
|
|
||||||
<?php elseif ($iconv_ok): ?>
|
|
||||||
<li><strong>iconv:</strong> <code>iconv</code> is installed, but <code>mbstring</code> is not.</li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><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 feeds, as well as even some English ones.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($gd_ok): ?>
|
|
||||||
<li><strong>GD:</strong> You have <code>GD</code> support installed. <em>No problems here.</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>GD:</strong> The <code>GD</code> extension is not available. <?php echo $app_name; ?> will not be able to download pictures locally on your server.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($tidy_ok): ?>
|
|
||||||
<li><strong>Tidy:</strong> You have <code>Tidy</code> support installed. <em>No problems here.</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>Tidy:</strong> The <code>Tidy</code> extension is not available. <?php echo $app_name; ?> should still work with most feeds, 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>.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($curl_ok): ?>
|
|
||||||
<li><strong>cURL:</strong> You have <code>cURL</code> support installed. <em>No problems here.</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>cURL:</strong> The <code>cURL</code> extension is not available. SimplePie will use <code>fsockopen()</code> instead.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($parallel_ok): ?>
|
|
||||||
<li><strong>Parallel URL fetching:</strong> You have <code>HttpRequestPool</code> or <code>curl_multi</code> support installed. <em>No problems here.</em></li>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>Parallel URL fetching:</strong> <code>HttpRequestPool</code> or <code>curl_multi</code> support is not available. <?php echo $app_name; ?> will use <code>file_get_contents()</code> instead to fetch URLs sequentially rather than in parallel.</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>Data filtering:</strong> Your PHP configuration has the filter extension disabled. <strong><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<li><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><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else : ?>
|
|
||||||
<li><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><?php echo $app_name; ?> will not work here.</strong>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<li><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><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled. <strong><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>PCRE:</strong> Your PHP installation doesn't support Perl-Compatible Regular Expressions. <strong><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>XML:</strong> Your PHP installation doesn't support XML parsing. <strong><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<li><strong>PHP:</strong> You are running an unsupported version of PHP. <strong><?php echo $app_name; ?> will not work here.</strong></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="chunk">
|
|
||||||
<?php //if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $iconv_ok && $filter_ok && $allow_url_fopen_ok) { ?>
|
|
||||||
<?php if ($php_ok && $xml_ok && $pcre_ok && $filter_ok && $allow_url_fopen_ok && $gettext_ok && $parse_ini_ok) { ?>
|
|
||||||
<h3>Bottom Line: Yes, you can!</h3>
|
|
||||||
<p><em>Your webhost has its act together!</em></p>
|
|
||||||
<?php if (!$frominstall) { ?>
|
|
||||||
<p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
|
|
||||||
<p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and/or start using wallabag</p>
|
|
||||||
<?php } else { ?>
|
|
||||||
<p>You can now <a href="../index.php">return to the installation section</a>.</p>
|
|
||||||
<?php } ?>
|
|
||||||
<p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost — it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
|
|
||||||
<?php //} else if ($php_ok && $xml_ok && $pcre_ok && $mbstring_ok && $allow_url_fopen_ok && $filter_ok) { ?>
|
|
||||||
<?php } else if ($php_ok && $xml_ok && $pcre_ok && $allow_url_fopen_ok && $filter_ok && $gettext_ok && $parse_ini_ok) { ?>
|
|
||||||
<h3>Bottom Line: Yes, you can!</h3>
|
|
||||||
<p><em>For most feeds, it'll run with no problems.</em> There are certain languages that you might have a hard time with though.</p>
|
|
||||||
<?php if (!$frominstall) { ?>
|
|
||||||
<p>You can download the latest version of <?php echo $app_name; ?> from <a href="http://wallabag.org/download">wallabag.org</a>.</p>
|
|
||||||
<p>If you already have done that, you should access <a href="index.php">the index.php file</a> of your installation to configure and/or start using wallabag</p>
|
|
||||||
<?php } else { ?>
|
|
||||||
<p>You can now <a href="../index.php">return to the installation section</a>.</p>
|
|
||||||
<?php } ?>
|
|
||||||
<p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $app_name; ?> will run on your webhost — 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 $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>
|
|
||||||
<?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>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -250,7 +250,7 @@ msgid ""
|
||||||
"your config file: IMPORT_LIMIT (how many articles are fetched at once) and "
|
"your config file: IMPORT_LIMIT (how many articles are fetched at once) and "
|
||||||
"IMPORT_DELAY (delay between fetch of next batch of articles)."
|
"IMPORT_DELAY (delay between fetch of next batch of articles)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Sélectionner le fichier à importer sur votre disque dur, et pressez la "
|
"Sélectionnez le fichier à importer sur votre disque dur, et pressez la "
|
||||||
"bouton « Importer » ci-dessous.<br />wallabag analysera votre fichier, "
|
"bouton « Importer » ci-dessous.<br />wallabag analysera votre fichier, "
|
||||||
"ajoutera toutes les URL trouvées et commencera à télécharger les contenus si "
|
"ajoutera toutes les URL trouvées et commencera à télécharger les contenus si "
|
||||||
"nécessaire.<br />Le processus de téléchargement est contrôlé par deux "
|
"nécessaire.<br />Le processus de téléchargement est contrôlé par deux "
|
||||||
|
|
|
@ -60,6 +60,10 @@
|
||||||
{% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %}
|
{% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %}
|
||||||
{% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br />
|
{% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br />
|
||||||
|
|
||||||
|
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br />
|
||||||
|
|
||||||
|
{% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a><br />{% endif %}
|
||||||
|
|
||||||
{% if tag %}
|
{% if tag %}
|
||||||
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
||||||
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
||||||
|
|
|
@ -1,127 +0,0 @@
|
||||||
{% extends "layout.twig" %}
|
|
||||||
|
|
||||||
{% block title %}{% trans "config" %}{% endblock %}
|
|
||||||
{% block menu %}
|
|
||||||
{% include '_menu.twig' %}
|
|
||||||
{% endblock %}
|
|
||||||
{% block content %}
|
|
||||||
<div id="config">
|
|
||||||
<h2>{% trans "Poching a link" %}</h2>
|
|
||||||
<p>{% trans "There are several ways to save an article:" %} (<a class="special" href="http://doc.wallabag.org" title="{% trans "read the documentation" %}">?</a>)</p>
|
|
||||||
<ul>
|
|
||||||
<li>Firefox: <a href="https://addons.mozilla.org/firefox/addon/wallabag/" title="download the firefox extension">{% trans "download the extension" %}</a></li>
|
|
||||||
<li>Chrome: <a href="http://doc.wallabag.org/doku.php?id=users:chrome_extension" title="download the chrome extension">{% trans "download the extension" %}</a></li>
|
|
||||||
<li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" title="download the application">{% trans "via F-Droid" %}</a> {% trans " or " %} <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="download the application">{% trans "via Google Play" %}</a></li>
|
|
||||||
<li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" title="download the iOS application">{% trans "download the application" %}</a></li>
|
|
||||||
<li>Windows Phone: <a href="http://www.windowsphone.com/en-us/store/app/wallabag/ff890514-348c-4d0b-9b43-153fff3f7450" title="download the window phone application">{% trans "download the application" %}</a></li>
|
|
||||||
<li>
|
|
||||||
<form method="get" action="index.php">
|
|
||||||
<label class="addurl" for="plainurl">{% trans "by filling this field" %}:</label>
|
|
||||||
<input required placeholder="Ex:mywebsite.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
|
|
||||||
<input type="submit" value="{% trans "bag it!" %}" />
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
<li>{% trans "bookmarklet: drag & drop this link to your bookmarks bar" %} <a id="bookmarklet" ondragend="this.click();" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@wallabag.org']){top['bookmarklet-url@wallabag.org'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "bag it!" %}</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>{% trans "Upgrading wallabag" %}</h2>
|
|
||||||
<ul>
|
|
||||||
<li>{% trans "your version" %} : <strong>{{ constant('POCHE') }}</strong></li>
|
|
||||||
<li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://wallabag.org/">{% trans "a more recent stable version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
|
|
||||||
{% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://wallabag.org/">{% trans "a more recent development version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>{% trans "Change your theme" %}</h2>
|
|
||||||
<form method="post" action="?updatetheme" name="changethemeform">
|
|
||||||
<fieldset class="w500p">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="theme">{% trans "Theme:" %}</label>
|
|
||||||
<select class="col" id="theme" name="theme">
|
|
||||||
{% for key, theme in themes %}
|
|
||||||
<option value="{{ key }}" {{ theme.current ? 'selected' : '' }}>{{ theme.name }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="row mts txtcenter">
|
|
||||||
<button class="bouton" type="submit" tabindex="4">{% trans "Update" %}</button>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<input type="hidden" name="returnurl" value="{{ referer }}">
|
|
||||||
<input type="hidden" name="token" value="{{ token }}">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<h2>{% trans "Change your password" %}</h2>
|
|
||||||
<form method="post" action="?config" name="loginform">
|
|
||||||
<fieldset class="w500p">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="password">{% trans "New password:" %}</label>
|
|
||||||
<input class="col" type="password" id="password" name="password" placeholder="{% trans "Password" %}" tabindex="2">
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="password_repeat">{% trans "Repeat your new password:" %}</label>
|
|
||||||
<input class="col" type="password" id="password_repeat" name="password_repeat" placeholder="{% trans "Password" %}" tabindex="3">
|
|
||||||
</div>
|
|
||||||
<div class="row mts txtcenter">
|
|
||||||
<button class="bouton" type="submit" tabindex="4">{% trans "Update" %}</button>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<input type="hidden" name="returnurl" value="{{ referer }}">
|
|
||||||
<input type="hidden" name="token" value="{{ token }}">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<h2>{% trans "Import" %}</h2>
|
|
||||||
<p>{% trans "Please execute the import script locally, it can take a very long time." %}</p>
|
|
||||||
<p>{% trans "More infos in the official doc:" %} <a href="http://doc.wallabag.org">wallabag.org</a></p>
|
|
||||||
<ul>
|
|
||||||
<li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('POCKET_FILE')) }}</li>
|
|
||||||
<li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('READABILITY_FILE')) }}</li>
|
|
||||||
<li><a href="./?import&from=instapaper">{% trans "import from Instapaper" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('INSTAPAPER_FILE')) }}</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2>{% trans "Export your wallabag data" %}</h2>
|
|
||||||
<p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
|
|
||||||
|
|
||||||
<h2>{% trans "Fancy an E-Book ?" %}</h2>
|
|
||||||
<p>{% trans "Click to get all your articles in one ebook :" %}
|
|
||||||
<ul>
|
|
||||||
<li><a href="./?epub&method=all" title="Generate ePub file">ePub 3</a></li>
|
|
||||||
<li><a href="./?mobi&method=all" title="Generate Mobi file">Mobi</a></li>
|
|
||||||
<li><a href="./?pdf&method=all" title="Generate PDF file">PDF</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
|
|
||||||
|
|
||||||
<h2>{% trans 'Add user' %}</h2>
|
|
||||||
<p>{% trans 'Add a new user :' %}</p>
|
|
||||||
<form method="post" action="?newuser">
|
|
||||||
<fieldset class="w500p">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="newusername">{% trans 'Login for new user' %}</label>
|
|
||||||
<input class="col" type="text" id="newusername" name="newusername" placeholder="{% trans 'Login' %}">
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="password4newuser">{% trans "Password for new user" %}</label>
|
|
||||||
<input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans "Password" %}">
|
|
||||||
</div>
|
|
||||||
<div class="row mts txtcenter">
|
|
||||||
<button type="submit">{% trans "Send" %}</button>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<h2>{% trans "Delete account" %}</h2>
|
|
||||||
{% if not only_user %}<form method="post" action="?deluser">
|
|
||||||
<p>{% trans "You can delete your account by entering your password and validating." %}<br /><b>{% trans "Be careful, data will be erased forever (that is a very long time)." %}</b></p>
|
|
||||||
<fieldset class="w500p">
|
|
||||||
<div class="row">
|
|
||||||
<label class="col w150p" for="password4deletinguser">{% trans "Type here your password" %}</label>
|
|
||||||
<input class="col" type="password" id="password4deletinguser" name="password4deletinguser" placeholder="{% trans "Password" %}">
|
|
||||||
</div>
|
|
||||||
<div class="row mts txtcenter">
|
|
||||||
<button type="submit">{% trans "Send" %}</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% else %}<p>{% trans "You are the only user, you cannot delete your own account." %}<br />
|
|
||||||
{% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}</p>{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
|
@ -60,6 +60,10 @@
|
||||||
{% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %}
|
{% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %}
|
||||||
{% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br />
|
{% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br />
|
||||||
|
|
||||||
|
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br />
|
||||||
|
|
||||||
|
{% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a><br />{% endif %}
|
||||||
|
|
||||||
{% if tag %}
|
{% if tag %}
|
||||||
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
||||||
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue