这个问题在BOOTCAMP中更突出。
windows 蓝牙不稳定问题解决
回复
这个问题在BOOTCAMP中更突出。
主要是用于Eclipse PDT,理论上Zend Studio完全兼容。
composer require panlatent/php-event-ide-helper
composer require phpv8/v8js-stubs
https://github.com/krakjoe/pthreads/blob/master/examples/stub.php
https://github.com/eaglewu/swoole-ide-helper
https://github.com/swoole/ide-helper
https://github.com/shixinke/phpstorm-for-php-framework
# screen -S old_session_name -X sessionname new_session_name
<?php /** * https://github.com/pokeyou/GpsPositionTransform * WGS84坐标系(World Geodetic System):即地球坐标系,国际上通用的坐标系。设备一般包含GPS芯片或者北斗芯片获取的经纬度为WGS84地理坐标系,谷歌地图采用的是WGS84地理坐标系(中国范围除外) * GCJ02坐标系:即火星坐标系,是由中国国家测绘局制订的地理信息系统的坐标系统。由WGS84坐标系经加密后的坐标系。谷歌中国地图和搜搜中国地图采用的是GCJ02地理坐标系 * BD09坐标系:即百度坐标系,GCJ02坐标系经加密后的坐标系; * 搜狗坐标系、图吧坐标系等,估计也是在GCJ02基础上加密而成的。 */ class Gis { private static $pi = 3.1415926535897932384626; private static $a = 6378245.0; private static $ee = 0.00669342162296594323; /** * get rectangle longitude and latitude * * @param float $longitude * @param float $latitude * @param integer $distance * meter * @return array */ static function rectangle($longitude, $latitude, $distance) { $radius = 6371 * 1000; // latitude boundaries $maxlat = $latitude + rad2deg($distance / $radius); $minlat = $latitude - rad2deg($distance / $radius); // longitude boundaries (longitude gets smaller when latitude increases) $maxlng = $longitude + rad2deg($distance / $radius / cos(deg2rad($latitude))); $minlng = $longitude - rad2deg($distance / $radius / cos(deg2rad($latitude))); return array( array( 'lng' => $minlng, 'lat' => $minlat ), array( 'lng' => $maxlng, 'lat' => $maxlat ) ); } /** * get distance by longitude and latitude * * @param mixed $lng1 * @param mixed $lat1 * @param mixed $lng2 * @param mixed $lat2 * @return int meter */ static function distance($lng1, $lat1, $lng2, $lat2) { // convert latitude/longitude degrees for both coordinates // to radians: radian = degree * π / 180 $lat1 = deg2rad($lat1); $lng1 = deg2rad($lng1); $lat2 = deg2rad($lat2); $lng2 = deg2rad($lng2); // calculate great-circle distance $distance = acos( sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($lng1 - $lng2)); // distance in human-readable format: // earth's radius in km = ~6371 return 6371 * $distance * 1000; } /** * * @param mixed $lng * @param mixed $lat * @return array */ public static function wgs842gcj02($lng, $lat) { if (static::outOfChina($lat, $lng)) { return null; } $dLat = static::transformLat($lng - 105.0, $lat - 35.0); $dLon = static::transformLng($lng - 105.0, $lat - 35.0); $radLat = $lat / 180.0 * static::$pi; $magic = sin($radLat); $magic = 1 - static::$ee * $magic * $magic; $sqrtMagic = sqrt($magic); $dLat = ($dLat * 180.0) / ((static::$a * (1 - static::$ee)) / ($magic * $sqrtMagic) * static::$pi); $dLon = ($dLon * 180.0) / (static::$a / $sqrtMagic * cos($radLat) * static::$pi); $mgLat = $lat + $dLat; $mgLon = $lng + $dLon; return array( "lat" => $mgLat, "lng" => $mgLon ); } /** * * @param mixed $lng * @param mixed $lat * @return array */ public static function gcj022wgs84($lng, $lat) { $gps_arr = static::transform($lng, $lat); $lontitude = $lng * 2 - $gps_arr["lon"]; $latitude = $lat * 2 - $gps_arr["lat"]; return array( "lat" => $latitude, "lng" => $lontitude ); } /** * * @param mixed $lng * @param mixed $lat * @return array */ public static function gcj022bd09($lng, $lat) { $x = $lng; $y = $lat; $z = sqrt($x * $x + $y * $y) + 0.00002 * sin($y * static::$pi); $theta = atan2($y, $x) + 0.000003 * cos($x * static::$pi); $bd_lon = $z * cos($theta) + 0.0065; $bd_lat = $z * sin($theta) + 0.006; return array( "lat" => $bd_lat, "lng" => $bd_lon ); } /** * * @param mixed $lng * @param mixed $lat * @return array */ public static function bd092gcj02($lng, $lat) { $x = $lng - 0.0065; $y = $lat - 0.006; $z = sqrt($x * $x + $y * $y) - 0.00002 * sin($y * static::$pi); $theta = atan2($y, $x) - 0.000003 * cos($x * static::$pi); $gg_lon = $z * cos($theta); $gg_lat = $z * sin($theta); return array( "lat" => $gg_lat, "lng" => $gg_lon ); } public static function bd092wgs84($lng, $lat) { $gcj02_arr = static::bd092gcj02($lat, $lng); $map84_arr = static::gcj022wgs84($gcj02_arr["lat"], $gcj02_arr["lng"]); return $map84_arr; } private static function outOfChina($lng, $lat) { if (($lng < 72.004 || $lng > 137.8347) && ($lat < 0.8293 || $lat > 55.8271)) return true; return false; } private static function transform($lng, $lat) { if (static::outOfChina($lng, $lat)) { return array( "lat" => $lat, "lng" => $lng ); } $dLat = static::transformLat($lng - 105.0, $lat - 35.0); $dLon = static::transformLng($lng - 105.0, $lat - 35.0); $radLat = $lat / 180.0 * static::$pi; $magic = sin($radLat); $magic = 1 - static::$ee * $magic * $magic; $sqrtMagic = sqrt($magic); $dLat = ($dLat * 180.0) / ((static::$a * (1 - static::$ee)) / ($magic * $sqrtMagic) * static::$pi); $dLon = ($dLon * 180.0) / (static::$a / $sqrtMagic * cos($radLat) * static::$pi); $mgLat = $lat + $dLat; $mgLon = $lng + $dLon; return array( "lat" => $mgLat, "lng" => $mgLon ); } private static function transformLat($x, $y) { $ret = - 100.0 + 2.0 * $x + 3.0 * $y + 0.2 * $y * $y + 0.1 * $x * $y + 0.2 * sqrt(abs($x)); $ret += (20.0 * sin(6.0 * $x * static::$pi) + 20.0 * sin(2.0 * $x * static::$pi)) * 2.0 / 3.0; $ret += (20.0 * sin($y * static::$pi) + 40.0 * sin($y / 3.0 * static::$pi)) * 2.0 / 3.0; $ret += (160.0 * sin($y / 12.0 * static::$pi) + 320 * sin($y * static::$pi / 30.0)) * 2.0 / 3.0; return $ret; } private static function transformLng($x, $y) { $ret = 300.0 + $x + 2.0 * $y + 0.1 * $x * $x + 0.1 * $x * $y + 0.1 * sqrt(abs($x)); $ret += (20.0 * sin(6.0 * $x * static::$pi) + 20.0 * sin(2.0 * $x * static::$pi)) * 2.0 / 3.0; $ret += (20.0 * sin($x * static::$pi) + 40.0 * sin($x / 3.0 * static::$pi)) * 2.0 / 3.0; $ret += (150.0 * sin($x / 12.0 * static::$pi) + 300.0 * sin($x / 30.0 * static::$pi)) * 2.0 / 3.0; return $ret; } }
google一搜一大堆,官方文档也有说明,坑比较多。
绝大多数情况后端都是http明文传输,因为Jenkins的http服务winstone配置https比较麻烦,用的是java的keystore file那一套比较小众。
前端nginx是https,只需要注意一个问题,jenkins页面中加载的众多js中有动态加载的情况,如果后端是http,动态加载的js就会走http,这样浏览器就会报警告说在https页面中访问http,然后出一些莫名其妙的恶心问题,导致js报错从而导致一些功能不能用。
nginx配置中增加一项配置可以解决
proxy_set_header X-Forwarded-Proto $scheme;
修改配置之后刷新页面记得清除缓存。
补充:
在jenkins的系统设置中有 Jenkins Location->Jenkins URL 配置项,有可能会有用。