Subversion Repositories php-qbpwcf

Rev

Rev 81 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 81 Rev 226
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2025 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 26... Line 26...
26
namespace qbpwcf;
26
namespace qbpwcf;
27
 
27
 
28
#assets dir
28
#assets dir
29
$assetsDir="assets_of_javaScript::qbpwcfJavaScript_20250104";
29
$assetsDir="assets_of_javaScript::qbpwcfJavaScript_20250104";
30
 
30
 
31
#產生 qbpwcfJavaScript 
31
#產生 qbpwcfJavaScript
32
#函式說明:
32
#函式說明:
33
#建立qbpwcf專屬的js函式庫
33
#建立qbpwcf專屬的js函式庫
34
#回傳結果
34
#回傳結果
35
#$result["funciton"],當前函式的名稱.
35
#$result["funciton"],當前函式的名稱.
36
#$result["status"],執行的狀態,"true"代表正常,"false"代表不正常.
36
#$result["status"],執行的狀態,"true"代表正常,"false"代表不正常.
Line 52... Line 52...
52
if($qbpwcfJavaScript["status"]==="false")
52
if($qbpwcfJavaScript["status"]==="false")
53
{
53
{
54
 
54
 
55
	#show detail info
55
	#show detail info
56
	var_dump($qbpwcfJavaScript);
56
	var_dump($qbpwcfJavaScript);
57
	
57
 
58
	#結束執行,並回傳shell 1.
58
	#結束執行,並回傳shell 1.
59
	exit(1);
59
	exit(1);
60
 
60
 
61
}#if end
61
}#if end
62
 
62
 
Line 75... Line 75...
75
#$conf["script"],字串,要執行的javaScript語法.
75
#$conf["script"],字串,要執行的javaScript語法.
76
$conf["script"]="
76
$conf["script"]="
77
 
77
 
78
	//初始化參數
78
	//初始化參數
79
	var params={};
79
	var params={};
80
	
80
 
81
	//設定websocket位置
81
	//設定websocket位置
82
	params.url='wss://silverblue-guest.qbpwcf.org/wss';
82
	params.url='wss://silverblue-guest.qbpwcf.org/wss';
83
	
83
 
84
	//要傳輸的資料
84
	//要傳輸的資料
85
	params.data={};
85
	params.data={};
86
	
86
 
87
	//用來識別是所需要資料的id
87
	//用來識別是所需要資料的id
88
	params.data.id=crypto.randomUUID();
88
	params.data.id=crypto.randomUUID();
89
	
89
 
90
	//取得對應的回應
90
	//取得對應的回應
91
	var response=await window.qbpwcf.ws.init(params);
91
	var response=await window.qbpwcf.ws.init(params);
92
	
92
 
93
	//debug
93
	//debug
94
	console.log(response);
94
	console.log(response);
95
 
95
 
96
	";
96
	";
97
#可省略參數:
97
#可省略參數:
Line 113... Line 113...
113
#如果執行失敗
113
#如果執行失敗
114
if($toScript["status"]==="false"){
114
if($toScript["status"]==="false"){
115
 
115
 
116
	#show detail info
116
	#show detail info
117
	var_dump($toScript);
117
	var_dump($toScript);
118
	
118
 
119
	#結束執行,並回傳shell 1.
119
	#結束執行,並回傳shell 1.
120
	exit(1);
120
	exit(1);
121
 
121
 
122
	}#if end
122
	}#if end
123
 
123
 
124
#印出js語法
124
#印出js語法
125
echo $toScript["content"];
-
 
126
125
echo $toScript["content"];
-
 
126