| Server IP : 82.208.35.60 / Your IP : 216.73.217.167 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/d2m/sofident_cz/wp-content/plugins/wpml-string-translation/classes/package/ |
Upload File : |
<?php
namespace WPML\ST\Package;
use WPML\Collect\Support\Collection;
class Domains {
/** @var \wpdb $wpdb */
private $wpdb;
/** @var array $domains */
private $domains;
public function __construct( \wpdb $wpdb ) {
$this->wpdb = $wpdb;
}
/**
* @param string|null $domain
*
* @return bool
*/
public function isPackage( $domain ) {
return $domain && $this->getDomains()->contains( $domain );
}
/**
* @see \WPML_Package::get_string_context_from_package for how the package domain is built
*
* @return Collection
*/
public function getDomains() {
if ( ! $this->domains ) {
$this->domains = wpml_collect(
$this->wpdb->get_col(
"SELECT CONCAT(kind_slug, '-', name) FROM {$this->wpdb->prefix}icl_string_packages"
)
);
}
return $this->domains;
}
}