-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathj27410channelmanagement_jomres2jomres_process_changelog_queue_item.class.php
executable file
·81 lines (70 loc) · 2.66 KB
/
j27410channelmanagement_jomres2jomres_process_changelog_queue_item.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Core file.
*
* @author Vince Wooll <sales@jomres.net>
*
* @version Jomres 9.8.21
*
* @copyright 2005-2020 Vince Wooll
* Jomres (tm) PHP, CSS & Javascript files are released under both MIT and GPL2 licenses. This means that you can choose the license that best suits your project, and use it accordingly
**/
// ################################################################
defined('_JOMRES_INITCHECK') or die('');
// ################################################################
/**
* @package Jomres\Core\Minicomponents
*
* When a webhook is passed to the channel management framework the cmf webhook authmethod then hands the webhook to this script to allow this script to perform any actions required
*
*/
class j27410channelmanagement_jomres2jomres_process_changelog_queue_item
{
/**
*
* Constructor
*
* Main functionality of the Minicomponent
*
*/
public function __construct($componentArgs)
{
// Must be in all minicomponents. Minicomponents with templates that can contain editable text should run $this->template_touch() else just return
$MiniComponents = jomres_singleton_abstract::getInstance('mcHandler');
if ($MiniComponents->template_touch) {
$this->template_touchable = false;
return;
}
$ePointFilepath = get_showtime('ePointFilepath');
$item = unserialize(base64_decode($componentArgs->item));
logging::log_message('Success not returned ', 'JOMRES2JOMRES', 'WARNING', serialize($thing_class_result));
if (isset($item->webhook_event) && $item->webhook_event != '' ) {
$new_class_name = 'jomres2jomres_changelog_item_process_'.strtolower($item->webhook_event);
if (file_exists( $ePointFilepath.$new_class_name.'.php') ) {
require_once ($ePointFilepath.$new_class_name.'.php');
if (class_exists($new_class_name)) {
try {
$thing_class_result = new $new_class_name($componentArgs);
if (isset($thing_class_result->success)) {
$this->retVals = $thing_class_result->success;
} else {
logging::log_message('Success not returned ', 'JOMRES2JOMRES', 'WARNING', serialize($thing_class_result));
}
}
catch (Exception $e) {
logging::log_message('Cannot process webhook because... '.$e->getMessage(), 'JOMRES2JOMRES', 'WARNING');
}
} else {
logging::log_message("Cannot process webhook ".$item->webhook_event." because no item processing task exists for the event.", 'JOMRES2JOMRES', 'INFO' , serialize($send_response) );
}
}
}
if (!isset($this->retVals)) {
$this->retVals = false;
}
}
public function getRetVals()
{
return $this->retVals;
}
}