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 114... Line 114...
114
	#無.
114
	#無.
115
	#備註:
115
	#備註:
116
	#無.
116
	#無.
117
	$record=logs::record($conf);
117
	$record=logs::record($conf);
118
	unset($conf);
118
	unset($conf);
119
	
119
 
120
	#如果寫log失敗
120
	#如果寫log失敗
121
	if($record["status"]==="false"){
121
	if($record["status"]==="false"){
122
	
122
 
123
		#印出結果
123
		#印出結果
124
		var_dump($record);
124
		var_dump($record);
125
	
125
 
126
		}#if end
126
		}#if end
127
	
127
 
128
	#結束執行,回傳錯誤代碼1
128
	#結束執行,回傳錯誤代碼1
129
	exit(1);
129
	exit(1);
130
 
130
 
131
	}#if end
131
	}#if end
132
	
132
 
133
#如果有指定參數
133
#如果有指定參數
134
if($getArgu["count"]>0){
134
if($getArgu["count"]>0){
135
 
135
 
136
	#預設第2個參數為 $nameOfSample 的指定數值
136
	#預設第2個參數為 $nameOfSample 的指定數值
137
	$nameOfSample=$getArgu["content"][0];
137
	$nameOfSample=$getArgu["content"][0];
Line 148... Line 148...
148
$samples=array();
148
$samples=array();
149
 
149
 
150
#增加 config::client 的範例資訊
150
#增加 config::client 的範例資訊
151
$samples[]=array("name"=>"20240410","comment"=>"ws test");
151
$samples[]=array("name"=>"20240410","comment"=>"ws test");
152
$samples[]=array("name"=>"20240410-1","commnent"=>"wss test");
152
$samples[]=array("name"=>"20240410-1","commnent"=>"wss test");
153
	
153
 
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