animation: clock 10s both ; /*both -нужен для сохранения css правил после проигрывания анимации */
opacity:0;
--video-filter=motiondetect
для включения фильтра детектора движения, по вкусу - --rate=
для скорости воспроизведения, ну и -vv >logfile.txt
- для вывода сообщений в текстовый лог, который потом предстоит изучить. namespace Repository;
class User {
protected $db;
public function __construct(Adapter $db) {
$this->db = $db;
}
public function getUserById($id) {
$sql = "SELECT * FROM user WHERE id = :id";
$stmt = $this->db->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetch();
}
public function getImageById($id) {
$sql = "SELECT IF(image IS NULL or image = '','no_image.png',image) as image FROM `user` WHERE id = :id";
$result = $this->db->prepare($sql);
$result->bindParam(':id', $id, PDO::PARAM_INT);
$result->execute();
return $result->fetchColumn();
}
public function updateImageById($imageName, $id) {
$sql = "UPDATE user SET image = '$imageName' WHERE id = $id";
return $this->db->query($sql);
}
}
namespace Service;
class Image {
protected $userRepo;
function __construct(Repository\User $userRepo) {
$this->userRepo = $userRepo;
}
public function UploadImage(array $image) {
$usersImage = $image['userfile']['tmp_name'];
$imageName = $image['userfile']['name'];
if (is_uploaded_file($image['userfile']['tmp_name'])) {
move_uploaded_file($usersImage, $_SERVER['DOCUMENT_ROOT'] . "/template/images/users/" . $image['userfile']['name']);
}
return $imageName;
}
public function updateImage(array $image, $id) {
if($imageName = $this->uploadImage($image, $id)) {
$this->userRepo->updateImageById($imageName, $id);
return true;
}
}
}
class UserController extends BaseController {
protected $imageService;
protected $userRepo;
function __construct(Service\Image $imageService, Repository\User $userRepo) {
$this->imageService = $imageService;
$this->userRepo = $userRepo;
}
public function actionProfile($id) {
if (isset($_POST['submit_photo'])) {
$this->imageService->updateImage($_FILES, $id);
}
return $this->render('user/profile.php', [
'user' => $this->userRepo->getUserById($id),
'image' => $this->userRepo->getImageById($id)
]);
}
}
==
и ===
)$query = new \yii\db\Query();
$query->from('Pages')
->leftJoin('categories', ['categories' => 'id_categories'])
->where(['status' => 1])
->andFilterWhere(['like', 'path', $filter_category]);
if (! empty($filter_time)) {
$expression = new \yii\db\Expression('now() - interval :filter_time minute', [
':filter_time' => $filter_time
]);
$query->andWhere(['>', 'date_created', $expression]);
}
server {
listen 443 ssl http2;
server_name домен_здесь;
ssl_certificate /путь/к/сертификату;
ssl_certificate_key /путь/к/ключу;
тут ваш location {}
}
server {
listen 80;
server_name домен_здесь;
return 301 https://$server_name$request_uri;
}
/etc/nginx/conf.d/tls.conf
положил достаточно строгие настройки без старых протоколов и слабых шифров, которые максимально безопасны, но работают лишь в актуальных версиях браузеров (IE9-10, древние Firefox, Chrome и Safari могут не работать совсем):ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_dhparam /etc/ssl/dhparam.pem;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=31536000;";
ssl_stapling on;
ssl_stapling_verify on;
.sky-mega-menul:hover {
box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}
$record = '_xmpp-server._tcp.peterhost.ru SRV 100 0 5269 xmpp-s.peterhost.ru.';
$data = [];
list($service, $data['type'], $data['priority'], $data['weight'], $data['port'], $data['target']) = explode(' ', $record);
list($data['service'], $data['proto'], $data['name']) = explode('.', $service, 3);
var_dump($data);
array(8) {
'type' =>
string(3) "SRV"
'priority' =>
string(3) "100"
'weight' =>
string(1) "0"
'port' =>
string(4) "5269"
'target' =>
string(20) "xmpp-s.peterhost.ru."
'service' =>
string(12) "_xmpp-server"
'proto' =>
string(4) "_tcp"
'name' =>
string(12) "peterhost.ru"
}