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