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.148.105.127
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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

namespace Give\TestData;

use Composer\InstalledVersions;
use Faker\Factory as FakerFactory;
use Faker\Generator as FakerGenerator;
use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give\ServiceProviders\ServiceProvider as GiveServiceProvider;
use Give\TestData\Commands\DonationSeedCommand;
use Give\TestData\Commands\DonationStatusCommand;
use Give\TestData\Commands\DonorSeedCommand;
use Give\TestData\Commands\FormSeedCommand;
use Give\TestData\Commands\LogsSeedCommand;
use Give\TestData\Commands\PageSeedCommand;
use WP_CLI;

/**
 * Class ServiceProvider
 * @package Give\TestData
 */
class ServiceProvider implements GiveServiceProvider
{
    /**
     * @inheritDoc
     */
    public function register()
    {
        if ( ! $this->isFakerInstalled()) {
            return;
        }

        // Instead of passing around an instance, bind a singleton to the container.
        give()->singleton(
            FakerGenerator::class,
            function () {
                return FakerFactory::create();
            }
        );
    }

    /**
     * @inheritDoc
     */
    public function boot()
    {
        if ( ! $this->isFakerInstalled()) {
            return;
        }

        // Add CLI commands
        if (defined('WP_CLI') && WP_CLI) {
            $this->addCommands();

            try {
                $this->loadAddonsServiceProviders();
            } catch (InvalidArgumentException $e) {
                exit($e->getMessage());
            }
        }
    }

    /**
     * Load addons service providers for TestData
     */
    private function loadAddonsServiceProviders()
    {
        $providers = [];

        // Load Test Data add-ons Service Providers as they are not handled by Give
        foreach (Addons::getActiveAddons() as $addon) {
            if ( ! is_subclass_of($addon['serviceProvider'], GiveServiceProvider::class)) {
                throw new InvalidArgumentException(
                    "{$addon['serviceProvider']} class must implement the ServiceProvider interface"
                );
            }

            $addonServiceProvider = new $addon['serviceProvider']();
            $addonServiceProvider->register();
            $providers[] = $addonServiceProvider;
        }

        foreach ($providers as $addonServiceProvider) {
            $addonServiceProvider->boot();
        }
    }

    /**
     * Add CLI comands
     */
    private function addCommands()
    {
        WP_CLI::add_command('give test-donors', give()->make(DonorSeedCommand::class));
        WP_CLI::add_command('give test-donations', give()->make(DonationSeedCommand::class));
        WP_CLI::add_command('give test-donation-statuses', give()->make(DonationStatusCommand::class));
        WP_CLI::add_command('give test-demonstration-page', give()->make(PageSeedCommand::class));
        WP_CLI::add_command('give test-donation-form', give()->make(FormSeedCommand::class));
        WP_CLI::add_command('give test-logs', give()->make(LogsSeedCommand::class));
    }

    /**
     * Helper function used to check if Faker library is installed
     *
     * @see https://getcomposer.org/doc/07-runtime.md#installed-versions
     *
     * @since 3.17.2
     *
     * @return bool
     */
    private function isFakerInstalled(): bool
    {
        return InstalledVersions::isInstalled('fakerphp/faker');
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit