自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 StringBuffer与StringBuilder实现原理

StringBuffer与StringBuilder实现原理

2022-06-21 09:37:30 200 2

原创 记录PHP7访问sqlserver2005报错问题

[20-Jul-2021 13:19:03] WARNING: [pool www] child 12809 exited on signal 11 (SIGSEGV) after 12.358597 seconds from start[20-Jul-2021 13:19:03] NOTICE: [pool www] child 13294 started问题记录:Nginx提示502,查看fpm只提示一个警告,没有任何错误信息。开始以为是fpm超时了,设置为永久不超时后问题依旧。排查1:.

2021-07-20 13:48:46 396

原创 一个elasticsearch支持多套运行环境(spring elasticsearch data 4)

ps:因服务器资源有限,不能部署多套elasticsearch,同时也保证了环境的一致性(可能都遇到过环境不一样,运行结果也不一样,乱七八糟的bug出现),本项目基于spring boot2+之前支持spring elasticsearch data 3,现在升级4后实现方法有很大不同。解决办法:采用前缀prefix区分环境,如:dev_ test_1、首先定义实体类:@Document(indexName = "area_zqcrm", type = "_doc")@Data@J..

2020-05-28 14:30:28 820 1

原创 spring-boot-starter-data-elasticsearch驼峰转下划线

@Document(indexName = "platform1005_member_data")@Data@JsonIgnorePropertiespublic class Member { @Id @JsonProperty("member_id") private int memberId; @JsonProperty("company_id") ...

2020-01-02 11:38:06 3133 3

原创 php cas单点登录核心代码无session

基于cas标准抽取精简而来,不需要session。登录状态自行控制,如jwt/token/cookie/session。这样就可以在Swoole中使用cas了。使用方法:第一步、composer 拉取包 sayid/php-cas-core第二步:$cas = new \PhpCasCore\Cas(env("CAS_SERVER"), env("CAS_PATH")); ...

2019-11-15 09:19:56 432

原创 java-spring boot在jar包中封装bean

1、编写bean类@Component@Scope(value = WebApplicationContext.SCOPE_REQUEST,proxyMode= ScopedProxyMode.TARGET_CLASS)public class CeAuth {} 注意:scope注释该bean仅在当前http生命周期内有效2、配置要注册到spring的bean在res...

2019-10-11 11:58:30 388

原创 lumen框架pdo返回数组格式

lumen5.5(5.4?忘了),默认返回的数据格式是对象不再返回数组形式,config/database.php中设置了也没用。1、新建一个EventServiceProvider.php文件class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for t...

2019-05-22 09:04:42 349

原创 lumen框架实例化mysql pdo对象

$databaseConfig = config("database.connections.mysql");try { //底层已经做了重连机制 $pdo = (new ConnectionFactory(app()))->createConnector($databaseConfig)->connect($databaseConfig); return ...

2019-05-22 08:58:15 408

原创 java/php微服务架构(php服务端)

一、服务端:项目服务使用lumen5.8+Swoole作为运行环境,.env配置文件中需要定义每个服务端服务id,方便调试和做特殊的逻辑处理如:SERVICE_ID=100011、composer中引入"cecd/thrift": "dev-master"并执行composer update2、创建启动脚本<?phpnamespace Cecd\Sdk...

2019-05-21 16:05:36 1810

原创 微服务架构(java/php)

背景说明:我们公司使用PHP7.3/Swoole + java/spring boot作为技术栈,服务间通信使用thrift做了二次封装,本套技术方案从设想到落地均由本人推进开发1、php技术栈:框架为lumen5.82、java技术栈:spring boot2.1.3 mybatis fastjson 公共配置中心config3、rpc协议:thrift 0.124、网关 k...

2019-05-21 15:55:09 1808

原创 laravel/lumen复写mysql pdo连接器

$databaseConfig = config("database.connections.mysql");$pdo = (new ConnectionFactory(app()))-&gt;createConnector($databaseConfig)-&gt;connect($databaseConfig);//设置查询数据方式为数组Event::listen ( Stateme...

2019-01-10 17:41:07 437

原创 php7.1新特性汇总

Core:Added nullable types. Added DFA optimization framework based on e-SSA form. Added specialized opcode handlers (e.g. ZEND_ADD_LONG_NO_OVERFLOW). Added [] = as alternative construct to list() ...

2018-12-18 09:42:11 520

原创 php7.2新特性汇总

Core:Added ZEND_COUNT, ZEND_GET_CLASS, ZEND_GET_CALLED_CLASS, ZEND_GET_TYPE, ZEND_FUNC_NUM_ARGS, ZEND_FUNC_GET_ARGS instructions, to implement corresponding builtin functions. "Countable" interface...

2018-12-18 09:21:01 679

原创 php7.0新特性汇总

Core:Added zend_internal_function.reserved[] fields. Improved __call() and __callStatic() magic method handling. Now they are called in a stackless way using ZEND_CALL_TRAMPOLINE opcode, without ad...

2018-12-12 17:40:03 280

原创 php7.3新特性汇总

Core:Improved PHP GC.  提升php的垃圾回收机制 Redesigned the old ext_skel program written in PHP, run: 'php ext_skel.php' for all options. This means there are no dependencies, thus making it work on Windows...

2018-12-12 17:24:15 1367

原创 升级mojave之后xcrun: error: invalid active developer path

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun解决方案:进入https://developer.apple.com/download/mo...

2018-11-05 15:23:13 251

原创 php使用基于Swoole(socket)做imap客户端

1、坑点qq邮箱的文件夹是带空格的,直接select文件夹会提示参数错误。解决方法:select "sent messages"

2018-06-28 09:14:42 477

原创 linux git服务器搭建,多用户协作

1、安装git2、创建用户user add -M username #-M不会在home目录下创建用户目录user add -M username1user add -M username22、创建用户组gitgroupadd git #创建git用户组,方便统一管理权限4、将用户加入用户组usermod -G 组名称 用户名称1

2017-08-26 16:24:59 4830 5

原创 kibana+kafka+elastic+logstash 日志分析系统

kibana+kafka+elastic+logstash 日志分析系统

2017-08-23 19:21:31 944

原创 selenuim ide自定义formats

参考地址:https://automatetheplanet.com/create-custom-selenium-ide-export-webdriver/

2017-04-18 10:34:42 201

原创 mac下php7开启opcache

这个很简单~~~~~~~~~~~~~~~~~~~~~1、phpinfo输出看看编译时有没有配置opcache、如果有能找到opcache.ini的配置文件,编辑该文件直接打开就可以了2、编译时没有配置opcache,需要手动编译扩展文件进入php源码/ext目录,执行/usr/local/php5/bin/phpize过后执行编译配置./configuer --with-php-c

2017-03-13 09:53:46 3711

原创 mac下为php7安装memcached扩展

1、下载libmemcached安装错误提示:libmemcached/byteorder.cc:66:10: error: use of undeclared identifier 'ntohll'解决方法:打开mem_config.php将#define HAVE_HTONLL 1注释掉继续安装,错误提示:、 clients/memflush.c

2017-03-06 14:55:53 1528

原创 mac编译安装php7.1

1、执行配置命令./configure --prefix=/usr/local/php71 --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-di

2017-03-02 11:29:51 5701

原创 mac下libxml2安装

安装php5.6过程中提示需要依赖libxml,不依赖libxml呢会提示pear依赖了xml。。。。没法了还是要装上1、下载libxml2源码ftp://xmlsoft.org/libxml2/ 下载最新版2、解压包3、执行./configure4、执行sudo make,(光执行make会提示权限问题)5、make install安装完成

2017-03-01 09:44:34 2310

转载 linux下c语言操作mysql数据库

/* ============================================================================ Name : mysql_test.c Author : Version : Copyright : Your copyright notice Description : Hello Wor

2016-08-10 14:15:16 363

原创 linux下php扩展开发入门之hello word

1、进入php源码ext目录 执行 ./ext_skel --extname=helloworld参数--extname=是指定扩展名2、进入去helloworld目录,掉config.m4中几行注释3、在php源码根目录执行命令 ./buildconf --force4、 ./configure --with-helloworld5、进入我们的扩展目录hellowor

2016-08-10 09:56:38 452

原创 C语言调动php代码示例

#include #include int main( int argc, char *argv[] ){ FILE *fp; int status; char output[1024]; /* Open the command for reading. */ //popen调用本地php,执行php代码获取返回值并输出

2016-08-10 09:44:04 842

转载 Mysql 索引知识点精华

1、MyIsam最长索引不能超过1000,innodb不能超过767,索引长度越短越好例如:create table test(id int,name1 varchar(300),name2 varchar(300),name3 varchar(500))charset=latin1 engine=myisam;create index test_name on test(name1,

2015-03-07 18:53:58 363

转载 memcache的存储步骤

memcache是在slab内存池的基础上, 每个slab内维护LRU链表, 每个NODE具有生命期, 所有Cache的NODE组成Hash表。memcache采用懒惰删除机制, 其内存请求步骤大致是这样一个请求链: 根据node的size定位到slab ---> 从该slab的LRU尾部向前寻找过期且reference==1的NODE, 如果找到, 则从hash表与LRU中unlink此

2015-03-06 17:39:58 332

转载 mysql数据库优化方法

1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,Sql 代码 : select id from t where num is null;可以在 num 上设置默认值 0,确保表中 num 列没有 null 值,然

2015-03-05 19:51:39 265

转载 Mysql char varchar效率

char定长,varchar不定长,char要比varchar占用更多的空间,由于定长char的效率高于varchar,char最大255,varchar最大65536"更高级一点的数据是"char在存入和取出的时候,会自动把末尾的空格去掉,varchar会额外的多用1-2个字节来存放字符长度,列中有一个varchar会自动把char转换成varchar,而当varchar长度小于4时,自动的把v

2015-03-05 19:49:38 1078

转载 把IP地址存成 UNSIGNED INT

可以使用 INET_ATON() 来把一个字符串IP转成一个整形,并使用 INET_NTOA() 把一个整形转成一个字符串IP。在PHP中,也有这样的函数 ip2long() 和 long2ip()。

2015-03-05 19:26:05 936

原创 Mysql char varchar详解,

1、char定长255,varchar不定长,char会自动填充到255,char要比varchar占用更多的空间,由于定长char的效率高于varchar。char在存入和取出的时候,会自动把末尾的空格去掉,varchar会额外的多用1-2个字节来存放字符长度,列中有一个varchar会自动把char转换成varchar,而当varchar长度小于4时,自动的把varchar转换成char...

2015-03-05 18:53:29 326

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除