robogame
解决了1万条数据,解决不了10万,百万,千万的数据量传递,说明这种方式存在问题
最好的方式,是在外层用shell脚本进行控制,先用shell读取php脚本获取总页数,
然后,通过shell循环,每一个循环开启一个php进程,进行本页数据的同步,
同步后,进程处理结束,shell进行下一个循环,是一个新的php进程,这样,千万数据也没事,你可以每页处理1000行,照样用AR。给你个例子看看:
#!/bin/sh Cur_Dir=$(cd `dirname $0`; pwd) # get product all count. count=`$Cur_Dir/yii order/order/orderstatuscount` echo "There are $count Order to process" echo "##############ALL BEGINING###############"; start=0 for (( i=1; i<=$count; i++ )) do start=`$Cur_Dir/yii order/order/syncorderstatus $start` echo "Order_id $start done" done echo "##############ALL COMPLETE###############";
嗯,你这个方法好,确实如此,千万级别的数据,还是这种最靠谱
- robogame 发布了教程关于Yii2的内存泄露问题
"COUNT(".Trades::tableName().".itemid) AS tradesCount",
这里,提示报错,Getting unknown property,tradesCount不是yii的这个问题,而是你开启了debug模式,原生的sql(非yii带的原生)是不会记录在debug的日志中,所以内存不会增长,如果你关闭debug,你再测试下你的代码,会发现内存没有怎么增长
- robogame 提出了问题如何来用两套rbac?
LocalGoogleFont.zip
离线解决方法:
下载附件,解压缩到vendor/almasaeed2010/adminlte/dist/css目录下
然后在AdminLTE.min.css修改为:
@import url(./local.google.fonts.css);
即可
参照楼上@bubifengyun的地址求助:
环境:phpstudy
代码路径:E:\phpStudy\WWW\yii2admin
vhosts.conf配置如下:ServerName local.yii2admin.com RewriteEngine on DocumentRoot "E:\phpStudy\WWW\yii2admin" # 应用前端主要重写规则 RewriteCond %{HTTP_HOST} ^local.yii2admin.com$ [NC] RewriteCond %{REQUEST_URI} !^/(backend/web|admin|storage/web) RewriteRule !^/frontend/web /frontend/web%{REQUEST_URI} [L] # 重定向的网页没有一个斜线(注释,如果必要的话) #RewriteCond %{REQUEST_URI} ^/admin/$ #RewriteRule ^(/admin)/ $1 [L,R=301] # 禁止斜线重定向 RewriteCond %{REQUEST_URI} ^/admin$ RewriteRule ^/admin /backend/web/index.php [L] # 后端应用程序的主要重写规则 RewriteCond %{REQUEST_URI} ^/admin RewriteRule ^/admin(.*) /backend/web$1 [L] <Directory /> Options FollowSymLinks AllowOverride None AddDefaultCharset utf-8 </Directory> <Directory "E:\phpStudy\WWW\yii2admin/frontend/web"> RewriteEngine on # 如果一个目录或一个文件存在,请直接使用请求 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # 否则去请求 index.php RewriteRule . index.php Allow from all Require all granted </Directory> <Directory "E:\phpStudy\WWW\yii2admin/backend/web"> RewriteEngine on # 如果一个目录或一个文件存在,请直接使用请求 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # 否则去请求 index.php RewriteRule . index.php Allow from all Require all granted </Directory> <Directory "E:\phpStudy\WWW\yii2admin/storage/web"> RewriteEngine on # 如果一个目录或一个文件存在,请直接使用请求 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # 否则去请求 index.php RewriteRule . index.php Allow from all Require all granted </Directory> <FilesMatch \.(env|htaccess|htpasswd|svn|git)> Require all denied </FilesMatch>
HOSTS里面解析:127.0.0.1 local.yii2admin.com
现在访问:http://local.yii2admin.com/或http://local.yii2admin.com/admin报错:Forbidden
You don't have permission to access /admin on this server.
新手不懂哪里错了,希望作者指点一二
你的这个目录禁止访问,你的apache里面配置的域名怎么配置的?