Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 921 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 921 Rev 953
Line 30... Line 30...
30
範例:
30
範例:
31
 
31
 
32
#每次執行 ps auxwf | cat 後,下一秒就刷新畫面重新執行.
32
#每次執行 ps auxwf | cat 後,下一秒就刷新畫面重新執行.
33
registerService.php --cmds clear --cmds 'ps auxwf | cat'  --cmds 'sleep 1'
33
registerService.php --cmds clear --cmds 'ps auxwf | cat'  --cmds 'sleep 1'
34
 
34
 
-
 
35
備註:
-
 
36
目前不支援在 ostree 環境下運行.
-
 
37
 
35
*/
38
*/
36
 
39
 
37
#指派命名空間
40
#指派命名空間
38
namespace qbpwcf;
41
namespace qbpwcf;
39
 
42
 
-
 
43
#取得 lib path
-
 
44
exec("php -f ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/libexec/folderOfUsrLib.php"),$output,$status);
-
 
45
 
-
 
46
#如果執行失敗
-
 
47
if($status!==0){
-
 
48
 
-
 
49
	#debug
-
 
50
	var_dump(__LINE__,$output);
-
 
51
 
-
 
52
	#結束執行,回傳shell 1.
-
 
53
	exit(1);
-
 
54
 
-
 
55
	}#if end
-
 
56
 
-
 
57
#儲存lib path
-
 
58
$folderOfUsrLib=$output[0];
-
 
59
 
40
#以該檔案的實際位置的 lib path 為 include path 首位
60
#以該檔案的實際位置的 lib path 為 include path 首位
-
 
61
$output=array();
41
exec("cd ".pathinfo(__FILE__)["dirname"]."/../lib/qbpwcf;pwd;",$output,$status);
62
exec("cd ".escapeshellarg(pathinfo(__FILE__)["dirname"]."/../".$folderOfUsrLib."/qbpwcf").";pwd;",$output,$status);
-
 
63
 
-
 
64
#如果執行失敗
-
 
65
if($status!==0){
-
 
66
 
-
 
67
	#debug
-
 
68
	var_dump(__LINE__,$output);
-
 
69
 
-
 
70
	#結束執行,回傳shell 1.
-
 
71
	exit(1);
-
 
72
 
-
 
73
	}#if end
-
 
74
 
-
 
75
#設置 include path 
42
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
76
set_include_path($output[0].PATH_SEPARATOR.get_include_path());
43
 
77
 
44
#匯入外部套件
78
#匯入外部套件
45
include("allInOne.php");
79
include("allInOne.php");
46
 
80