Completed
Push — master ( d88391...473b86 )
by Dimas
221:13 queued 206:00
created

libs/src/electron/runphp.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 17
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 4
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 4
1
// PHP RUNNER /////
2
//
3
// RUN PHP in Windows
4
function run_php(){
5
const { spawn } = require('child_process');
6
//const bat = spawn('cmd.exe', ['php/setenv.bat']);
7
bat    = spawn('cmd.exe', ['/c', 'setenv.bat']);
0 ignored issues
show
Bug introduced by
The variable bat seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.bat.
Loading history...
8
9
bat.stdout.on('data', (data) => {
10
  console.log(data.toString());
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
11
});
12
13
bat.stderr.on('data', (data) => {
14
  console.log(data.toString());
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
15
});
16
17
bat.on('exit', (code) => {
18
  console.log(`Child exited with code ${code}`);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
19
});
20
}
21
//////////////////////////////////////
22
23
// PHP SERVER CREATION /////
24
/*
25
const PHPServer = require('php-server-manager');
26
27
const server = new PHPServer({
28
    port: 3000,
29
    directives: {
30
        display_errors: 1,
31
        expose_php: 1
32
    }
33
});
34
35
*/
36
//////////////////////////
37