<?php
namespace app\modules\admin\assets;
class AdminAsset extends \yii\web\AssetBundle
{
public $sourcePath = '@app/modules/admin/static';
public $publishOptions = ['forceCopy' => true];
public $css = [
'css/style.css'
];
public $js = [
'js/main.js'
];
public $depends = [
'yiister\adminlte\assets\Asset'
];
}
location /parser/ {
rewrite ^(.*)$ /parser/index.php permanent;
}
location ~ /parser/.+\.php$ {
error_log /var/www/theinsider/sites/logs/nginx_error_parser.log;
root /var/www/theinsider/sites/theinsider.ua;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_buffers 64 64k;
fastcgi_buffer_size 256k;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
$date='2016-05-26 18:06:08';
//переводим в секунды
$time=strtotime($date);
$zone=new DateTime($date, new DateTimeZone('America/New_York'));
// Смещение временной зоны в секундах.
$dif=$zone->format('Z');
if($dif < 0){
$date=$time+$dif;
}
if($dif > 0){
$date=$time-$dif;
}
echo date('Y-m-d H:i:s',$date);
io.on('connection', function(socket){
console.log('a user connected');
console.log(socket.request.user);
// .......
});
select * from products limit 60,30
$text='Строка';
$short = iconv('UTF-8','windows-1251',$text);
$short = substr($short ,0,2);
$short = iconv('windows-1251','UTF-8',$short );
echo $short;