Subversion Repositories php-qbpwcf

Rev

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

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