Skip to content

Commit

Permalink
php代码运行助手
Browse files Browse the repository at this point in the history
  • Loading branch information
popy32 committed Apr 18, 2022
0 parents commit d96f03e
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .build/default.Manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="php.porttable.debug.exe"/>
<description>php.porttable.debug</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<!--
可任选以下配置之一指定一个进程权限:
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
requireAdministrator 为管理员权限,
highestAvailable 为可以获取到的最高权限,
asInvoker 为默认值,即调用进程当前权限,一般不需要显式指定,指定后会禁用虚拟化。
虚拟化指Vista以后系统禁止写 Program File目录,启用虚拟化则重定向到%localappdata%\VirtualStore目录,
而注册表 HKEY_LOCAL_MACHINE\Software 则重定向到HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software
-->
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
2 changes: 2 additions & 0 deletions .build/default.init.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//发布前触发
import ide;
6 changes: 6 additions & 0 deletions .build/default.main.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//此触发器在生成EXE以后执行
import ide;
import fsys;

//获取生成的EXE文件路径
var publishFile = ide.getPublishPath();
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
6 changes: 6 additions & 0 deletions default.aproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true"/>
<folder name="窗体文件" path="dlg" comment="目录" embed="true"/>
</project>
20 changes: 20 additions & 0 deletions lib/config.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//config 配置文件
import fsys.config;
config = fsys.config("/config/");
//config = fsys.config( io.appData("/软件作者/应用程序名/") );

//不需要序列化的配置名字前请添加下划线
namespace config {
__appName = "应用程序名";
__appVersion = "1.0.0.01";
__appDescription = "这是一个测试程序";
__website = "http://www.aardio.com/";
}

/**intellisense(config)
__appName = 应用程序名
__appVersion = 应用程序内部版本号
__appDescription = 程序说明
__website = 官方网站
? = 配置文件名,\n读写配置并序列化为一个表对象,\n表的成员值可以是支持序列化的普通变量,支持table对象\n配置文件在首次使用时自动加载,退出程序时自动保存\n!fsys_table.
end intellisense**/
86 changes: 86 additions & 0 deletions main.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// @Author : popy32
// @Contact : 74o5o27o8#qq.com
// @File : phpruncode.aardio
// @Comment : PHP代码调试助手 (≡^∇^≡)

import win.ui;
/*DSG{{*/
var winform = win.form(text='PHP代码调试助手 (\u2261^\u2207^\u2261)';right=759;bottom=469)
winform.add(
button={cls="button";text="运行代码";left=632;top=0;right=760;bottom=40;z=2};
button2={cls="button";text="清空日志";left=632;top=40;right=760;bottom=80;z=4};
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};
edit2={cls="edit";left=0;top=304;right=760;bottom=472;edge=1;font=LOGFONT(h=-13);multiline=1;z=3}
)
/*}}*/

import php;
import console;

winform.Logd = function(...){
import debug;
import console;
import win.ui;
import time;
var args = {...};
var tm = time.now();
tm.format = "[%Y/%m/%d %H:%M:%S] ";
//
//var debugInfo = debug.queryinfo(2, "select source,function,upvars,name,currentline,activelines") ;
//winform.edit2.log(tostring(tm), "line: ", debugInfo[['currentline']], " ", ..string.join(args,' '),'\r\n');

winform.edit2.log(tostring(tm), ..string.join(args,' '),'\r\n');

// 滚动条随光标滚动
winform.edit2.scrollCaret();
}

winform.button.oncommand = function(id,event){
var code = winform.edit.text;
if(code and #code > 0) {
winform.code = code;
thread.invoke(
function(winform){
import php;
import console;
import debug;
import win.ui;
import time;

var code = winform.code;
//winform.edit2.text = code;
var ret;
php.begin();
php.print = function( msg ) {
//winform.edit2.print("echo:", msg);
//winform.edit2.print(msg);
winform.Logd(msg)
}

php.exec(code);
php.end();
//winform.edit2.print("");
}, winform
)
}
}

winform.button2.oncommand = function(id,event){
// 清空日志
winform.edit2.text = "";
}

winform.edit.text = /***
class test{
private $flag = "flag{this-is-flag}";
public $a = "snail";
static $b = "beta";
}

$test = new test; //建立一个test的对象;
$data = serialize($test); //将对象进行序列化;
echo $data;
***/

winform.show();
win.loopMessage();

0 comments on commit d96f03e

Please sign in to comment.