From 93fd4692f6eb753cae16358131c8049d84cfbb41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= <nicolas@loeuillet.org>
Date: Thu, 22 Jan 2015 08:30:07 +0100
Subject: symfony is there

---
 bin/install | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'bin/install')

diff --git a/bin/install b/bin/install
index be4371b1..5b93e46e 100755
--- a/bin/install
+++ b/bin/install
@@ -1,14 +1,14 @@
 #!/usr/bin/php
 <?php
+require_once __DIR__. '/../vendor/autoload.php';
+
+use Symfony\Component\Yaml\Yaml;
+
+$parameters = Yaml::parse(file_get_contents('app/config/parameters.yml'));
 
 echo 'Okay, you want to install wallabag, let\'s go!';
 echo "\r\n";
 
-function generateSalt() {
-    mt_srand(microtime(true)*100000 + memory_get_usage(true));
-    return md5(uniqid(mt_rand(), true));
-}
-
 function executeQuery($handle, $sql, $params) {
     try
     {
@@ -26,7 +26,7 @@ $configFile      = 'app/config/config.inc.php';
 $dbFile          = 'app/db/poche.sqlite';
 $username        = 'wallabag';
 $password        = 'wallabag';
-$salt            = generateSalt();
+$salt            = $parameters['parameters']['secret'];
 $defaultLanguage = 'en_EN.UTF8';
 
 if (!copy('app/config/config.inc.default.php', $configFile)) {
-- 
cgit v1.2.3