Subversion Repositories php-qbpwcf

Rev

Rev 3 | Go to most recent revision | 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.
226 liveuser 6
    Copyright (C) 2014~2025 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
類別 app 開始.
29
備註:
30
無.
31
*/
32
class app{
33
 
34
	/*
35
	#函式說明:
36
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
37
	#回傳結果:
38
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
39
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
40
	#$result["function"],當前執行的函式名稱.
41
	#必填參數:
42
	#$method,物件,為物件實體或類別名稱,會自動置入該參數.
43
	#$arguments,陣列,為呼叫方法時所用的參數.
44
	#參考資料:
45
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
46
	*/
47
	public function __call($method,$arguments){
48
 
49
		#取得當前執行的函式
50
		$result["function"]=__FUNCTION__;
51
 
52
		#設置執行不正常
53
		$result["status"]="false";
54
 
55
		#設置執行錯誤
56
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
57
 
58
		#設置所丟入的參數
59
		$result["error"][]=$arguments;
60
 
61
		#回傳結果
62
		return $result;
63
 
64
		}#function __call end
65
 
66
	/*
67
	#函式說明:
68
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
69
	#回傳結果:
70
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
71
	#$reuslt["error"],執行不正常結束的錯訊息陣列.
72
	#$result["function"],當前執行的函式名稱.
73
	#必填參數:
74
	#$method,物件,為物件實體或類別名稱,會自動置入該參數.
75
	#$arguments,陣列,為呼叫方法時所用的參數.
76
	#參考資料:
77
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
78
	*/
79
	public static function __callStatic($method,$arguments){
80
 
81
		#取得當前執行的函式
82
		$result["function"]=__FUNCTION__;
83
 
84
		#設置執行不正常
85
		$result["status"]="false";
86
 
87
		#設置執行錯誤
88
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
89
 
90
		#設置所丟入的參數
91
		$result["error"][]=$arguments;
92
 
93
		#回傳結果
94
		return $result;
95
 
96
		}#function __callStatic end
97
 
98
	/*
99
	#函式說明:
100
	#使用網頁預設的app化設置.包含不使用cache.
101
	#回傳的結果:
102
	#回傳結果:
103
	#$result,app化的語法.
104
	#必填參數:
105
	#無.
106
	#可省略參數:
107
	#無.
108
	#參考資料:
109
	#無.
110
	#備註:
111
	#無.
112
	*/
113
	public static function defaultMode(){
114
 
115
		#初始化要回傳的內容
116
		$result="";
117
 
118
		#讓行動裝置用起來更順暢
119
		#參考資料來源:
120
		#http://cfyeric.blogspot.tw/2010/10/blog-post.html
121
		$result=$result."<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0, user-scalable=yes\"/>";
122
 
123
		#變成像是在瀏覽APP
124
		#參考資料來源:
125
		#http://cfyeric.blogspot.tw/2010/10/blog-post.html
126
		$result=$result."<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />";
127
 
128
		#變成不使用網頁的快取功能
129
		#參考資料來源:
130
		#https://tw.coderbridge.com/questions/9d7974b61bb34ac88855ce21e89380e7
131
		$result=$result."<meta http-equiv=\"Cache-Control\" content=\"no-store\" />";
132
 
133
		#回傳結果
134
		return $result;
135
 
136
		}#function defaultMode end
137
 
138
	}#class app end
139
 
140
?>