]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - bin/install
toggle archive / fav actions
[github/wallabag/wallabag.git] / bin / install
index be4371b124528223130478a3184bd9e0f3c07550..61ffcb658ee97ff7bac689e5c7c24c5682d77d87 100755 (executable)
@@ -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)) {
@@ -67,8 +67,6 @@ $query  = executeQuery($handle, $sql, $params);
 
 echo 'wallabag is now installed';
 echo "\r\n";
-echo 'Just execute the following commands for using wallabag:';
-echo "\r\n";
-echo 'cd web';
+echo 'Just execute `php app/console server:run` for using wallabag:';
 echo "\r\n";
-echo 'php -S localhost:8000';
\ No newline at end of file
+echo 'http://localhost:8000';
\ No newline at end of file