]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - bin/install
symfony is there
[github/wallabag/wallabag.git] / bin / install
index ad9914099cfc23de3a4610a7965fd8a4f552390e..5b93e46e3cd7bb06eba2e8ac00b695f5d59dda44 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)) {
@@ -66,3 +66,9 @@ $params = array($idUser, 'language', $defaultLanguage);
 $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 "\r\n";
+echo 'php -S localhost:8000';
\ No newline at end of file