Skip to content

Commit 08f0000

Browse files
authored
Add files via upload
1 parent 50b9473 commit 08f0000

File tree

9 files changed

+1391
-0
lines changed

9 files changed

+1391
-0
lines changed

Php Electronjs v0.3/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<div align="center">
2+
<a href="https://php.net">
3+
<img
4+
alt="PHP"
5+
src="https://www.php.net/images/logos/new-php-logo.svg"
6+
width="150">
7+
</a><br>
8+
<a href="https://electronjs.org">
9+
<img
10+
alt="electron"
11+
src="https://electronjs.org/images/electron-logo.svg"
12+
width="250">
13+
</a><br>
14+
<img src="https://cdn.discordapp.com/attachments/458308642920333322/656948283377319977/bandicam_2019-12-19_00-57-05-761.jpg" height="300" width="500">
15+
</div>
16+
17+
# PHP-Electronjs
18+
A working php server with electronjs fully customizable &amp; easy to use
19+
20+
# Steps
21+
- npm i
22+
- npm start
23+
- electron-packager .
24+
25+
# Download
26+
<a href="https://github.com/MEGAMINDMK/PHP-Electronjs/releases/download/v0.3/php_electron.exe">Clicky ! v0.3</a>

Php Electronjs v0.3/icon.ico

31 KB
Binary file not shown.

Php Electronjs v0.3/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<style>
2+
webview{
3+
width: 100%;
4+
height: 100%;
5+
}
6+
</style>
7+
<body onload="php();">
8+
<webview src="http://localhost/www" autosize="on" webpreferences="nodeIntegration=no,nativeWindowOpen=true" useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36" plugins></webview>
9+
</body>
10+
<script>
11+
function php(){
12+
//var myBatFilePath = "start.bat";
13+
//const spawn = require('child_process').spawn;
14+
//const bat = spawn('cmd.exe', ['/c', myBatFilePath]);
15+
const exec = require('child_process').exec;
16+
exec('cd php && call php -S localhost:80', (e, stdout, stderr)=> {
17+
if (e instanceof Error) {
18+
console.error(e);
19+
throw e;
20+
}
21+
console.log('stdout ', stdout);
22+
console.log('stderr ', stderr);
23+
});
24+
}
25+
</script>

Php Electronjs v0.3/main.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const electron = require("electron");
2+
const BrowserWindow = electron.BrowserWindow;
3+
const app = electron.app;
4+
const Menu = electron.Menu;
5+
const MenuItem = electron.MenuItem
6+
let win
7+
8+
function createWindow () {
9+
win = new BrowserWindow({ width: 1000, height: 700, icon: __dirname + '/icon.ico'})
10+
win.setMenu(null)
11+
win.loadFile('index.html')
12+
win.on('closed', () => {
13+
win = null
14+
})
15+
}
16+
17+
app.on('ready', createWindow)
18+
19+
app.on('window-all-closed', () => {
20+
if (process.platform !== 'windows') {
21+
//var myBatFilePath = "stop.bat";
22+
//const spawn = require('child_process').spawn;
23+
//const bat = spawn('cmd.exe', ['/c', myBatFilePath]);
24+
const exec = require('child_process').exec;
25+
exec('taskkill /F /IM php.exe', (e, stdout, stderr)=> {
26+
if (e instanceof Error) {
27+
console.error(e);
28+
throw e;
29+
}
30+
console.log('stdout ', stdout);
31+
console.log('stderr ', stderr);
32+
});
33+
app.quit()
34+
}
35+
})
36+
37+
app.on('activate', () => {
38+
if (win === null) {
39+
createWindow()
40+
}
41+
})

Php Electronjs v0.3/node_modules/README.MD

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)