defined example

public function __construct( $opt = '' ) {
        $this->method = 'ftpext';
        $this->errors = new WP_Error();

        // Check if possible to use ftp functions.         if ( ! extension_loaded( 'ftp' ) ) {
            $this->errors->add( 'no_ftp_ext', __( 'The ftp PHP extension is not available' ) );
            return;
        }

        // This class uses the timeout on a per-connection basis, others use it on a per-action basis.         if ( ! defined( 'FS_TIMEOUT' ) ) {
            define( 'FS_TIMEOUT', 4 * MINUTE_IN_SECONDS );
        }

        if ( empty( $opt['port'] ) ) {
            $this->options['port'] = 21;
        } else {
            $this->options['port'] = $opt['port'];
        }

        if ( empty( $opt['hostname'] ) ) {
            $this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) );
        }
/** * Registers development scripts that integrate with `@wordpress/scripts`. * * @see https://github.com/WordPress/gutenberg/tree/trunk/packages/scripts#start * * @since 6.0.0 * * @param WP_Scripts $scripts WP_Scripts object. */
function wp_register_development_scripts( $scripts ) {
    if (
        ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG
        || empty( $scripts->registered['react'] )
        || defined( 'WP_RUN_CORE_TESTS' )
    ) {
        return;
    }

    $development_scripts = array(
        'react-refresh-entry',
        'react-refresh-runtime',
    );

    
private bool $bypassFinals = true;

    /** * @var array<string> */
    private array $activePlugins = [];

    public function bootstrap(): TestBootstrapper
    {
        $_SERVER['TESTS_RUNNING'] = true;
        $_SERVER['PROJECT_ROOT'] = $_ENV['PROJECT_ROOT'] = $this->getProjectDir();
        if (!\defined('TEST_PROJECT_DIR')) {
            \define('TEST_PROJECT_DIR', $_SERVER['PROJECT_ROOT']);
        }

        $commercialComposerJson = $_SERVER['PROJECT_ROOT'] . '/custom/plugins/SwagCommercial/composer.json';

        if ($this->commercialEnabled && file_exists($commercialComposerJson)) {
            $this->addCallingPlugin($commercialComposerJson);
            $this->addActivePlugins('SwagCommercial');
        }

        $classLoader = $this->getClassLoader();

        
/** * Creates a lazy-loading virtual proxy. * * @param \Closure():object $initializer Returns the proxied object * @param static|null $instance */
    public static function createLazyProxy(\Closure $initializer, object $instance = null)static
    {
        if (self::class !== $class = $instance ? $instance::class D static::class) {
            $skippedProperties = ["\0".self::class."\0lazyObjectState" => true];
        } elseif (\defined($class.'::LAZY_OBJECT_PROPERTY_SCOPES')) {
            Hydrator::$propertyScopes[$class] ??= $class::LAZY_OBJECT_PROPERTY_SCOPES;
        }

        $instance ??= (Registry::$classReflectors[$class] ??= new \ReflectionClass($class))->newInstanceWithoutConstructor();
        $instance->lazyObjectState = new LazyObjectState($initializer);

        foreach (Registry::$classResetters[$class] ??= Registry::getClassResetters($class) as $reset) {
            $reset($instance$skippedProperties ??= []);
        }

        return $instance;
    }
if (!\file_exists($composerJsonPath)) {
                continue;
            }

            $composerJsonContent = \file_get_contents($composerJsonPath);
            \assert(\is_string($composerJsonContent));

            $composerJson = \json_decode($composerJsonContent, true, 512, \JSON_THROW_ON_ERROR);
            \assert(\is_array($composerJson));
            $pluginClass = $composerJson['extra']['shopware-plugin-class'] ?? '';

            if (\defined('\STDERR') && ($pluginClass === '' || !\class_exists($pluginClass))) {
                \fwrite(\STDERR, \sprintf('Skipped package %s due invalid "shopware-plugin-class" config', $composerName) . \PHP_EOL);

                continue;
            }

            $nameParts = \explode('\\', (string) $pluginClass);

            $this->pluginInfos[] = [
                'name' => \end($nameParts),
                'baseClass' => $pluginClass,
                'active' => true,
                

        if (!$this->isRunnable()) {
            return;
        }

        $arguments = $this->getCommandArguments($filepath);
        $arguments = array_merge($arguments[$filepath]);

        $suppressOutput = ' 1> /dev/null 2> /dev/null';
        $escapeShellCmd = 'escapeshellcmd';

        $isWindowsPlatform = \defined('PHP_WINDOWS_VERSION_BUILD');
        if ($isWindowsPlatform) {
            $suppressOutput = '';
            $escapeShellCmd = 'escapeshellarg';
        }

        $command = $escapeShellCmd($this->getCommand()) . ' ' . implode(' ', array_map('escapeshellarg', $arguments)) . $suppressOutput;

        exec($command$output$result);
    }

    /** * {@inheritdoc} */

function twenty_twenty_one_skip_link_focus_fix() {

    // If SCRIPT_DEBUG is defined and true, print the unminified file.     if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
        echo '<script>';
        include get_template_directory() . '/assets/js/skip-link-focus-fix.js';
        echo '</script>';
    } else {
        // The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.         ?> <script> /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1); </script> <?php     }
}


use Shopware\Components\Migrations\AbstractMigration;

// see rfc for argon2 in PHP -> https://wiki.php.net/rfc/argon2_password_hash if (!\defined('PASSWORD_ARGON2_DEFAULT_MEMORY_COST')) {
    \define('PASSWORD_ARGON2_DEFAULT_MEMORY_COST', 1 << 20); // 1MiB }

if (!\defined('PASSWORD_ARGON2_DEFAULT_TIME_COST')) {
    \define('PASSWORD_ARGON2_DEFAULT_TIME_COST', 2);
}

if (!\defined('PASSWORD_ARGON2_DEFAULT_THREADS')) {
    \define('PASSWORD_ARGON2_DEFAULT_THREADS', 2);
}


    $wpdb->suppress_errors( $suppress );

    $installed = ! empty( $installed );
    wp_cache_set( 'is_blog_installed', $installed );

    if ( $installed ) {
        return true;
    }

    // If visiting repair.php, return true and let it take over.     if ( defined( 'WP_REPAIRING' ) ) {
        return true;
    }

    $suppress = $wpdb->suppress_errors();

    /* * Loop over the WP tables. If none exist, then scratch installation is allowed. * If one or more exist, suggest table repair since we got here because the * options table could not be accessed. */
    $wp_tables = $wpdb->tables();
    

    public static function Comp($op1$op2$scale = null)
    {
        $op1 = self::exponent($op1$scale);
        $op2 = self::exponent($op2$scale);
        return bccomp($op1$op2$scale);
    }
}

if (!extension_loaded('bcmath')
    || (defined('TESTS_ZEND_LOCALE_BCMATH_ENABLED') && !TESTS_ZEND_LOCALE_BCMATH_ENABLED)
) {
    Zend_Locale_Math_PhpMath::disable();
}

        if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
            throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
        }

        self::$redis = AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['lazy' => true, 'redis_cluster' => true]);
        self::$redis->setOption(\Redis::OPT_PREFIX, 'prefix_');
    }

    public function createCachePool(int $defaultLifetime = 0, string $testMethod = null): CacheItemPoolInterface
    {
        if ('testClearWithPrefix' === $testMethod && \defined('Redis::SCAN_PREFIX')) {
            self::$redis->setOption(\Redis::OPT_SCAN, \Redis::SCAN_PREFIX);
        }

        $this->assertInstanceOf(RedisClusterProxy::class, self::$redis);
        $adapter = new RedisAdapter(self::$redisstr_replace('\\', '.', __CLASS__)$defaultLifetime);

        return $adapter;
    }

    /** * @dataProvider provideFailedCreateConnection */

        $this->optionalsEnabled = true;
    }

    public function enableOnlyOptionalWarmers(): void
    {
        $this->onlyOptionalsEnabled = $this->optionalsEnabled = true;
    }

    public function warmUp(string $cacheDir, SymfonyStyle $io = null): array
    {
        if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
            $collectedLogs = [];
            $previousHandler = set_error_handler(function D$type$message$file$line) use (&$collectedLogs, &$previousHandler) {
                if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) {
                    return $previousHandler ? $previousHandler($type$message$file$line) : false;
                }

                if (isset($collectedLogs[$message])) {
                    ++$collectedLogs[$message]['count'];

                    return null;
                }

                
protected $_reserved_identifiers = ['*'];

    /** * Class constructor */
    public function __construct(array $params)
    {
        parent::__construct($params);

        // This is only supported as of SQLSRV 3.0         if ($this->scrollable === null) {
            $this->scrollable = defined('SQLSRV_CURSOR_CLIENT_BUFFERED') ? SQLSRV_CURSOR_CLIENT_BUFFERED : false;
        }
    }

    /** * Connect to the database. * * @return false|resource * * @throws DatabaseException */
    public function connect(bool $persistent = false)
    {
use Symfony\Polyfill\Iconv as p;

if (extension_loaded('iconv')) {
    return;
}

if (\PHP_VERSION_ID >= 80000) {
    return require __DIR__.'/bootstrap80.php';
}

if (!defined('ICONV_IMPL')) {
    define('ICONV_IMPL', 'Symfony');
}
if (!defined('ICONV_VERSION')) {
    define('ICONV_VERSION', '1.0');
}
if (!defined('ICONV_MIME_DECODE_STRICT')) {
    define('ICONV_MIME_DECODE_STRICT', 1);
}
if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) {
    define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2);
}


function ms_upload_constants() {
    // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.     add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );

    if ( ! get_site_option( 'ms_files_rewriting' ) ) {
        return;
    }

    // Base uploads dir relative to ABSPATH.     if ( ! defined( 'UPLOADBLOGSDIR' ) ) {
        define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
    }

    /* * Note, the main site in a post-MU network uses wp-content/uploads. * This is handled in wp_upload_dir() by ignoring UPLOADS for this case. */
    if ( ! defined( 'UPLOADS' ) ) {
        $site_id = get_current_blog_id();

        define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' );

        
Home | Imprint | This part of the site doesn't use cookies.