1 | <?php |
||
32 | class AppManager { |
||
33 | |||
34 | /** |
||
35 | * @var OccRunner $occRunner |
||
36 | */ |
||
37 | protected $occRunner; |
||
38 | |||
39 | /** |
||
40 | * @var array $disabledApps |
||
41 | */ |
||
42 | protected $disabledApps = []; |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * @param OccRunner $occRunner |
||
47 | */ |
||
48 | 5 | public function __construct(OccRunner $occRunner){ |
|
51 | |||
52 | /** |
||
53 | * @param $appId |
||
54 | * @return bool |
||
55 | */ |
||
56 | 1 | public function disableApp($appId){ |
|
57 | try{ |
||
58 | 1 | $this->occRunner->run('app:disable', ['app-id' => $appId]); |
|
59 | } catch (\Exception $e){ |
||
60 | return false; |
||
61 | } |
||
62 | 1 | return true; |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * @param $appId |
||
67 | * @return bool |
||
68 | */ |
||
69 | 1 | public function enableApp($appId){ |
|
70 | try{ |
||
71 | 1 | $this->occRunner->run('app:enable', ['app-id' => $appId]); |
|
72 | 1 | array_unshift($this->disabledApps, $appId); |
|
73 | } catch (\Exception $e){ |
||
74 | return false; |
||
75 | } |
||
76 | 1 | return true; |
|
77 | } |
||
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getAllApps(){ |
||
87 | |||
88 | /** |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getNotShippedApps(){ |
||
96 | |||
97 | /** |
||
98 | * @return array |
||
99 | */ |
||
100 | 2 | public function getShippedApps(){ |
|
105 | |||
106 | /** |
||
107 | * @param $appId |
||
108 | * @return string |
||
109 | */ |
||
110 | 1 | public function getAppPath($appId){ |
|
118 | |||
119 | } |
||
120 |