Нема описа

CdnAssetUrl.php 482B

123456789101112131415161718192021222324
  1. <?php
  2. namespace MailPoet\Util;
  3. if (!defined('ABSPATH')) exit;
  4. class CdnAssetUrl {
  5. const CDN_URL = 'https://ps.w.org/mailpoet/';
  6. /** @var string */
  7. private $baseUrl;
  8. public function __construct(
  9. string $baseUrl
  10. ) {
  11. $this->baseUrl = $baseUrl;
  12. }
  13. public function generateCdnUrl($path) {
  14. $useCdn = defined('MAILPOET_USE_CDN') ? MAILPOET_USE_CDN : true;
  15. return ($useCdn ? self::CDN_URL : $this->baseUrl . '/plugin_repository/') . "assets/$path";
  16. }
  17. }