Subversion Repositories php-qbpwcf

Rev

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

Rev 96 Rev 222
Line 2... Line 2...
2
<?php
2
<?php
3
 
3
 
4
/*
4
/*
5
 
5
 
6
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
7
    Copyright (C) 2015~2024 Min-Jhin,Chen
7
    Copyright (C) 2014~2025 MIN ZHI, CHEN
8
 
8
 
9
    This file is part of QBPWCF.
9
    This file is part of QBPWCF.
10
 
10
 
11
    QBPWCF is free software: you can redistribute it and/or modify
11
    QBPWCF is free software: you can redistribute it and/or modify
12
    it under the terms of the GNU General Public License as published by
12
    it under the terms of the GNU General Public License as published by
Line 113... Line 113...
113
	#無.
113
	#無.
114
	#備註:
114
	#備註:
115
	#無.
115
	#無.
116
	$record=logs::record($conf);
116
	$record=logs::record($conf);
117
	unset($conf);
117
	unset($conf);
118
	
118
 
119
	#如果寫log失敗
119
	#如果寫log失敗
120
	if($record["status"]==="false"){
120
	if($record["status"]==="false"){
121
	
121
 
122
		#印出結果
122
		#印出結果
123
		var_dump($record);
123
		var_dump($record);
124
	
124
 
125
		}#if end
125
		}#if end
126
	
126
 
127
	#結束執行,回傳錯誤代碼1
127
	#結束執行,回傳錯誤代碼1
128
	exit(1);
128
	exit(1);
129
 
129
 
130
	}#if end
130
	}#if end
131
	
131
 
132
#如果有指定參數
132
#如果有指定參數
133
if($getArgu["count"]>0){
133
if($getArgu["count"]>0){
134
 
134
 
135
	#預設第2個參數為 $nameOfSample 的指定數值
135
	#預設第2個參數為 $nameOfSample 的指定數值
136
	$nameOfSample=$getArgu["content"][0];
136
	$nameOfSample=$getArgu["content"][0];
Line 152... Line 152...
152
#針對每個範例資訊
152
#針對每個範例資訊
153
foreach($samples as $sample){
153
foreach($samples as $sample){
154
 
154
 
155
	#如果找到對應的範例
155
	#如果找到對應的範例
156
	if($sample["name"]===$nameOfSample){
156
	if($sample["name"]===$nameOfSample){
157
	
157
 
158
		#如果存放範例的資料夾不存在
158
		#如果存放範例的資料夾不存在
159
		if(!file_exists($sampleFolder)){
159
		if(!file_exists($sampleFolder)){
160
		
160
 
161
			#提示訊息
161
			#提示訊息
162
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
162
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
163
		
163
 
164
			#結束執行,並回傳1給shell
164
			#結束執行,並回傳1給shell
165
			exit(1);
165
			exit(1);
166
		
166
 
167
			}#if end
167
			}#if end
168
			
168
 
169
		#如果對應的範例檔案不存在
169
		#如果對應的範例檔案不存在
170
		if(!file_exists($fileNameOfSample)){
170
		if(!file_exists($fileNameOfSample)){
171
		
171
 
172
			#提示訊息
172
			#提示訊息
173
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
173
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
174
		
174
 
175
			#結束執行,並回傳1給shell
175
			#結束執行,並回傳1給shell
176
			exit(1);
176
			exit(1);
177
		
177
 
178
			}#if end
178
			}#if end
179
			
179
 
180
		#匯入範例
180
		#匯入範例
181
		require_once($fileNameOfSample);
181
		require_once($fileNameOfSample);
182
		
182
 
183
		#結束執行
183
		#結束執行
184
		exit;
184
		exit;
185
	
185
 
186
		}#if end
186
		}#if end
187
 
187
 
188
	}#foreach end
188
	}#foreach end
189
	
189
 
190
#執行到這邊代表沒有對應的範例
190
#執行到這邊代表沒有對應的範例
191
 
191
 
192
#提示範例不存在
192
#提示範例不存在
193
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
193
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
194
 
194
 
195
#結束執行,並回傳1給shell
195
#結束執行,並回傳1給shell
196
exit(1);
196
exit(1);
197
 
197
 
198
?>
-
 
199
198
?>
-
 
199