Fixed installer issues
This commit is contained in:
Sergio Brighenti 2020-04-06 12:43:47 +02:00
parent ce497f9728
commit 63c332a697
11 changed files with 75 additions and 20 deletions

View file

@ -1,4 +1,4 @@
## v.3.1 (WIP) ## v.3.1
+ Added tagging system (add, delete, search of tagged files). + Added tagging system (add, delete, search of tagged files).
+ Added basic media auto-tagging on upload. + Added basic media auto-tagging on upload.
+ Added registration system. + Added registration system.

View file

@ -154,7 +154,7 @@ module.exports = function (grunt) {
command: '"./vendor/bin/phpstan" analyse app resources/lang bin install' command: '"./vendor/bin/phpstan" analyse app resources/lang bin install'
}, },
composer_no_dev: { composer_no_dev: {
command: 'composer install --no-dev' command: 'composer install --no-dev --prefer-dist'
} }
} }

View file

@ -468,7 +468,12 @@ if (!function_exists('dsnFromConfig')) {
*/ */
function dsnFromConfig(array $config): string function dsnFromConfig(array $config): string
{ {
return $config['db']['connection'].':'.$config['db']['dsn']; $dsn = $config['db']['dsn'];
if ($config['db']['connection'] === 'sqlite' && file_exists($config['db']['dsn'])) {
$dsn = realpath($config['db']['dsn']);
}
return $config['db']['connection'].':'.$dsn;
} }
} }

View file

@ -34,7 +34,7 @@ $config = array_replace_recursive([
'maintenance' => false, 'maintenance' => false,
'db' => [ 'db' => [
'connection' => 'sqlite', 'connection' => 'sqlite',
'dsn' => BASE_DIR.'resources/database/xbackbone.db', 'dsn' => BASE_DIR.implode(DIRECTORY_SEPARATOR, ['resources', 'database', 'xbackbone.db']),
'username' => null, 'username' => null,
'password' => null, 'password' => null,
], ],

View file

@ -21,7 +21,8 @@
"slim/slim": "^4.0", "slim/slim": "^4.0",
"spatie/flysystem-dropbox": "^1.0", "spatie/flysystem-dropbox": "^1.0",
"superbalist/flysystem-google-storage": "^7.2", "superbalist/flysystem-google-storage": "^7.2",
"twig/twig": "^2.12" "twig/twig": "^2.12",
"avto-dev/composer-cleanup-plugin": "^2.0"
}, },
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,

52
composer.lock generated
View file

@ -4,8 +4,58 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "979e04cb72a48a50d7872132f8efa29f", "content-hash": "1963bb9b1a8f5fad240b9f85112ac008",
"packages": [ "packages": [
{
"name": "avto-dev/composer-cleanup-plugin",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/avto-dev/composer-cleanup-plugin.git",
"reference": "62d55ce097b7ea4336fa89b872ef21cacd5f82cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/avto-dev/composer-cleanup-plugin/zipball/62d55ce097b7ea4336fa89b872ef21cacd5f82cd",
"reference": "62d55ce097b7ea4336fa89b872ef21cacd5f82cd",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": "^7.1.3"
},
"require-dev": {
"composer/composer": "^1.8.6",
"phpstan/phpstan": "~0.12",
"phpunit/phpunit": "~7.5",
"symfony/var-dumper": "~3.2 || ^4.0"
},
"type": "composer-plugin",
"extra": {
"class": "AvtoDev\\Composer\\Cleanup\\Plugin"
},
"autoload": {
"psr-4": {
"AvtoDev\\Composer\\Cleanup\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "avto-dev",
"homepage": "https://github.com/avto-dev"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "A composer cleanup plugin, to remove tests and documentation to save space",
"time": "2020-02-09T18:06:15+00:00"
},
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.134.3", "version": "3.134.3",

View file

@ -4,7 +4,7 @@ title: Changelog
nav_order: 8 nav_order: 8
--- ---
## v.3.1 (WIP) ## v.3.1
+ Added tagging system (add, delete, search of tagged files). + Added tagging system (add, delete, search of tagged files).
+ Added basic media auto-tagging on upload. + Added basic media auto-tagging on upload.
+ Added registration system. + Added registration system.

View file

@ -44,7 +44,7 @@ return [
], ],
'db' => [ 'db' => [
'connection' => 'sqlite', // current support for sqlite and mysql 'connection' => 'sqlite', // current support for sqlite and mysql
'dsn' => realpath(__DIR__).'/resources/database/xbackbone.db', // if sqlite, this must be an absolute path 'dsn' => 'abs/path/to/resources/database/xbackbone.db', // if sqlite should be an absolute path
'username' => null, // username and password not needed for sqlite 'username' => null, // username and password not needed for sqlite
'password' => null, 'password' => null,
] ]

View file

@ -6,7 +6,6 @@ require __DIR__.'/../vendor/autoload.php';
use App\Database\DB; use App\Database\DB;
use App\Database\Migrator; use App\Database\Migrator;
use App\Factories\ViewFactory; use App\Factories\ViewFactory;
use App\Web\Media;
use App\Web\Session; use App\Web\Session;
use App\Web\View; use App\Web\View;
use DI\Bridge\Slim\Bridge; use DI\Bridge\Slim\Bridge;
@ -29,7 +28,7 @@ $config = [
'debug' => true, 'debug' => true,
'db' => [ 'db' => [
'connection' => 'sqlite', 'connection' => 'sqlite',
'dsn' => realpath(__DIR__.'/../').DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, ['resources', 'database', 'xbackbone.db']), 'dsn' => BASE_DIR.implode(DIRECTORY_SEPARATOR, ['resources', 'database', 'xbackbone.db']),
'username' => null, 'username' => null,
'password' => null, 'password' => null,
], ],
@ -227,7 +226,7 @@ $app->post('/', function (Request $request, Response $response, Filesystem $stor
cleanDirectory(__DIR__.'/../resources/cache'); cleanDirectory(__DIR__.'/../resources/cache');
cleanDirectory(__DIR__.'/../resources/sessions'); cleanDirectory(__DIR__.'/../resources/sessions');
//removeDirectory(__DIR__.'/../install'); removeDirectory(__DIR__.'/../install');
// Installed successfully, destroy the installer session // Installed successfully, destroy the installer session
$session->destroy(); $session->destroy();

View file

@ -6,13 +6,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="XBackBone Installer"> <meta name="description" content="XBackBone Installer">
<link href="../static/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="../static/bootstrap/css/bootstrap.min.css?{{ 'now'|date('U') }}" rel="stylesheet">
<link href="../static/fontawesome/css/all.min.css" rel="stylesheet"> <link href="../static/fontawesome/css/all.min.css?{{ 'now'|date('U') }}" rel="stylesheet">
<link href="../static/app/app.css" rel="stylesheet"> <link href="../static/app/app.css?{{ 'now'|date('U') }}" rel="stylesheet">
<script src="../static/jquery/jquery.min.js"></script> <script src="../static/jquery/jquery.min.js?{{ 'now'|date('U') }}"></script>
<script src="../static/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="../static/bootstrap/js/bootstrap.bundle.min.js?{{ 'now'|date('U') }}"></script>
<script src="installer.js"></script> <script src="installer.js?{{ 'now'|date('U') }}"></script>
</head> </head>
<body class="bg-light"> <body class="bg-light">
<div class="container"> <div class="container">

View file

@ -10,15 +10,15 @@ $(document).ready(function () {
$connection.change(function () { $connection.change(function () {
$allDatabaseOptions.hide(); $allDatabaseOptions.hide();
$allDatabaseInputs.prop('required', ''); $allDatabaseInputs.prop('required', '').prop('disabled', 'disabled');
switch ($(this).val()) { switch ($(this).val()) {
case 'sqlite': case 'sqlite':
$('#dsn').val(sqliteDSN); $('#dsn').val(sqliteDSN);
break; break;
case 'mysql': case 'mysql':
$('#dsn').val('host=localhost;port=3306;dbname=xbackbone'); $('#dsn').val('host=localhost;port=3306;dbname=xbackbone');
$('#db_user').prop('required', 'required').parent().parent().show(); $('#db_user').prop('disabled', '').prop('required', 'required').parent().parent().show();
$('#db_password').prop('required', 'required').parent().parent().show(); $('#db_password').prop('disabled', '').prop('required', 'required').parent().parent().show();
break; break;
} }
}); });