dongzhilian0188 2013-03-04 02:16
浏览 62
已采纳

我可以使用PEAR在Web应用程序中包含模块吗?

I am creating a web app in LAMP. It was a while since I last created anything in PHP and back then I wasn't familiar with things like package managing and version control. I'm going to use MySQL in my app so I found the abstraction layer module MDB2 in PEAR.

My previous experiences tell me that I should be able to fetch the module to a lib/ subdirectory in my development repo, so that it will be present with every clone of the repo. But PEAR installs to /usr/share/php.

Can I make PEAR fetch to my development repo?

Or am I taking the wrong approach? My base problem is how to include a PHP module in the app that I'm creating.

  • 写回答

1条回答 默认 最新

  • dongmu7335 2013-03-04 08:53
    关注

    You can configure PEAR to install into any directory you want, with a custom configuration file:

    $ pear config-create lib pear.cfg
    

    Now you need to tell the pear installer to use the config file:

    $ pear -c pear.cfg install mdb2
    

    That's all.


    Btw, I recommend to use PDO as database layer if you don't need deep abstraction.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改