Subversion Repositories php-qbpwcf

Rev

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

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