1616 */
1717class Connector extends \AbraFlexi \RW {
1818
19+
20+ /**
21+ * Check only this webhook
22+ * @var string
23+ */
24+ public $ webhook = null ;
25+
26+
27+ /**
28+ * SetUp Object to be ready for work
29+ *
30+ * @param array $options Object Options ( user,password,authSessionId
31+ * company,url,evidence,
32+ * prefix,defaultUrlParams,debug,
33+ * detail,offline,filter,ignore404,nativeTypes
34+ * timeout,companyUrl,ver,throwException
35+ * webhook
36+ */
37+ public function setUp (array $ options = []) {
38+ parent ::setUp ($ options );
39+ $ this ->setupProperty ($ options , 'webhook ' , 'ABRAFLEXI_WEBHOOK ' );
40+ }
41+
1942 /**
2043 * Parse Commandline
2144 *
@@ -31,6 +54,7 @@ public static function parseCmdline() {
3154 $ shortopts .= "f: " ; // Config
3255 $ shortopts .= "d " ; // Debug
3356 $ shortopts .= "h " ; // Help
57+ $ shortopts .= "w " ; // WebHook
3458
3559 $ longopts = array (
3660 "server: " , // Server
@@ -39,6 +63,7 @@ public static function parseCmdline() {
3963 "company: " , // Company
4064 "file: " , // Config file
4165 "debug " , // Debug
66+ "webhook " , // WebHook
4267 "help "
4368 );
4469 $ options = getopt ($ shortopts , $ longopts );
@@ -69,6 +94,13 @@ public static function parseCmdline() {
6994 $ optionsParsed ['password ' ] = $ options ['password ' ];
7095 }
7196
97+ if (array_key_exists ('w ' , $ options )) {
98+ $ optionsParsed ['webhook ' ] = $ options ['w ' ];
99+ }
100+ if (array_key_exists ('webhook ' , $ options )) {
101+ $ optionsParsed ['webhook ' ] = $ options ['webhook ' ];
102+ }
103+
72104 if (array_key_exists ('f ' , $ options )) {
73105 $ optionsParsed ['config ' ] = $ options ['f ' ] ? $ options ['f ' ] : '/etc/abraflexi/client.json ' ;
74106 }
@@ -88,8 +120,8 @@ public static function parseCmdline() {
88120 $ optionsParsed ['debug ' ] = true ;
89121 }
90122
91- if (array_key_exists ('help ' , $ options ) || array_key_exists ('h ' , $ options ) ) {
92- echo ("Usage: " . basename ($ _SERVER ['SCRIPT_NAME ' ]) . " -s https://SERVER[:PORT] -u USERNAME -p PASSWORD -c COMPANY [-d debug] \n" );
123+ if (array_key_exists ('help ' , $ options ) || array_key_exists ('h ' , $ options )) {
124+ echo ("Usage: " . basename ($ _SERVER ['SCRIPT_NAME ' ]) . " -s https://SERVER[:PORT] -u USERNAME -p PASSWORD -c COMPANY [-w WebHookURL] [- d debug] \n" );
93125 exit ;
94126 }
95127
0 commit comments