-
Notifications
You must be signed in to change notification settings - Fork 7
/
example.php
41 lines (40 loc) · 930 Bytes
/
example.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
38
39
40
41
<?php
require_once("Backuper.php");
$b=new Backuper([
"upload"=>[
"WebDAV"=>[
"server"=>'https://webdav.yandex.ru/',
"login"=>"test",
"pass"=>"test",
"dir"=>'/Backups'
],
'DropboxSimple'=>[
"login"=>"[email protected]",
"pass"=>'test',
"dir"=>'/Backups'
],
/*'SugarSync'=>array( //now this doesn't work
"login"=>"[email protected]",
"pass"=>'test',
"dir"=>'/Backups',
"accessKeyId"=>"AAAAAAAAAAAAAAAAAAAAAAAAAAA",
"privateAccessKey"=>"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
),*/
],
'backup'=>array(
"FileTree"=>[
"."
],
"MySQL"=>array(
"base"=>new PDO('mysql:dbname=test;host=127.0.0.1',"test"),
),
//or "MySQL"=>new PDO('mysql:dbname=test;host=127.0.0.1',"root","",array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)),
)
]);
$b->makeBackup();
//or
$b=new Backuper(
json_decode(file_get_contents("prefs.json"),1)
);
$b->makeBackup();
?>