X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=3c4d3f2597b243e53b083f451be4945369279b4b;hb=b5a5377af12048e05269fc490e588c1b777cde13;hp=9fe903577b3e122f1ef6dbff706047ac0eb4b10c;hpb=da4136557963018287cae61226e9006c3c741747;p=github%2Fwallabag%2Fwallabag.git
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 9fe90357..3c4d3f25 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -72,6 +72,7 @@ class InstallCommand extends ContainerAwareCommand
protected function checkRequirements()
{
$this->defaultOutput->writeln('Step 1 of 4. Checking system requirements.');
+ $doctrineManager = $this->getContainer()->get('doctrine')->getManager();
$rows = [];
@@ -108,21 +109,39 @@ class InstallCommand extends ContainerAwareCommand
$rows[] = [$label, $status, $help];
+ // check MySQL & PostgreSQL version
+ $label = 'Database version';
+ $status = 'OK!';
+ $help = '';
+
// now check if MySQL isn't too old to handle utf8mb4
- if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
+ if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) {
$version = $conn->query('select version()')->fetchColumn();
$minimalVersion = '5.5.4';
if (false === version_compare($version, $minimalVersion, '>')) {
$fulfilled = false;
- $rows[] = [
- 'Database version',
- 'ERROR!',
- 'Your MySQL version ('.$version.') is too old, consider upgrading ('.$minimalVersion.'+).',
- ];
+ $status = 'ERROR!';
+ $help = 'Your MySQL version ('.$version.') is too old, consider upgrading ('.$minimalVersion.'+).';
+ }
+ }
+
+ // testing if PostgreSQL > 9.1
+ if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) {
+ // return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
+ $version = $doctrineManager->getConnection()->query('SELECT version();')->fetchColumn();
+
+ preg_match('/PostgreSQL ([0-9\.]+)/i', $version, $matches);
+
+ if (isset($matches[1]) & version_compare($matches[1], '9.2.0', '<')) {
+ $fulfilled = false;
+ $status = 'ERROR!';
+ $help = 'PostgreSQL should be greater than 9.1 (actual version: '.$matches[1].')';
}
}
+ $rows[] = [$label, $status, $help];
+
foreach ($this->functionExists as $functionRequired) {
$label = ''.$functionRequired.'';
$status = 'OK!';
@@ -293,6 +312,16 @@ class InstallCommand extends ContainerAwareCommand
'value' => 'http://diasporapod.com',
'section' => 'entry',
],
+ [
+ 'name' => 'share_unmark',
+ 'value' => '1',
+ 'section' => 'entry',
+ ],
+ [
+ 'name' => 'unmark_url',
+ 'value' => 'https://unmark.it',
+ 'section' => 'entry',
+ ],
[
'name' => 'share_shaarli',
'value' => '1',
@@ -303,6 +332,16 @@ class InstallCommand extends ContainerAwareCommand
'value' => 'http://myshaarli.com',
'section' => 'entry',
],
+ [
+ 'name' => 'share_scuttle',
+ 'value' => '1',
+ 'section' => 'entry',
+ ],
+ [
+ 'name' => 'scuttle_url',
+ 'value' => 'http://scuttle.org',
+ 'section' => 'entry',
+ ],
[
'name' => 'share_mail',
'value' => '1',
@@ -403,6 +442,11 @@ class InstallCommand extends ContainerAwareCommand
'value' => '0',
'section' => 'misc',
],
+ [
+ 'name' => 'restricted_access',
+ 'value' => '0',
+ 'section' => 'entry',
+ ],
];
foreach ($settings as $setting) {