Subversion Repositories php-qbpwcf

Rev

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

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