重大发现Discuz DB层跨库映射关系表名前缀BUG,discuz关系表
重大发现Discuz DB层跨库映射关系表名前缀BUG,discuz关系表
场景:
在Discuz中创建Table模型,但该Table所在库与Discuz不在同一个库。
Discuz好像是在3之后提供跨库映射的机制。
映射没问题,主要是发现表名前缀没有相应的映射过来。当然,其实也不算bug。因为他只考虑discuz自己的系统,一般来说,表名前缀是相同的。
在db驱动类里,db_driver_mysql(i):
function table_name中追加代码
<span>if</span>(!<span>empty</span>(<span>$this</span>->config[<span>$id</span>]['tablepre'<span>])){ </span><span>$this</span>->tablepre = <span>$this</span>->config[<span>$id</span>]['tablepre'<span>]; }</span>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
