Subversion Repositories php-qbpwcf

Rev

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

Rev 99 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) 2015~2024 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 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 155... Line 155...
155
#針對每個範例資訊
155
#針對每個範例資訊
156
foreach($samples as $sample){
156
foreach($samples as $sample){
157
 
157
 
158
	#如果找到對應的範例
158
	#如果找到對應的範例
159
	if($sample["name"]===$nameOfSample){
159
	if($sample["name"]===$nameOfSample){
160
	
160
 
161
		#如果存放範例的資料夾不存在
161
		#如果存放範例的資料夾不存在
162
		if(!file_exists($sampleFolder)){
162
		if(!file_exists($sampleFolder)){
163
		
163
 
164
			#提示訊息
164
			#提示訊息
165
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
165
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
166
		
166
 
167
			#結束執行,並回傳1給shell
167
			#結束執行,並回傳1給shell
168
			exit(1);
168
			exit(1);
169
		
169
 
170
			}#if end
170
			}#if end
171
			
171
 
172
		#如果對應的範例檔案不存在
172
		#如果對應的範例檔案不存在
173
		if(!file_exists($fileNameOfSample)){
173
		if(!file_exists($fileNameOfSample)){
174
		
174
 
175
			#提示訊息
175
			#提示訊息
176
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
176
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
177
		
177
 
178
			#結束執行,並回傳1給shell
178
			#結束執行,並回傳1給shell
179
			exit(1);
179
			exit(1);
180
		
180
 
181
			}#if end
181
			}#if end
182
			
182
 
183
		#匯入範例
183
		#匯入範例
184
		require_once($fileNameOfSample);
184
		require_once($fileNameOfSample);
185
		
185
 
186
		#結束執行
186
		#結束執行
187
		exit;
187
		exit;
188
	
188
 
189
		}#if end
189
		}#if end
190
 
190
 
191
	}#foreach end
191
	}#foreach end
192
	
192
 
193
#執行到這邊代表沒有對應的範例
193
#執行到這邊代表沒有對應的範例
194
 
194
 
195
#提示範例不存在
195
#提示範例不存在
196
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
196
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
197
 
197
 
198
#結束執行,並回傳1給shell
198
#結束執行,並回傳1給shell
199
exit(1);
199
exit(1);
200
 
200
 
201
?>
-
 
202
201
?>
-
 
202