Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MEGAMINDMK authored Mar 8, 2021
1 parent 5797be5 commit f24c930
Show file tree
Hide file tree
Showing 7 changed files with 3,248 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Php Electronjs v0.6/extraResources/php/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<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>
</div>

# The PHP files are missing
- Re download the full <a href="https://windows.php.net/download">php from official site</a>
- Use the xampp/php (Recomended)
3 changes: 3 additions & 0 deletions Php Electronjs v0.6/extraResources/php/www/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
phpinfo();
?>
Binary file added Php Electronjs v0.6/icon/icon.ico
Binary file not shown.
26 changes: 26 additions & 0 deletions Php Electronjs v0.6/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<style>
webview{
width: 100%;
height: 100%;
}
body, html {
margin: 0px;
padding: 0px;
}
</style>
<body onload="php();">
<webview src="http://localhost/www" autosize="on" useragent="Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45" plugins></webview>
</body>
<script>
function php(){
const exec = require('child_process').exec;
exec('cd resources/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>
37 changes: 37 additions & 0 deletions Php Electronjs v0.6/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process.env ['ELECTRON_DISABLE_SECURITY_WARNINGS']='true';
const { app, BrowserWindow } = require('electron')
const { join, normalize } = require('path');
let win

function createWindow () {
win = new BrowserWindow({ width: 1000, height: 700, icon: join(__dirname, 'icon/icon.ico'), webPreferences: {webviewTag: true,nodeIntegration: true, contextIsolation: false}})
win.setMenu(null)
win.loadFile('index.html')
win.on('closed', () => {
win = null;
app.quit();
})
}

app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
if (process.platform !== 'windows') {
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 (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
Loading

0 comments on commit f24c930

Please sign in to comment.