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