-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50b9473
commit 08f0000
Showing
9 changed files
with
1,391 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div align="center"> | ||
<a href="https://php.net"> | ||
<img | ||
alt="PHP" | ||
src="https://www.php.net/images/logos/new-php-logo.svg" | ||
width="150"> | ||
</a><br> | ||
<a href="https://electronjs.org"> | ||
<img | ||
alt="electron" | ||
src="https://electronjs.org/images/electron-logo.svg" | ||
width="250"> | ||
</a><br> | ||
<img src="https://cdn.discordapp.com/attachments/458308642920333322/656948283377319977/bandicam_2019-12-19_00-57-05-761.jpg" height="300" width="500"> | ||
</div> | ||
|
||
# PHP-Electronjs | ||
A working php server with electronjs fully customizable & easy to use | ||
|
||
# Steps | ||
- npm i | ||
- npm start | ||
- electron-packager . | ||
|
||
# Download | ||
<a href="https://github.com/MEGAMINDMK/PHP-Electronjs/releases/download/v0.3/php_electron.exe">Clicky ! v0.3</a> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<style> | ||
webview{ | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<body onload="php();"> | ||
<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> | ||
</body> | ||
<script> | ||
function php(){ | ||
//var myBatFilePath = "start.bat"; | ||
//const spawn = require('child_process').spawn; | ||
//const bat = spawn('cmd.exe', ['/c', myBatFilePath]); | ||
const exec = require('child_process').exec; | ||
exec('cd php && call php -S localhost:80', (e, stdout, stderr)=> { | ||
if (e instanceof Error) { | ||
console.error(e); | ||
throw e; | ||
} | ||
console.log('stdout ', stdout); | ||
console.log('stderr ', stderr); | ||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const electron = require("electron"); | ||
const BrowserWindow = electron.BrowserWindow; | ||
const app = electron.app; | ||
const Menu = electron.Menu; | ||
const MenuItem = electron.MenuItem | ||
let win | ||
|
||
function createWindow () { | ||
win = new BrowserWindow({ width: 1000, height: 700, icon: __dirname + '/icon.ico'}) | ||
win.setMenu(null) | ||
win.loadFile('index.html') | ||
win.on('closed', () => { | ||
win = null | ||
}) | ||
} | ||
|
||
app.on('ready', createWindow) | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'windows') { | ||
//var myBatFilePath = "stop.bat"; | ||
//const spawn = require('child_process').spawn; | ||
//const bat = spawn('cmd.exe', ['/c', myBatFilePath]); | ||
const exec = require('child_process').exec; | ||
exec('taskkill /F /IM php.exe', (e, stdout, stderr)=> { | ||
if (e instanceof Error) { | ||
console.error(e); | ||
throw e; | ||
} | ||
console.log('stdout ', stdout); | ||
console.log('stderr ', stderr); | ||
}); | ||
app.quit() | ||
} | ||
}) | ||
|
||
app.on('activate', () => { | ||
if (win === null) { | ||
createWindow() | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.