06 2021 档案
摘要:建议都使用绝对路径,以puclic下的uploads目录为例 先在index.php入口文件定义 public目录 define('PUBLIC_PATH', __DIR__); //public 目录 测试文件路径: $url = '/uploads/serImg/20210629/41a04dc
阅读全文
摘要:先安装 composer require jaeger/querylist 完成后会有jaeger文件 网页布局图 1.单属性查询 use QL\QueryList; public function test() { $url = 'https://www.ivsky.com/tupian/wupi
阅读全文
摘要:首先封装一个 CURL 方法,可以不用理解代码 class MyCurl extends Base { /** * http请求 * * @param $url //请求地址 * @param $params //链接后拼接的参数数组 * @param $method //get/post * @p
阅读全文
摘要:封装一个方法 //写日志 public function logs($msg,$type='info') { Log::init([ 'type' => 'File', 'path' => Env::get('root_path') .'logs', //自定义路径 ]); Log::write($
阅读全文
摘要:unlinik() 里面的路径使用绝对路径首先查看command目录下Test的路径 __DIR__ 为当前文件目录 执行即可删除 unlink(__DIR__.'/../../public/uploads/proImg/20210622/文件名.jpg');
阅读全文
摘要:1.在Tp5项目中,执行 命令生成command文件和test方法 (服务器中记得设置该文件权限www 750) php think make:command Test (或者手动创建) use think\console\Command; use think\console\Input; use
阅读全文
摘要:目前有点小bug,一些被压缩图片会无法压缩, 比例建议不更改使用0.5 首先在extend目录下创建compress文件夹,创建封装类CompressImg.php namespace compress; use think\Controller; class CompressImg extends
阅读全文