PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5.1
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5.1
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / vendor / woocommerce / action-scheduler / classes / ActionScheduler_FatalErrorMonitor.php
jetformbuilder / vendor / woocommerce / action-scheduler / classes Last commit date
WP_CLI 1 month ago abstracts 1 month ago actions 1 year ago data-stores 1 month ago migration 1 year ago schedules 1 year ago schema 1 month ago ActionScheduler_ActionClaim.php 1 year ago ActionScheduler_ActionFactory.php 1 year ago ActionScheduler_AdminView.php 1 year ago ActionScheduler_AsyncRequest_QueueRunner.php 1 year ago ActionScheduler_Compatibility.php 1 year ago ActionScheduler_DataController.php 1 month ago ActionScheduler_DateTime.php 1 year ago ActionScheduler_Exception.php 2 years ago ActionScheduler_FatalErrorMonitor.php 1 year ago ActionScheduler_InvalidActionException.php 1 year ago ActionScheduler_ListTable.php 1 year ago ActionScheduler_LogEntry.php 1 year ago ActionScheduler_NullLogEntry.php 1 year ago ActionScheduler_OptionLock.php 1 year ago ActionScheduler_QueueCleaner.php 1 year ago ActionScheduler_QueueRunner.php 1 year ago ActionScheduler_RecurringActionScheduler.php 1 month ago ActionScheduler_SystemInformation.php 1 year ago ActionScheduler_Versions.php 1 year ago ActionScheduler_WPCommentCleaner.php 1 year ago ActionScheduler_wcSystemStatus.php 1 month ago
ActionScheduler_FatalErrorMonitor.php
99 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_FatalErrorMonitor
5 */
6 class ActionScheduler_FatalErrorMonitor {
7
8 /**
9 * ActionScheduler_ActionClaim instance.
10 *
11 * @var ActionScheduler_ActionClaim
12 */
13 private $claim = null;
14
15 /**
16 * ActionScheduler_Store instance.
17 *
18 * @var ActionScheduler_Store
19 */
20 private $store = null;
21
22 /**
23 * Current action's ID.
24 *
25 * @var int
26 */
27 private $action_id = 0;
28
29 /**
30 * Construct.
31 *
32 * @param ActionScheduler_Store $store Action store.
33 */
34 public function __construct( ActionScheduler_Store $store ) {
35 $this->store = $store;
36 }
37
38 /**
39 * Start monitoring.
40 *
41 * @param ActionScheduler_ActionClaim $claim Claimed actions.
42 */
43 public function attach( ActionScheduler_ActionClaim $claim ) {
44 $this->claim = $claim;
45 add_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
46 add_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0, 1 );
47 add_action( 'action_scheduler_after_execute', array( $this, 'untrack_action' ), 0, 0 );
48 add_action( 'action_scheduler_execution_ignored', array( $this, 'untrack_action' ), 0, 0 );
49 add_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0, 0 );
50 }
51
52 /**
53 * Stop monitoring.
54 */
55 public function detach() {
56 $this->claim = null;
57 $this->untrack_action();
58 remove_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
59 remove_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0 );
60 remove_action( 'action_scheduler_after_execute', array( $this, 'untrack_action' ), 0 );
61 remove_action( 'action_scheduler_execution_ignored', array( $this, 'untrack_action' ), 0 );
62 remove_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0 );
63 }
64
65 /**
66 * Track specified action.
67 *
68 * @param int $action_id Action ID to track.
69 */
70 public function track_current_action( $action_id ) {
71 $this->action_id = $action_id;
72 }
73
74 /**
75 * Un-track action.
76 */
77 public function untrack_action() {
78 $this->action_id = 0;
79 }
80
81 /**
82 * Handle unexpected shutdown.
83 */
84 public function handle_unexpected_shutdown() {
85 $error = error_get_last();
86
87 if ( $error ) {
88 if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
89 if ( ! empty( $this->action_id ) ) {
90 $this->store->mark_failure( $this->action_id );
91 do_action( 'action_scheduler_unexpected_shutdown', $this->action_id, $error );
92 }
93 }
94
95 $this->store->release_claim( $this->claim );
96 }
97 }
98 }
99