poetbi / boaphp Goto Github PK
View Code? Open in Web Editor NEWboaPHP是一款免费开源、灵活易用的配置式PHP框架,MVC设计模式,完全面向对象,易学易用、便于快速开发
License: Apache License 2.0
boaPHP是一款免费开源、灵活易用的配置式PHP框架,MVC设计模式,完全面向对象,易学易用、便于快速开发
License: Apache License 2.0
127.0.0.1_84\var\www\cache
用多了就会缓存文件很多,有没有处理好的方法
使用这个一键启动,是存在隐患的, 线程超过500 时 php-cgi.exe进程就会关闭
拖拽上传500个文件一会几十秒就出现了,PHP文件再访问报502错误。
这是因为启动PHP的时候是以单线程创建的
应该使用xxfpm.exe或其他插件来进行保护它,当使用PHP程序时,会自动创建多个进程
https://www.123pan.com/s/fbjTjv-0Tu3v.html
以下为保护代码
`@echo off
%boa%hidec %boa%bin/xxfpm.exe "%boa%%PHP_HOME%/php-cgi.exe -c %boa%%PHP_HOME%/php.ini" -n 8 -i 127.0.0.1 -p 9000
我有一组要批量插入mysql的数据
$userAgent = $_SERVER['HTTP_USER_AGENT'];
不知道boa::db()这个能不能在遍历里面使用,如果数据过多,可能单次有100条,会不会卡死
所以我采用了MYSQL的批量写法:
$sql = "insert into browser
(name
,sex
,userAgent
) values ('张三','男','{$userAgent}'),('李四','女','{$userAgent}'),('王五','男','{$userAgent}')";
boa::db()->execute($sql);
现在的问题是
1、不知道 PHP获取的这个 $userAgent 这个是否安全,网上查的说是可以伪造;
2、execute 这个方法有没有字符安全处理;
3、框架中是否有批量插入的办法;
我是个新手,我设置了
'DATABASE' => [
'host' => '127.0.0.1' ,
'user' => 'root' ,
'pass' => '123456' ,
'name' => 'shop'
]
居然错误的配置,,
必须要带上两个参数
'DATABASE' => [
'host' => '192.168.31.251' ,
'user' => 'root' ,
'pass' => '123456' ,
'name' => 'shop',
'prefix' => '',
'charset' => 'utf8',
],
配上'prefix' => '', 'charset' => 'utf8' 才正常
这个应该做到第一种配置就能用才好吧。
默认上传路径为
BS_WWW .'file/'
上传后根据年/月/日来生成文件夹并保存到目录中
1、提交过来的图片是jpg格式,为什么保存后的后缀名是PNG呢?应该是上传文件是jpg就附带jpg,是zip就附带zip的后缀名
2、自定义名字后,文件居然保存到 BS_WWW .'file/' 根目录了,没有年月日的文件夹了,既然没有配置生成目录就应该依照默认生成路径规则呀
3、自定义名字后,文件的后缀名丢失,这里应该自定义的是文件名名称,后缀名还要调用处理就太麻烦了,。
我知道 验证器代码解构是这样的
目录
mod\home\validater\checker.php
增加代码
public function is_date($v){
return $res ? 0 : 947;
}
947错误提示文字报错了,这个947识别文字加到哪里?
mod\home\language***.php
这个目录下方的文件和代码解构是什么?
这个怎么用呢?
如我的请求为 :
创建用户
home/user/add
编辑用户
home/user/set
那么我就要在
variable文件夹中建立两个文件
/user/add.php
/user/set.php
这两个都对username的账号进行自动验证,这样就有了很多的重复代码
那么能不能有一个通用的
比如在variable/user/ 建立一个 index.php或者 common.php写一个验证规则,这两个动作都能生效呢?
比如我上传了一个MP4,需要PHP来进行转码?读取文件的缩略图。
之前 $this->user 被占用了验证
后面传递了一个user的参数
我使用$this->request->v('user') 来接收,结果还是$this->user的信息呢
我使用
$this->request = boa::request();
echo $this->request->v('user');
仍然还是$this->user的数据 这里应该怎么用呢,是我理解的不对吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.