- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
154 lines
3.4 KiB
PHP
Executable File
154 lines
3.4 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Database functions
|
|
*
|
|
* @link https://raiolanetworks.es
|
|
* @since 1.0.0
|
|
*
|
|
* @package Wp_Database_Tools
|
|
* @subpackage Wp_Database_Tools/includes
|
|
*/
|
|
|
|
/**
|
|
* Contains the functionalities related to database management.
|
|
*
|
|
* This class defines all code necessary to manage the database functionalities.
|
|
*
|
|
* @since 1.0.0
|
|
* @package Wp_Database_Tools
|
|
* @subpackage Wp_Database_Tools/includes
|
|
* @author Raiola Networks <info@raiolanetworks.es>
|
|
*/
|
|
class Wp_Database_Tools_Database_Data_Cronjob extends Wp_Database_Tools_Database_Data {
|
|
|
|
|
|
/**
|
|
* The schedule of cronjob.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $schedule The schedule of cronjob.
|
|
*/
|
|
protected $schedule;
|
|
|
|
/**
|
|
* The general data of database.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $display The general data of database.
|
|
*/
|
|
protected $display;
|
|
|
|
/**
|
|
* The args of cronjob.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $args The args of cronjob.
|
|
*/
|
|
protected $args;
|
|
|
|
/**
|
|
* The interval of cronjob.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $interval The interval of cronjob.
|
|
*/
|
|
protected $interval;
|
|
|
|
/**
|
|
* Next run of cronjob.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $next_run Next run of cronjob.
|
|
*/
|
|
protected $next_run;
|
|
|
|
/**
|
|
* The timestamp of cronjob.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
* @var array $timestamp The timestamp of cronjob.
|
|
*/
|
|
protected $timestamp;
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* Create the instance of a Marketplace.
|
|
*
|
|
* @access public
|
|
* @since 1.0.0
|
|
*
|
|
* @param Array $schedules Schedules.
|
|
* @param int $timestamp Timestamp.
|
|
* @param string $event_hook Event_hook name.
|
|
* @param Array $events Events.
|
|
* @param Object $event Event.
|
|
* @param Array $feedback Feedback info.
|
|
*/
|
|
public function __construct( $schedules, $timestamp, $event_hook, $events, $event, $feedback ) {
|
|
parent::__construct();
|
|
|
|
$args_value = '';
|
|
foreach ( $event['args'] as $key => $arg ) {
|
|
$args_value .= $arg . ' ';
|
|
}
|
|
|
|
// Cronjob data.
|
|
$this->schedule = empty( $event['schedule'] ) ? '-' : $event['schedule'];
|
|
$this->display = $schedules[ $event['schedule'] ]['display'] ?? '';
|
|
$this->args_array = ( ! empty( $args_value ) ) ? $event['args'] : '';
|
|
$this->args = $args_value;
|
|
$this->interval = isset( $event['interval'] ) ? $event['interval'] : 0;
|
|
$this->next_run = ( $timestamp ) ? date( 'Y-m-d H:i:s', $timestamp ) : '-';
|
|
$this->timestamp = ( $timestamp ) ? $timestamp : 0;
|
|
$this->section = 'cronjobs';
|
|
|
|
// Common data.
|
|
$this->id = trim( $event_hook . '↔' . htmlspecialchars( json_encode( $event['args'] ) ) . '↔' . $timestamp );
|
|
$this->name = $event_hook;
|
|
$this->set_feedback( $feedback );
|
|
$this->check_regex();
|
|
}
|
|
|
|
/**
|
|
* Set true the regex attribute
|
|
*
|
|
* @access public
|
|
* @since 1.0.0
|
|
*/
|
|
public function check_regex() {
|
|
// Parent method.
|
|
$this->set_regex( false );
|
|
}
|
|
|
|
/**
|
|
* Set true the multiple attribute
|
|
*
|
|
* @access public
|
|
* @since 1.0.0
|
|
*/
|
|
public function set_multiple() {
|
|
$this->multiple = true;
|
|
}
|
|
|
|
/**
|
|
* Return attributes as an array
|
|
*
|
|
* @access public
|
|
* @since 1.0.0
|
|
*
|
|
* @return Array Array attributes.
|
|
*/
|
|
public function return_object_vars() {
|
|
return get_object_vars( $this );
|
|
}
|
|
|
|
}
|