HEX
Server: Apache/2.4.65 (Debian)
System: Linux wordpress-7cb4c6b6f6-qgbk2 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: www-data (33)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/webp-express/lib/classes/DestinationOptions.php
<?php

namespace WebPExpress;

class DestinationOptions
{

    public $mingled;
    public $useDocRoot;
    public $replaceExt;
    public $scope;

    /**
     * Constructor.
     *
     * @param  array  $imageRootDef   assoc array containing "id", "url" and either "abs-path", "rel-path" or both.
     */
    public function __construct($mingled, $useDocRoot, $replaceExt, $scope)
    {
        $this->mingled = $mingled;
        $this->useDocRoot = $useDocRoot;
        $this->replaceExt = $replaceExt;
        $this->scope = $scope;
    }

    /**
     * Set properties from config file
     *
     * @param  array  $config   WebP Express configuration object
     */
    public static function createFromConfig(&$config)
    {
        return new DestinationOptions(
            $config['destination-folder'] == 'mingled',       // "mingled" or "separate"
            $config['destination-structure'] == 'doc-root',   // "doc-root" or "image-roots"
            $config['destination-extension'] == 'set',        // "set" or "append"
            $config['scope']
        );
    }


}