vr-shopxo-source/extend/base/Behavior.php

313 lines
6.9 KiB
PHP
Raw Normal View History

2018-12-28 10:58:37 +00:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace base;
/**
2021-04-20 10:37:27 +00:00
* 基础信息驱动
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:50:41+0800
*/
class Behavior
{
/**
2020-09-23 08:03:14 +00:00
* 上报安装日志
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-23
* @desc description
* @param [array] $params [输入参数]
2018-12-28 10:58:37 +00:00
*/
2020-09-23 08:03:14 +00:00
public function ReportInstallLog($params = [])
2018-12-28 10:58:37 +00:00
{
// 数据列表
2020-09-23 08:03:14 +00:00
$data = [
'user' => $this->GetUserCookie(),
'host' => $this->GetUrl('host'),
'server_port' => $this->GetServerPort(),
'server_ip' => $this->GetServerIP(),
'url' => $this->GetUrl('url'),
'request_url' => $this->GetUrl('request'),
'source_url' => $this->GetSourceUrl(),
'client_ip' => $this->GetClientIP(),
'os' => $this->GetOs(),
'browser' => $this->GetBrowser(),
'method' => $this->GetMethod(),
'scheme' => $this->GetScheme(),
'version' => $this->GetHttpVersion(),
'client' => $this->GetClinet(),
'php_os' => PHP_OS,
'php_version' => PHP_VERSION,
'php_sapi_name' => php_sapi_name(),
'client_date' => date('Y-m-d H:i:s'),
'ymd' => date('Ymd'),
'ver' => str_replace('v', '', APPLICATION_VERSION),
];
2018-12-28 10:58:37 +00:00
// 描述信息
2020-09-23 08:03:14 +00:00
if(!empty($params['msg']))
2018-12-28 10:58:37 +00:00
{
2020-09-23 08:03:14 +00:00
$data['msg'] = $params['msg'];
2018-12-28 10:58:37 +00:00
}
// mysql版本
2020-09-23 08:03:14 +00:00
if(!empty($params['mysql_version']))
2018-12-28 10:58:37 +00:00
{
2020-09-23 08:03:14 +00:00
$data['mysql_version'] = $params['mysql_version'];
2018-12-28 10:58:37 +00:00
}
// 上报数据
$url = 'http://report.shopxo.net/install.php';
if(function_exists('curl_init'))
{
2020-09-23 08:03:14 +00:00
CurlPost($url, $data);
2018-12-28 10:58:37 +00:00
} else {
2020-09-23 08:03:14 +00:00
FsockopenPost($url, $data);
2018-12-28 10:58:37 +00:00
}
}
/**
* [GetScheme http类型]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:04:33+0800
*/
2020-09-23 08:03:14 +00:00
public function GetScheme()
2018-12-28 10:58:37 +00:00
{
2020-09-23 08:03:14 +00:00
return strtoupper(__MY_HTTP__);
2018-12-28 10:58:37 +00:00
}
/**