-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.php
executable file
·52 lines (41 loc) · 1.19 KB
/
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/php
<?php
/**
* Graphical user interface to create and manage PHP phar files
* developed with wxPHP (http://wxphp.org).
*
* @author Jefferson González
* @license MIT
* @link http://github.com/jgmdev/phar-gui Source code.
*/
$load_parameters = "";
//Try to load required libraries
if(!extension_loaded('wxwidgets'))
{
$load_parameters .= "-d extension=wxwidgets." . PHP_SHLIB_SUFFIX . " ";
}
if(!extension_loaded('phar'))
{
$load_parameters .= "-d extension=phar." . PHP_SHLIB_SUFFIX . " ";
}
if(ini_get("phar.readonly") == 1)
{
$load_parameters .= "-d phar.readonly=0 ";
}
// If not on windows and phar.readonly is set to 1 we reload PHP CLI with
// phar.readonly set to 0 so writing and creating phar files is possible.
if(stripos(PHP_OS, "win") === false && $load_parameters != "")
{
shell_exec($_SERVER["_"] . " $load_parameters " . __FILE__ . " > /dev/null &");
exit;
}
// Directory with lib, images and License
define("PHARGUI_HOME", __DIR__);
// Include files
include(PHARGUI_HOME . "/resources.php");
include(PHARGUI_HOME . "/lib/autoload.php");
wxInitAllImageHandlers();
// Application initialization
$phargui = new PharGUI\Window();
$phargui->Show();
wxEntry();