Subversion Repositories php-qbpwcf

Rev

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

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