mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Merge remote-tracking branch 'origin/master' into 2.1
This commit is contained in:
commit
d7b4b2c72c
12 changed files with 76 additions and 18 deletions
|
@ -71,8 +71,10 @@ class InstallCommand extends ContainerAwareCommand
|
|||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 1 of 4.</comment> Checking system requirements.</info>');
|
||||
|
||||
$fulfilled = true;
|
||||
$rows = [];
|
||||
|
||||
// testing if database driver exists
|
||||
$fulfilled = true;
|
||||
$label = '<comment>PDO Driver</comment>';
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
@ -83,7 +85,23 @@ class InstallCommand extends ContainerAwareCommand
|
|||
$help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.';
|
||||
}
|
||||
|
||||
$rows = [];
|
||||
$rows[] = [$label, $status, $help];
|
||||
|
||||
// testing if connection to the database can be etablished
|
||||
$label = '<comment>Database connection</comment>';
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
try {
|
||||
$this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
|
||||
} catch (\Exception $e) {
|
||||
if (false === strpos($e->getMessage(), 'Unknown database')) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'Can\'t connect to the database: '.$e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = [$label, $status, $help];
|
||||
|
||||
foreach ($this->functionExists as $functionRequired) {
|
||||
|
@ -451,7 +469,7 @@ class InstallCommand extends ContainerAwareCommand
|
|||
}
|
||||
|
||||
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
||||
if ('sqlite' == $schemaManager->getDatabasePlatform()->getName()) {
|
||||
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
||||
$params = $this->getContainer()->get('doctrine.dbal.default_connection')->getParams();
|
||||
|
||||
if (isset($params['path']) && file_exists($params['path'])) {
|
||||
|
|
|
@ -163,8 +163,12 @@ class EntriesExport
|
|||
$book->setSubject($tag['value']);
|
||||
}
|
||||
|
||||
// the reader in Kobo Devices doesn't likes special caracters
|
||||
// in filenames, we limit to A-z/0-9
|
||||
$filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle());
|
||||
|
||||
$chapter = $content_start.$entry->getContent().$bookEnd;
|
||||
$book->addChapter($entry->getTitle(), htmlspecialchars($entry->getTitle()).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
|
||||
$book->addChapter($entry->getTitle(), htmlspecialchars($filename).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
|
||||
}
|
||||
|
||||
return Response::create(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue