diff options
Diffstat (limited to 'bin/install')
-rwxr-xr-x | bin/install | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/install b/bin/install index be4371b1..5b93e46e 100755 --- a/bin/install +++ b/bin/install | |||
@@ -1,14 +1,14 @@ | |||
1 | #!/usr/bin/php | 1 | #!/usr/bin/php |
2 | <?php | 2 | <?php |
3 | require_once __DIR__. '/../vendor/autoload.php'; | ||
4 | |||
5 | use Symfony\Component\Yaml\Yaml; | ||
6 | |||
7 | $parameters = Yaml::parse(file_get_contents('app/config/parameters.yml')); | ||
3 | 8 | ||
4 | echo 'Okay, you want to install wallabag, let\'s go!'; | 9 | echo 'Okay, you want to install wallabag, let\'s go!'; |
5 | echo "\r\n"; | 10 | echo "\r\n"; |
6 | 11 | ||
7 | function generateSalt() { | ||
8 | mt_srand(microtime(true)*100000 + memory_get_usage(true)); | ||
9 | return md5(uniqid(mt_rand(), true)); | ||
10 | } | ||
11 | |||
12 | function executeQuery($handle, $sql, $params) { | 12 | function executeQuery($handle, $sql, $params) { |
13 | try | 13 | try |
14 | { | 14 | { |
@@ -26,7 +26,7 @@ $configFile = 'app/config/config.inc.php'; | |||
26 | $dbFile = 'app/db/poche.sqlite'; | 26 | $dbFile = 'app/db/poche.sqlite'; |
27 | $username = 'wallabag'; | 27 | $username = 'wallabag'; |
28 | $password = 'wallabag'; | 28 | $password = 'wallabag'; |
29 | $salt = generateSalt(); | 29 | $salt = $parameters['parameters']['secret']; |
30 | $defaultLanguage = 'en_EN.UTF8'; | 30 | $defaultLanguage = 'en_EN.UTF8'; |
31 | 31 | ||
32 | if (!copy('app/config/config.inc.default.php', $configFile)) { | 32 | if (!copy('app/config/config.inc.default.php', $configFile)) { |