-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCLConvert.php
37 lines (29 loc) · 864 Bytes
/
CLConvert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
use lcd344\UserManager\Converter;
use lcd344\UserModel;
use lcd344\Users;
define('DS', DIRECTORY_SEPARATOR);
if(isset(getopt('',['bootstrap:'])['bootstrap'])){
require(getopt('',['bootstrap:'])['bootstrap'] . DS . 'bootstrap.php');
} else {
require('kirby/bootstrap.php');
}
if(isset(getopt('',['server:'])['server'])) {
$_SERVER['SERVER_NAME'] = getopt('',['server:'])['server'];
}
$kirby = kirby();
$site = site();
$kirby->configure();
$kirby->extensions();
$kirby->models();
$kirby->plugins();
require_once ('Converter.php');
if(c::get('userManager.database',false)){
echo "Converting from files to db" . PHP_EOL;
Converter::toDatabase(kirby::instance()->roots()->site() . DS . c::get('userManager.folder'));
echo "Conversion ended";
} else {
echo "Converting from db to files" . PHP_EOL;
Converter::toFiles();
echo "Conversion ended";
}