mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-05-07 22:05:02 +02:00
Fix # 48 Allow to change location of the database
This commit is contained in:
@@ -6,6 +6,7 @@ Revision history for Lutim
|
||||
- Allow Lutim to be on a sub-directory (like http://example.org/lutim/) (#46 and #57)
|
||||
- Remove deprecated (due to typo) option "provisionning".
|
||||
- Allow to upload svg images (no thumbnail for now, ImageMagick in Debian Jessie don't work with svg) (#47)
|
||||
- Allow to change location of the database (#48)
|
||||
|
||||
0.6 2014-10-03
|
||||
- Add OpenGraph tags in social page (ex-twitter page)
|
||||
|
||||
+18
-3
@@ -1,10 +1,25 @@
|
||||
package LutimModel;
|
||||
use Mojolicious;
|
||||
use FindBin qw($Bin);
|
||||
use File::Spec qw(catfile);
|
||||
|
||||
BEGIN {
|
||||
my $m = Mojolicious->new;
|
||||
our $config = $m->plugin('Config' =>
|
||||
{
|
||||
file => File::Spec->catfile($Bin, '..' ,'lutim.conf'),
|
||||
default => {
|
||||
db_path => 'lutim.db'
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
# Create database
|
||||
use ORLite {
|
||||
file => 'lutim.db',
|
||||
file => $config->{db_path},
|
||||
unicode => 1,
|
||||
create => sub {
|
||||
create => sub {
|
||||
my $dbh = shift;
|
||||
$dbh->do(
|
||||
'CREATE TABLE lutim (
|
||||
@@ -25,7 +40,7 @@ use ORLite {
|
||||
height INTEGER)'
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
@@ -103,6 +103,12 @@
|
||||
# optional, defaut is /
|
||||
#prefix => '/',
|
||||
|
||||
# define a path to the SQLite database
|
||||
# you can define it relative to lutim directory or set an absolute path
|
||||
# remember that it has to be in a directory writable by Lutim user
|
||||
# optional, default is lutim.db
|
||||
#db_path => 'lutim.db',
|
||||
|
||||
##########################
|
||||
# Lutim cron jobs settings
|
||||
##########################
|
||||
|
||||
Reference in New Issue
Block a user