Subversion Repositories php-qbpwcf

Rev

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

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