HEX
Server: LiteSpeed
System: Linux node612.namehero.net 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: dfwparty (1186)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/dfwparty/www/wp-content/mu-plugins/wp-toolkit/vendor/patchstack/engine-php/src/Response.php
<?php

namespace Patchstack;

class Response
{
    /**
     * The options of the engine.
     *
     * @var array
     */
    private $options;

    /**
     * Creates a new request instance.
     *
     * @param  array $options
     * @return void
     */
    public function __construct($options = [])
    {
        $this->options = $options;
    }

    /**
     * Perform a redirect if the request must be redirected to somewhere else.
     *
     * @param  string  $redirectTo
     * @param  boolean $mustExit
     * @return void
     */
    public function redirect($redirectTo = '', $mustExit = true)
    {
        // Don't redirect an invalid URL.
        if (!$redirectTo || filter_var($redirectTo, FILTER_VALIDATE_URL) === false) {
            return false;
        }

        // Perform the redirect.
        header('Location: ' . $redirectTo, true, 302);

        // In some scenarios we might want to control if the script should exit executing.
        if ($mustExit) {
            exit;
        }
    }
}