PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/v1world.us/wp-content/plugins/comet-cache/src/includes/traits/Plugin/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //home/trave494/v1world.us/wp-content/plugins/comet-cache/src/includes/traits/Plugin/UrlUtils.php

<?php
namespace WebSharks\CometCache\Traits\Plugin;

use WebSharks\CometCache\Classes;

trait UrlUtils
{
    /**
     * URL to a Comet Cache plugin file.
     *
     * @since 150422 Rewrite.
     *
     * @param string $file   Optional file path; relative to plugin directory.
     * @param string $scheme Optional URL scheme; defaults to the current scheme.
     *
     * @return string URL to plugin directory; or to the specified `$file` if applicable.
     */
    public function url($file = '', $scheme = '')
    {
        $url = rtrim(plugin_dir_url(PLUGIN_FILE), '/');
        $url .= (string) $file;

        if ($scheme) {
            $url = set_url_scheme($url, (string) $scheme);
        }
        return $url;
    }

    /**
     * Retrieves the home URL for a given site preserving the home URL scheme.
     *
     * @since 160416 Improving Auto-Cache Engine Sitemap routines.
     *
     * @param int $blog_id (Optional) Blog ID. Default null (current blog).
     *
     * @return string $url Home URL link with Home URL scheme preserved.
     */
    public function getHomeUrlWithHomeScheme($blog_id = null)
    {
        if (empty($blog_id) || !is_multisite()) {
            $url = get_option('home');
        } else {
            switch_to_blog($blog_id);
            $url = get_option('home');
            restore_current_blog();
        }

        $url = set_url_scheme($url, parse_url($url, PHP_URL_SCHEME));

        return $url;
    }
}