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

推荐订阅源

K
Kaspersky official blog
V
Visual Studio Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
博客园_首页
Recent Announcements
Recent Announcements
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Hacker News: Ask HN
Hacker News: Ask HN
S
Security Affairs
量子位
The Register - Security
The Register - Security
腾讯CDC
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
N
News and Events Feed by Topic
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
TaoSecurity Blog
TaoSecurity Blog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
H
Hacker News: Front Page
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
Know Your Adversary
Know Your Adversary
C
CXSECURITY Database RSS Feed - CXSecurity.com

博客园 - 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;应该改为 函数或方法调用;动态返回,就可以做小动作;