class C
{
private static $instance;
private $allowIps;
private $isExcluded;
private function __constructor() {
$this->allowIps [
'127.0.0.0',
'0.0.0.0'
];
}
public static function getInstace() {
if (is_null($this->instance)) {
$this->instance = new self();
}
return $this->instance;
}
public function isExcluded($ip) {
if (is_null($this->isExcluded)) {
$this->isExcluded = in_array($ip, $this->allowIps);
}
return $this->isExcluded
}
}
ALTER TABLE `country_name` ADD FULLTEXT INDEX `ft_country` (`country_name` ASC);
SELECT `country_id` FROM `country` WHERE MATCH(`country_name`) AGAINST("подстрока поиска");
CREATE INDEX `country_name` ON `country` (`country_name`(100));
SELECT `country_id` FROM `country` WHERE `country_name` LIKE "подстрока поиска";
SELECT `country_id` FROM `country` WHERE `country_name` LIKE "подстрока поиска%";