Subversion Repositories php-qbpwcf

Rev

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

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