doule0941 2008-10-21 22:32
浏览 36
已采纳

是否可以在不使用整个框架的情况下在PHP中为ORM安装Kohana库?

In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files?

Update:

I jumped in and started looking at the ORM source code.. One thing was immediately confusing to me.. all the ORM classes have the class name appended with _CORE i.e. ORM_Core ORM_Iterator_Core, but the code everywhere is extending the ORM class. Problem is, I've searched the whole code base 6 different ways, and I've never seen a plain ORM class def nor an ORM interface def or anything.. Could someone enlighten me on where that magic happens?

  • 写回答

4条回答 默认 最新

  • donglei1699 2008-10-22 06:28
    关注

    Why not just have a

    class ORM extends ORM_Core {} 
    

    somewhere in your code? This removes the need to use any of the loader code.

    You'll also need Kohana_Exception, the Database library (and appropraite driver), Kohana::config(), Kohana::auto_load(), Kohana::log() methods (search Database.php for those).

    Kohana is a great MVC framework, but not really designed to be taken apart in chunks like that. You may want to also investigate Doctrine, another ORM for PHP (that IS designed to be stand-alone)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址