Subversion Repositories php-qbpwcf

Rev

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

Rev 140 Rev 223
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 118... Line 118...
118
	#無.
118
	#無.
119
	#備註:
119
	#備註:
120
	#無.
120
	#無.
121
	$record=logs::record($conf);
121
	$record=logs::record($conf);
122
	unset($conf);
122
	unset($conf);
123
	
123
 
124
	#如果寫log失敗
124
	#如果寫log失敗
125
	if($record["status"]==="false"){
125
	if($record["status"]==="false"){
126
	
126
 
127
		#印出結果
127
		#印出結果
128
		var_dump($record);
128
		var_dump($record);
129
	
129
 
130
		}#if end
130
		}#if end
131
	
131
 
132
	#結束執行,回傳錯誤代碼1
132
	#結束執行,回傳錯誤代碼1
133
	exit(1);
133
	exit(1);
134
 
134
 
135
	}#if end
135
	}#if end
136
	
136
 
137
#如果有指定參數
137
#如果有指定參數
138
if($getArgu["count"]>1){
138
if($getArgu["count"]>1){
139
 
139
 
140
	#預設第2個參數為 $nameOfSample 的指定數值
140
	#預設第2個參數為 $nameOfSample 的指定數值
141
	$nameOfSample=$getArgu["content"][1];
141
	$nameOfSample=$getArgu["content"][1];
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