| 1 |
<?php |
| 2 |
/** |
| 3 |
* Breakpoints Background. |
| 4 |
* |
| 5 |
* @package ghostkit |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! class_exists( 'WP_Background_Process' ) ) { |
| 13 |
require_once ghostkit()->plugin_path . 'composer-libraries/vendor/deliciousbrains/wp-background-processing/wp-background-processing.php'; |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* GhostKit_Breakpoints_Background class |
| 18 |
*/ |
| 19 |
class GhostKit_Breakpoints_Background extends WP_Background_Process { |
| 20 |
/** |
| 21 |
* Prefix |
| 22 |
* |
| 23 |
* @var string |
| 24 |
*/ |
| 25 |
protected $prefix = 'ghostkit'; |
| 26 |
|
| 27 |
/** |
| 28 |
* Name of Cron Action Task. |
| 29 |
* |
| 30 |
* @var string |
| 31 |
*/ |
| 32 |
protected $action = 'run_breakpoints_processing'; |
| 33 |
|
| 34 |
/** |
| 35 |
* Cron Interval. |
| 36 |
* |
| 37 |
* @var integer |
| 38 |
*/ |
| 39 |
protected $cron_interval = 2; |
| 40 |
|
| 41 |
/** |
| 42 |
* Cron Queue Lock Time. |
| 43 |
* |
| 44 |
* @var integer |
| 45 |
*/ |
| 46 |
protected $queue_lock_time = 25; |
| 47 |
|
| 48 |
/** |
| 49 |
* Task |
| 50 |
* |
| 51 |
* Override this method to perform any actions required on each |
| 52 |
* queue item. Return the modified item for further processing |
| 53 |
* in the next pass through. Or, return false to remove the |
| 54 |
* item from the queue. |
| 55 |
* |
| 56 |
* @param mixed $item Queue item to iterate over. |
| 57 |
* |
| 58 |
* @return mixed |
| 59 |
*/ |
| 60 |
protected function task( $item ) { |
| 61 |
new GhostKit_Scss_Compiler( $item ); |
| 62 |
return false; |
| 63 |
} |
| 64 |
} |
| 65 |
|