File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change
1
+ # 0.9 (17 March, 2017)
2
+ * Added ` /sbin/btrfs ` to the list of checked binary locations (used on Gentoo)
3
+
1
4
# 0.8 (24 March, 2016)
2
5
* ` minimum_delete_count ` and ` minimum_delete_count_other ` options introduced
3
6
Original file line number Diff line number Diff line change 2
2
<?php
3
3
namespace nazarpc ;
4
4
use
5
+ RuntimeException ,
5
6
SQLite3 ;
6
7
7
8
/**
8
9
* @package Just backup btrfs
9
10
* @author Nazar Mokrynskyi <[email protected] >
10
11
* @copyright Copyright (c) 2014-2017, Nazar Mokrynskyi
11
12
* @license http://opensource.org/licenses/MIT
12
- * @version 0.7
13
+ * @version 0.9
13
14
*/
14
15
class Just_backup_btrfs {
15
16
/**
@@ -22,13 +23,23 @@ class Just_backup_btrfs {
22
23
protected $ binary ;
23
24
/**
24
25
* @param array $config
26
+ *
27
+ * @throws RuntimeException
25
28
*/
26
29
function __construct ($ config ) {
27
30
if (!$ config ) {
28
31
exit ("Incorrect configuration, aborted \n" );
29
32
}
30
33
$ this ->config = $ config ;
31
- $ this ->binary = file_exists ('/usr/sbin/btrfs ' ) ? '/usr/sbin/btrfs ' : '/bin/btrfs ' ;
34
+ if (file_exists ('/usr/sbin/btrfs ' )) {
35
+ $ this ->binary = '/usr/sbin/btrfs ' ;
36
+ } elseif (file_exists ('/sbin/btrfs ' )) {
37
+ $ this ->binary = '/sbin/btrfs ' ;
38
+ } elseif (file_exists ('/bin/btrfs ' )) {
39
+ $ this ->binary = '/bin/btrfs ' ;
40
+ } else {
41
+ throw new RuntimeException ("Can't find btrfs binary " );
42
+ }
32
43
}
33
44
function backup () {
34
45
$ default_config = [
You can’t perform that action at this time.
0 commit comments