Subversion Repositories php-qbpwcf

Rev

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

Rev 220 Rev 226
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) 2014~2025 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 115... Line 115...
115
	#無.
115
	#無.
116
	#備註:
116
	#備註:
117
	#無.
117
	#無.
118
	$record=logs::record($conf);
118
	$record=logs::record($conf);
119
	unset($conf);
119
	unset($conf);
120
	
120
 
121
	#如果寫log失敗
121
	#如果寫log失敗
122
	if($record["status"]==="false"){
122
	if($record["status"]==="false"){
123
	
123
 
124
		#印出結果
124
		#印出結果
125
		var_dump($record);
125
		var_dump($record);
126
	
126
 
127
		}#if end
127
		}#if end
128
	
128
 
129
	#結束執行,回傳錯誤代碼1
129
	#結束執行,回傳錯誤代碼1
130
	exit(1);
130
	exit(1);
131
 
131
 
132
	}#if end
132
	}#if end
133
	
133
 
134
#如果有指定參數
134
#如果有指定參數
135
if($getArgu["count"]>1){
135
if($getArgu["count"]>1){
136
 
136
 
137
	#預設第2個參數為 $nameOfSample 的指定數值
137
	#預設第2個參數為 $nameOfSample 的指定數值
138
	$nameOfSample=$getArgu["content"][1];
138
	$nameOfSample=$getArgu["content"][1];
Line 156... Line 156...
156
#針對每個範例資訊
156
#針對每個範例資訊
157
foreach($samples as $sample){
157
foreach($samples as $sample){
158
 
158
 
159
	#如果找到對應的範例
159
	#如果找到對應的範例
160
	if($sample["name"]===$nameOfSample){
160
	if($sample["name"]===$nameOfSample){
161
	
161
 
162
		#如果存放範例的資料夾不存在
162
		#如果存放範例的資料夾不存在
163
		if(!file_exists($sampleFolder)){
163
		if(!file_exists($sampleFolder)){
164
		
164
 
165
			#提示訊息
165
			#提示訊息
166
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
166
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
167
		
167
 
168
			#結束執行,並回傳1給shell
168
			#結束執行,並回傳1給shell
169
			exit(1);
169
			exit(1);
170
		
170
 
171
			}#if end
171
			}#if end
172
			
172
 
173
		#如果對應的範例檔案不存在
173
		#如果對應的範例檔案不存在
174
		if(!file_exists($fileNameOfSample)){
174
		if(!file_exists($fileNameOfSample)){
175
		
175
 
176
			#提示訊息
176
			#提示訊息
177
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
177
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
178
		
178
 
179
			#結束執行,並回傳1給shell
179
			#結束執行,並回傳1給shell
180
			exit(1);
180
			exit(1);
181
		
181
 
182
			}#if end
182
			}#if end
183
		
183
 
184
		#debug
184
		#debug
185
		#var_dump(__LINE__,$fileNameOfSample);
185
		#var_dump(__LINE__,$fileNameOfSample);
186
		
186
 
187
		#匯入範例
187
		#匯入範例
188
		require_once($fileNameOfSample);
188
		require_once($fileNameOfSample);
189
		
189
 
190
		#結束執行
190
		#結束執行
191
		exit;
191
		exit;
192
	
192
 
193
		}#if end
193
		}#if end
194
 
194
 
195
	}#foreach end
195
	}#foreach end
196
	
196
 
197
#執行到這邊代表沒有對應的範例
197
#執行到這邊代表沒有對應的範例
198
 
198
 
199
#提示範例不存在
199
#提示範例不存在
200
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
200
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
201
 
201
 
202
#結束執行,並回傳1給shell
202
#結束執行,並回傳1給shell
203
exit(1);
203
exit(1);
204
 
204
 
205
?>
-
 
206
205
?>
-
 
206