AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/mainwp-child/includes/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/mainwp-child/includes/class-psl-trie.php

<?php
/**
 * Public Suffix List Trie using anonymous node objects (keeps only one class per file)
 *
 * @package MainWP/Child
 */

/**
 * Public Suffix List Trie
 */
class PslTrie {

    /**
     * Root node of the trie.
     *
     * @var object
     */
    private $root;

    /**
     * Initialize the trie root node.
     */
    public function __construct() {
        $this->root = new class() {
            /**
             * Child nodes indexed by label.
             *
             * @var array
             */
            public $children = array();

            /**
             * Whether this node marks the end of a suffix.
             *
             * @var bool
             */
            public $isEnd = false;
        };
    }

    /**
     * Insert a suffix into the trie.
     *
     * @param  mixed $suffix
     * @return void
     */
    public function insert( $suffix ) {
        $parts = array_reverse( explode( '.', $suffix ) );
        $node  = $this->root;
        foreach ( $parts as $part ) {
            if ( ! isset( $node->children[ $part ] ) ) {
                $node->children[ $part ] = new class() {
                    /**
                     * Child nodes indexed by label.
                     *
                     * @var array
                     */
                    public $children = array();

                    /**
                     * Whether this node marks the end of a suffix.
                     *
                     * @var bool
                     */
                    public $isEnd = false;
                };
            }
            $node = $node->children[ $part ];
        }
        $node->isEnd = true;
    }

    /**
     * Find the longest matching suffix for a host.
     *
     * @param string $host Hostname to match against the public suffix list.
     * @return string The longest matching public suffix for the host (fallback to last label).
     */
    public function find_longest_match( $host ) {
        $parts = array_reverse( explode( '.', $host ) );
        $node  = $this->root;
        $match = array();
        foreach ( $parts as $part ) {
            if ( ! isset( $node->children[ $part ] ) ) {
                break;
            }
            $match[] = $part;
            $node    = $node->children[ $part ];
        }
        if ( empty( $match ) ) {
            return $parts[0]; // fallback: last label.
        }
        return implode( '.', array_reverse( $match ) );
    }
}

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question