Skip to content

Commit d96f03e

Browse files
committed
php代码运行助手
0 parents  commit d96f03e

File tree

7 files changed

+181
-0
lines changed

7 files changed

+181
-0
lines changed

.build/default.Manifest.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly
3+
xmlns="urn:schemas-microsoft-com:asm.v1"
4+
manifestVersion="1.0">
5+
<assemblyIdentity
6+
processorArchitecture="x86"
7+
version="5.1.0.0"
8+
type="win32"
9+
name="php.porttable.debug.exe"/>
10+
<description>php.porttable.debug</description>
11+
<dependency>
12+
<dependentAssembly>
13+
<assemblyIdentity
14+
type="win32"
15+
name="Microsoft.Windows.Common-Controls"
16+
version="6.0.0.0"
17+
publicKeyToken="6595b64144ccf1df"
18+
language="*"
19+
processorArchitecture="x86"/>
20+
</dependentAssembly>
21+
</dependency>
22+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
23+
<application>
24+
<!--Windows Vista -->
25+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
26+
<!--Windows 7 -->
27+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
28+
<!--Windows 8 -->
29+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
30+
<!-- Windows 8.1 -->
31+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
32+
<!-- Windows 10 -->
33+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
34+
</application>
35+
</compatibility>
36+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
37+
<security>
38+
<requestedPrivileges>
39+
<!--
40+
可任选以下配置之一指定一个进程权限:
41+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
42+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
43+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
44+
45+
requireAdministrator 为管理员权限,
46+
highestAvailable 为可以获取到的最高权限,
47+
asInvoker 为默认值,即调用进程当前权限,一般不需要显式指定,指定后会禁用虚拟化。
48+
49+
虚拟化指Vista以后系统禁止写 Program File目录,启用虚拟化则重定向到%localappdata%\VirtualStore目录,
50+
而注册表 HKEY_LOCAL_MACHINE\Software 则重定向到HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software
51+
-->
52+
</requestedPrivileges>
53+
</security>
54+
</trustInfo>
55+
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
56+
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
57+
<dpiAware>True/PM</dpiAware>
58+
</asmv3:windowsSettings>
59+
</asmv3:application>
60+
</assembly>

.build/default.init.aardio

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//发布前触发
2+
import ide;

.build/default.main.aardio

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//此触发器在生成EXE以后执行
2+
import ide;
3+
import fsys;
4+
5+
//获取生成的EXE文件路径
6+
var publishFile = ide.getPublishPath();

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

default.aproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project ver="34" name="php.porttable.debug" libEmbed="true" icon="..." ui="win" output="php.porttable.debug.exe" CompanyName="单位名称" FileDescription="php.porttable.debug" LegalCopyright="Copyright (C) 作者 2022" ProductName="php.porttable.debug" InternalName="php.porttable.debug" FileVersion="0.0.0.1" ProductVersion="0.0.0.1" publishDir="/dist/" dstrip="false">
3+
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
4+
<folder name="资源文件" path="res" embed="true"/>
5+
<folder name="窗体文件" path="dlg" comment="目录" embed="true"/>
6+
</project>

lib/config.aardio

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//config 配置文件
2+
import fsys.config;
3+
config = fsys.config("/config/");
4+
//config = fsys.config( io.appData("/软件作者/应用程序名/") );
5+
6+
//不需要序列化的配置名字前请添加下划线
7+
namespace config {
8+
__appName = "应用程序名";
9+
__appVersion = "1.0.0.01";
10+
__appDescription = "这是一个测试程序";
11+
__website = "http://www.aardio.com/";
12+
}
13+
14+
/**intellisense(config)
15+
__appName = 应用程序名
16+
__appVersion = 应用程序内部版本号
17+
__appDescription = 程序说明
18+
__website = 官方网站
19+
? = 配置文件名,\n读写配置并序列化为一个表对象,\n表的成员值可以是支持序列化的普通变量,支持table对象\n配置文件在首次使用时自动加载,退出程序时自动保存\n!fsys_table.
20+
end intellisense**/

main.aardio

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// @Author : popy32
2+
// @Contact : 74o5o27o8#qq.com
3+
// @File : phpruncode.aardio
4+
// @Comment : PHP代码调试助手 (≡^∇^≡)
5+
6+
import win.ui;
7+
/*DSG{{*/
8+
var winform = win.form(text='PHP代码调试助手 (\u2261^\u2207^\u2261)';right=759;bottom=469)
9+
winform.add(
10+
button={cls="button";text="运行代码";left=632;top=0;right=760;bottom=40;z=2};
11+
button2={cls="button";text="清空日志";left=632;top=40;right=760;bottom=80;z=4};
12+
edit={cls="edit";left=0;top=0;right=632;bottom=304;autohscroll=false;edge=1;font=LOGFONT(h=-16;name='Consolas');multiline=1;vscroll=1;z=1};
13+
edit2={cls="edit";left=0;top=304;right=760;bottom=472;edge=1;font=LOGFONT(h=-13);multiline=1;z=3}
14+
)
15+
/*}}*/
16+
17+
import php;
18+
import console;
19+
20+
winform.Logd = function(...){
21+
import debug;
22+
import console;
23+
import win.ui;
24+
import time;
25+
var args = {...};
26+
var tm = time.now();
27+
tm.format = "[%Y/%m/%d %H:%M:%S] ";
28+
//
29+
//var debugInfo = debug.queryinfo(2, "select source,function,upvars,name,currentline,activelines") ;
30+
//winform.edit2.log(tostring(tm), "line: ", debugInfo[['currentline']], " ", ..string.join(args,' '),'\r\n');
31+
32+
winform.edit2.log(tostring(tm), ..string.join(args,' '),'\r\n');
33+
34+
// 滚动条随光标滚动
35+
winform.edit2.scrollCaret();
36+
}
37+
38+
winform.button.oncommand = function(id,event){
39+
var code = winform.edit.text;
40+
if(code and #code > 0) {
41+
winform.code = code;
42+
thread.invoke(
43+
function(winform){
44+
import php;
45+
import console;
46+
import debug;
47+
import win.ui;
48+
import time;
49+
50+
var code = winform.code;
51+
//winform.edit2.text = code;
52+
var ret;
53+
php.begin();
54+
php.print = function( msg ) {
55+
//winform.edit2.print("echo:", msg);
56+
//winform.edit2.print(msg);
57+
winform.Logd(msg)
58+
}
59+
60+
php.exec(code);
61+
php.end();
62+
//winform.edit2.print("");
63+
}, winform
64+
)
65+
}
66+
}
67+
68+
winform.button2.oncommand = function(id,event){
69+
// 清空日志
70+
winform.edit2.text = "";
71+
}
72+
73+
winform.edit.text = /***
74+
class test{
75+
private $flag = "flag{this-is-flag}";
76+
public $a = "snail";
77+
static $b = "beta";
78+
}
79+
80+
$test = new test; //建立一个test的对象;
81+
$data = serialize($test); //将对象进行序列化;
82+
echo $data;
83+
***/
84+
85+
winform.show();
86+
win.loopMessage();

0 commit comments

Comments
 (0)