How should PEAR libraries be incorporated as packages / libraries within PHP frameworks?
在PHP框架中,PEAR库应该如何作为包/库合并?
Namely, I'm using a package system within a PHP framework - and need those PEAR libraries to be easily redistributable (I'm referring specifically to CodeIgniter's package manager, Sparks) to other users. Would it be better to couple the needed PEAR libraries and their dependencies within the package itself, or to instead do a check when the package is initialized (ie constructor, init, factory, whatever called) and prompt (along with download instructions) that that user install the necessary dependencies?
也就是说,我在PHP框架中使用了一个包系统——并且需要这些PEAR库能够轻松地重新分配给其他用户(我特别指的是CodeIgniter的包管理器Sparks)。最好是将所需的PEAR库及其依赖项结合到包本身中,还是在包初始化时检查一下(即构造函数、init、工厂,无论调用什么),并提示用户安装必要的依赖项(以及下载说明)?
The latter option may not work for some users who lack either the necessary permissions (ie shared hosting?) or the necessary technical knowledge (don't laugh, I'm serious) to install PEAR libraries, ie framework users, not programmers / system admins.
对于那些既没有必要的权限(比如共享主机?)也没有必要的技术知识(别笑,我是认真的)来安装PEAR库的用户,ie框架用户,而不是程序员/系统管理员,后者可能不适用。
Coupling opens the risk of code duplication within a project, even if it greatly simplifies making the package "just work". What route would YOU take?
耦合打开了项目中代码重复的风险,即使它极大地简化了使包“只工作”的过程。你要走哪条路?
1 个解决方案
#1
3
Use Pyrus, the next-gen pear installer and follow the instructions in Using Pyrus To Manage PEAR Installable Vendor Libs.
使用Pyrus,下一代pear安装程序,并按照使用Pyrus管理pear可安装供应商Libs的说明进行安装。
#1
3
Use Pyrus, the next-gen pear installer and follow the instructions in Using Pyrus To Manage PEAR Installable Vendor Libs.
使用Pyrus,下一代pear安装程序,并按照使用Pyrus管理pear可安装供应商Libs的说明进行安装。