Subversion Repositories php-qbpwcf

Rev

Rev 226 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
/*
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
239 liveuser 6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
3 liveuser 7
 
8
    This file is part of QBPWCF.
9
 
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
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
namespace qbpwcf;
25
 
26
/*
27
類別說明:
28
提供webrtc應用的類別.
29
備註:
30
由於該套件目前並沒有跨平台,因此取消開發.
31
等 javaScript.php 隸屬的相關套件開發完畢後,再來開發.
32
*/
33
class communication{
34
 
35
	/*
36
	#函式說明:
37
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
38
	#回傳結果:
39
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
40
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
41
	#$result["function"],當前執行的函式名稱.
42
	#必填參數:
43
	#$method,物件,為物件實體或類別名稱,會自動置入該參數.
44
	#$arguments,陣列,為呼叫方法時所用的參數.
45
	#參考資料:
46
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
47
	*/
48
	public function __call($method,$arguments){
226 liveuser 49
 
3 liveuser 50
		#取得當前執行的函式
51
		$result["function"]=__FUNCTION__;
226 liveuser 52
 
3 liveuser 53
		#設置執行不正常
54
		$result["status"]="false";
226 liveuser 55
 
3 liveuser 56
		#設置執行錯誤
57
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
226 liveuser 58
 
3 liveuser 59
		#設置所丟入的參數
60
		$result["error"][]=$arguments;
226 liveuser 61
 
3 liveuser 62
		#回傳結果
63
		return $result;
226 liveuser 64
 
3 liveuser 65
		}#function __call end
226 liveuser 66
 
3 liveuser 67
	/*
68
	#函式說明:
69
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
70
	#回傳結果:
71
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
72
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
73
	#$result["function"],當前執行的函式名稱.
74
	#必填參數:
75
	#$method,物件,為物件實體或類別名稱,會自動置入該參數.
76
	#$arguments,陣列,為呼叫方法時所用的參數.
77
	#參考資料:
78
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
79
	*/
80
	public static function __callStatic($method,$arguments){
226 liveuser 81
 
3 liveuser 82
		#取得當前執行的函式
83
		$result["function"]=__FUNCTION__;
226 liveuser 84
 
3 liveuser 85
		#設置執行不正常
86
		$result["status"]="false";
226 liveuser 87
 
3 liveuser 88
		#設置執行錯誤
89
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
226 liveuser 90
 
3 liveuser 91
		#設置所丟入的參數
92
		$result["error"][]=$arguments;
226 liveuser 93
 
3 liveuser 94
		#回傳結果
95
		return $result;
226 liveuser 96
 
3 liveuser 97
		}#function __callStatic end
98
 
99
	/*
100
	#函式說明:
101
	#匯入 webRTC 的 javaScript 涵式庫.
102
	#回傳結果:
103
	#匯入 webRTC 涵式庫的語法.
104
	#必填參數:
105
	#無.
106
	#可省略參數:
107
	#無.
108
	#參考資料:
109
	#http://www.webrtc.org/
110
	#https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
111
	#備註:
112
	#無
113
	*/
114
	public static function includeWebRtcLib(){
115
 
116
		#宣告要回傳的變數內容
117
		$result="<script type = text/javaScript src = \"webRtcLib.js\"></script>";
118
 
119
		#回傳語法
120
		return $result;
121
 
122
		}#function webRtcJsCode end
123
 
124
	}#class communication end
125
 
126
?>