1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the "php-ipfs" package. |
7
|
|
|
* |
8
|
|
|
* (c) Robert Schönthal <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace IPFS\Api; |
15
|
|
|
|
16
|
|
|
use IPFS\Annotation\Api as Endpoint; |
17
|
|
|
use IPFS\Command\Command; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @author Robert Schönthal <[email protected]> |
21
|
|
|
* @autogenerated |
22
|
|
|
* @codeCoverageIgnore |
23
|
|
|
*/ |
24
|
|
|
final class Config implements Api |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Open the config file for editing in $EDITOR. |
28
|
|
|
* |
29
|
|
|
* @Endpoint(name="config:edit") |
30
|
|
|
* |
31
|
|
|
* @return Command |
32
|
|
|
*/ |
33
|
|
|
public function edit(): Command |
34
|
|
|
{ |
35
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Apply profile to config. |
40
|
|
|
* |
41
|
|
|
* @Endpoint(name="config:profile:apply") |
42
|
|
|
* |
43
|
|
|
* @param string $arg the profile to apply to the config |
44
|
|
|
* |
45
|
|
|
* @return Command |
46
|
|
|
*/ |
47
|
|
|
public function profileApply(string $arg): Command |
48
|
|
|
{ |
49
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Replace the config with . |
54
|
|
|
* |
55
|
|
|
* @Endpoint(name="config:replace") |
56
|
|
|
* |
57
|
|
|
* @param string $file the file to use as the new config |
58
|
|
|
* |
59
|
|
|
* @return Command |
60
|
|
|
*/ |
61
|
|
|
public function replace(string $file): Command |
62
|
|
|
{ |
63
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Output config file contents. |
68
|
|
|
* |
69
|
|
|
* @Endpoint(name="config:show") |
70
|
|
|
* |
71
|
|
|
* @return Command |
72
|
|
|
*/ |
73
|
|
|
public function show(): Command |
74
|
|
|
{ |
75
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|