@@ -59,9 +59,9 @@ public static function create($class, array $settings = null)
5959 if (!in_array ($ class , self ::$ _classes_supported )) {
6060 throw new \Backup \Exception \InvalidArgumentException ('Class not supported. ' );
6161 }
62-
62+ $ path = ( isset ( $ settings [ ' binary_path ' ])? $ settings [ ' binary_path ' ]: null );
6363 if ($ class === 'Duplicity ' ) {
64- $ binary = new Binary ('duplicity ' );
64+ $ binary = new Binary ($ path ? $ path : 'duplicity ' );
6565
6666 if (empty ($ settings ['path_to_backup ' ]) || empty ($ settings ['destination ' ])) {
6767 throw new \Backup \Exception \InvalidArgumentException ('Please see the documentation for the settings needed. ' );
@@ -82,7 +82,7 @@ public static function create($class, array $settings = null)
8282
8383 return $ duplicity ;
8484 } elseif ($ class === 'Tar ' ) {
85- $ binary = new Binary ('tar ' );
85+ $ binary = new Binary ($ path ? $ path : 'tar ' );
8686
8787 if (empty ($ settings ['path_to_backup ' ]) || empty ($ settings ['destination ' ])) {
8888 throw new \Backup \Exception \InvalidArgumentException ('Please see the documentation for the settings needed. ' );
@@ -99,7 +99,7 @@ public static function create($class, array $settings = null)
9999
100100 return $ tar ;
101101 } elseif ($ class === 'Borg ' ) {
102- $ binary = new Binary ('borg ' );
102+ $ binary = new Binary ($ path ? $ path : 'borg ' );
103103
104104 if (empty ($ settings ['path_to_backup ' ]) || empty ($ settings ['destination ' ])) {
105105 throw new \Backup \Exception \InvalidArgumentException ('Please see the documentation for the settings needed. ' );
0 commit comments