Conditions | 5 |
Total Lines | 23 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import Xdebug from '../extensions/php/xdebug' |
||
9 | execute = async (status: string): Promise<boolean> => { |
||
10 | if (status !== 'on' && status !== 'off') { |
||
11 | console.log(`Invalid status. Please provide status 'on' or 'off'.`) |
||
12 | return false |
||
13 | } |
||
14 | |||
15 | const xdebug = new Xdebug() |
||
16 | let restart = false |
||
17 | |||
18 | if (status === 'on') { |
||
19 | restart = await this.enable(xdebug) |
||
20 | } |
||
21 | |||
22 | if (status === 'off') { |
||
23 | restart = await this.disable(xdebug) |
||
24 | } |
||
25 | |||
26 | if (restart) { |
||
27 | const php = await getLinkedPhpVersion() |
||
28 | await php.restart() |
||
29 | } |
||
30 | |||
31 | return true |
||
32 | } |
||
66 | export default XdebugController |