Subversion Repositories php-qbpwcf

Rev

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

Rev 81 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) 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 115... Line 115...
115
	#無.
115
	#無.
116
	#備註:
116
	#備註:
117
	#無.
117
	#無.
118
	$record=logs::record($conf);
118
	$record=logs::record($conf);
119
	unset($conf);
119
	unset($conf);
120
	
120
 
121
	#如果寫log失敗
121
	#如果寫log失敗
122
	if($record["status"]==="false"){
122
	if($record["status"]==="false"){
123
	
123
 
124
		#印出結果
124
		#印出結果
125
		var_dump($record);
125
		var_dump($record);
126
	
126
 
127
		}#if end
127
		}#if end
128
	
128
 
129
	#結束執行,回傳錯誤代碼1
129
	#結束執行,回傳錯誤代碼1
130
	exit(1);
130
	exit(1);
131
 
131
 
132
	}#if end
132
	}#if end
133
	
133
 
134
#如果有指定參數
134
#如果有指定參數
135
if($getArgu["count"]>1){
135
if($getArgu["count"]>1){
136
 
136
 
137
	#預設第2個參數為 $nameOfSample 的指定數值
137
	#預設第2個參數為 $nameOfSample 的指定數值
138
	$nameOfSample=$getArgu["content"][1];
138
	$nameOfSample=$getArgu["content"][1];
Line 154... Line 154...
154
#針對每個範例資訊
154
#針對每個範例資訊
155
foreach($samples as $sample){
155
foreach($samples as $sample){
156
 
156
 
157
	#如果找到對應的範例
157
	#如果找到對應的範例
158
	if($sample["name"]===$nameOfSample){
158
	if($sample["name"]===$nameOfSample){
159
	
159
 
160
		#如果存放範例的資料夾不存在
160
		#如果存放範例的資料夾不存在
161
		if(!file_exists($sampleFolder)){
161
		if(!file_exists($sampleFolder)){
162
		
162
 
163
			#提示訊息
163
			#提示訊息
164
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
164
			echo "存放範例的資料夾(".$sampleFolder.")不存在".PHP_EOL;
165
		
165
 
166
			#結束執行,並回傳1給shell
166
			#結束執行,並回傳1給shell
167
			exit(1);
167
			exit(1);
168
		
168
 
169
			}#if end
169
			}#if end
170
			
170
 
171
		#如果對應的範例檔案不存在
171
		#如果對應的範例檔案不存在
172
		if(!file_exists($fileNameOfSample)){
172
		if(!file_exists($fileNameOfSample)){
173
		
173
 
174
			#提示訊息
174
			#提示訊息
175
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
175
			echo "範例檔案(".$fileNameOfSample.")不存在".PHP_EOL;
176
		
176
 
177
			#結束執行,並回傳1給shell
177
			#結束執行,並回傳1給shell
178
			exit(1);
178
			exit(1);
179
		
179
 
180
			}#if end
180
			}#if end
181
			
181
 
182
		#匯入範例
182
		#匯入範例
183
		require_once($fileNameOfSample);
183
		require_once($fileNameOfSample);
184
		
184
 
185
		#結束執行
185
		#結束執行
186
		exit;
186
		exit;
187
	
187
 
188
		}#if end
188
		}#if end
189
 
189
 
190
	}#foreach end
190
	}#foreach end
191
	
191
 
192
#執行到這邊代表沒有對應的範例
192
#執行到這邊代表沒有對應的範例
193
 
193
 
194
#提示範例不存在
194
#提示範例不存在
195
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
195
echo "範例(".$nameOfSample.")不存在".PHP_EOL;
196
 
196
 
197
#結束執行,並回傳1給shell
197
#結束執行,並回傳1給shell
198
exit(1);
-
 
199
198
exit(1);
-
 
199