ITeye博客

lucklrj

lucklrj · 共 23 篇文章

electron快速入门

electron官方地址:https://github.com/sindresorhus/awesome-electron 1. 先下载electron的官方演示程序, git clone https://github.com/atom/electron-quick-start 我下载放到了 D:\study\electron\1 下面,只保存以下三个文件 index.html main.js package.json 2.安装 electron-prebuilt npm install electron-prebuilt -g(这步很慢,可以用cnpm代替) 安装成功后,node.js根目…

2016-03-10 23:09 · 评论(0)

多系统共用mysql数据文件

老笔记本了把光驱拆了,装一个ssd上去,装成了fedroa23,原来硬盘重装了windows7 准备把开发环境换成linux,其他娱乐环境依然用win7 2块硬盘启动顺序手动控制,然后win7安装了php环境,数据库使用以前5.5的备份,在fedroa上装了mysql5.7,并自动挂载win7所用的硬盘,mysql5.7目录指向win7硬盘位置。,新的版本使用了数据压缩,不支持向下兼容,导致win7数据库无法启动,解决办法:把windows的升级到mysql 5.7即可.

2016-02-20 00:37 · 评论(0)

过滤在线编辑器产生的不安全html代码

过滤在线编辑器产生的不安全html代码; <?php /** * 过滤在线编辑器产生的不安全html代码. * * PHP versions 4 and 5 * * @copyright 版权所无,任意传播. * @link http://www.52sunny.net * @name html过滤 * @version v 0.0.10 * @author Lucklrj (sunny_lrj@yeah.net,qq:7691272) * @lastmodified 2006-06-09 10:42 (Tue, 2006-06-09) * @notice 此版本只过滤js,框架,表单。 作…

2015-12-16 21:05 · php · javascript · 评论(0)

2维数组根据数组里的字段来构造树

常见应用环境: //把一个多维数组,按field 顺序建一个新的多维数组,层数为array_field的个数 function extended_array($array,$fields,$clear=1){ $array_field=explode(",",$fields); $array_field_length=count($array_field); $tmp=array(); foreach ($array as $key => $single_info){ $next=&$tmp; foreach ($array_field as $index => $single_field)…

2015-11-18 01:09 · php · 评论(0)

php 多语言 gettext问题以及解决

产生的po文件,以utf8无bom保存, msgfmt -o default.mo default.po --verbose default.po: warning: PO file header missing, fuzzy, or invalid warning: charset conversion will not work found 1 fatal error 将po文件以多种格式保存,均如此。多方无解,最后安装virtaal.exe,打开po产生的mo可以正常使用。 命令行编译的mo可以用virtaal打开,但应用无法翻译,不明原因。

2015-03-28 02:25 · php · 评论(0)

PHP fastcgi MaxRequestLen设置请求最大值(上传允许最大值)

日志: mod_fcgid: HTTP request length 132391 (so far) exceeds MaxRequestLen (131072), referer: ***

2015-01-13 18:07 · php · javascript · 评论(0)

windows7 php5.3 +zend guard loader 安装

安装无难点,但跟widnows版本有关,zend guard loader只支持非线程安全的版本,也就是nts,apache以模块方式安装php,又需要线程安全版本,所以需要使用mod_fcgid http://download.csdn.net/detail/hm446434459/4146487 作为fastcgi方式运行php.

2014-11-24 18:11 · 评论(0)

nginx+php+ci

配置文件备忘: location / { index index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } } location ~ .+\.php($|/) { set $script $uri; set $path_info "/"; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php…

2014-09-08 23:52 · php · 评论(0)

phpexcel读取excel时间的坑

按照phpexcle的api,将excle解析为数组的代码: $this->excel = PHPExcel_IOFactory::load($this->file_path); $sheetData = $this->excel->getActiveSheet()->toArray(null,true,true,true); 如果字段有日期格式,比如2014-06-28 23:12:08,解析出来的数组对应的日期字段有问题,百度了下各种解决办法,以下最方便。 $this->excel = PHPExcel_IOFactory::load($this->file_path); $Active…

2014-08-22 16:34 · php · 评论(0)

js采集:新浪微博标签采集

第一步加载js /*加载jq*/ var _doc=document.getElementsByTagName('head')[0]; var script=document.createElement('script'); script.setAttribute('type','text/javascript'); script.setAttribute('src','http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js'); _doc.appendChild(script); 第二步 var tags=[]; var run=1; fu…

2013-11-20 16:10 · javascript · 评论(0)

为PHP CodeIgniter 框架controllers支持多层目录

Index: Router.php =================================================================== --- Router.php (版本 11328) +++ Router.php (版本 12362) @@ -274,13 +274,26 @@ return $segments; } + $dir=$segments[0]; + $dir_level=0; + + while(is_dir(APPPATH.'controllers/'.$dir)){ + $dir_level++; + if(isset($segmen…

2013-11-01 18:13 · php · 评论(0)

PHP模拟登录新浪微博(sina sso 1.4.5)

在模拟登录新浪微博的时候,发现用户名,密码都用js ras2方式加密传输。尝试将js加密过程用php来实现,结果发现一直提示用户名密码不对,用php翻译js也失败。 最后搜索出用node.js来实现。 c("Encryption password"); $cmd = "node D:\web\data\sina.js ".$pre_login_data['pubkey']." ".$pre_login_data['servertime']." ".$pre_login_data['nonce']." ".$password; $sp=exec($cmd); 模拟登陆成功,但是在采集url的时…

2013-08-12 10:57 · php · 评论(0)

模拟登录微信公众平台,进行群发的js

模拟登录微信公众平台,进行群发的js 用法: 1:打开微信公众平台的用户列表,修改单页显示参数,避免分页 2.打开firebug 控制台,将一下代码贴入 3.执行 send()即可,相关参数自己修改 发到一定数量时,将会提示需要输入验证码,此时输入正确后,同样内容继续群发仍会提示,需要给不同人发一点其他内容,多试几次,即可回到群发上来。 var friendList = jQuery.parseJSON(jQuery('#json-friendList').html()) || []; var friend=[]; for(var i in friendList){ friend.push(…

2013-08-01 10:18 · 评论(0)

mysql sql中自动增加序列值

update photo set order_id=0; update photo p,(SELECT @row := 0) r set p.order_id= (@row := @row + 1) where p.active=1 ;

2013-07-02 14:25 · 评论(0)

CI 的pdo driver一处bug

算缺陷也好,算bug也好,反正它出错了。 pdo_driver function _execute($sql) if(substr(strtolower($sql),0,6)=="select") //if (is_numeric(stripos($sql, 'SELECT')))//这里判断不对 注释这排是CI的,漏掉了insert into select..这种情况,包含了selec一律做为读操作进入下面的循环,导致重复执行了一次写sql

2012-12-17 23:21 · 评论(0)