Subversion Repositories php-qbpwcf

Rev

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