惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - x3d

deepin 23 一个可用 mysql-workbench 版本 8.0.36 基于 Maxwell 实现 MySQL 数据实时迁移到 Mongodb 本地开发环境 通过Podman 手动从头搭建 Ubuntu 容器镜像 intel ax203/ax201 无线网卡驱动 firmware 居然有问题 Direct firmware load for iwlwifi-bz-b0-hr-b0-94.ucode failed with error -2 在安卓平板上搭建 webdav 服务 近期不要选aliyun cloud linux 镜像 一点 PHP 中优雅的将JSON/XML/YAML 等数据反序列化成指定的类对象 开始收割了 PHP Composer 虚拟依赖包 - 实现按需载入钉钉对应功能模块的 php sdk 盘点之原地踏步三 盘点之原地踏步二 盘点之原地踏步一:weui 的一点探索 apijson 初探 Apache Synapse ESB erupt api 《超文本和超链接》的时间线整理 MEAF框架概念检索工具 现代企业架构框架MEAF初次解读
Think3 ORM
x3d · 2022-06-04 · via 博客园 - x3d

4月30日,手痒,从老的TP 3.2 框架中,剥离了ORM的部分,发布了一个 composer 项目。

安装方式:

composer require x3d/think3-orm

还参照最新的 tp6 中的 think-orm 做了简单的phpunit测试,见 tests/HelloTest.php 文件。

这样的项目,有何价值呢?对个人而已,有二:假定某些遗留项目可以使用该库得到一些曾经的让开发者比较爽的新能力,拆分出来后引用副作用更少;Nodejs的 NPM社区所提倡的 package 化的印象的实践。

其中大概涉及到的一些点:

Db 、Storage、Cache、Log引擎,需要有各种框架的适配器及默认的Think3版本的适配器;

要解决的问题

  1. [x]C函数;及里面的配置项
    1. [x]DB_PREFIX;
    2. [x]DB_FIELDS_CACHE
    3. []READ_DATA_MAP
    4. []TOKEN_ON;
    5. []TOKEN_NAME
    6. []TOKEN_RESET;
    7. [x]DEFAULT_M_LAYER;
    8. [x]VAR_AUTO_STRING
    9. [x]URL_PATHINFO_DEPR
    10. [x]DEFAULT_FILTER
  2. [x]F 函数;
  3. [x]parse_name 函数
  4. [x]E;没必要封装,造成代码的错误定位环节会更低效;
  5. [x]L,及相关的定义内容;
    1. []OPERATION_WRONG
    2. []DATA_TYPE_INVALID
    3. []METHOD_NOT_EXIST
    4. []TOKEN_ERROR
    5. []CACHE_TYPE_INVALID
    6. []NO_DB_DRIVER
    7. []EXPRESS_ERROR
    8. []STORAGE_WRITE_ERROR
  6. [x]S 函数
  7. [x]xml_encode
  8. [x]APP_DEBUG 常量;
  9. [x]NOW_TIME 常量;
  10. [x]I 函数;
  11. [x]MAGIC_QUOTES_GPC 常量;
  12. [x]get_client_ip 函数;
  13. [x]Db 类
    1. []G
    2. []trace
    3. []N
    4. []ns
  14. []Think\Log 类
  15. [x]Think\Cache;
    1. []
  16. [x]DATA_PATH 常量
  17. [x]TEMP_PATH 常量;
  18. []Think\Storage;

函数库中的依赖

  1. []MODULE_NAME;应该改为 函数或方法调用;动态返回,就可以做小动作;