Codeigniter共享资源-征求意见 [英] Codeigniter Shared Resources - Opinions Wanted
问题描述
我在服务器上运行了多个网站,这些网站全部都安装了CodeIgniter(单独的应用程序目录和单个系统目录)。
我发现自己一直在编写库类来扩展/覆盖CI。
很多时候,如果我发现错误或提高效率,就不得不回到几个网站进行相同的调整,以免出现错别字而破坏其中一个网站的风险。因此,这要求我更改每个文件,然后测试该站点的错误。
我一直在考虑在中央位置使用单个库目录的解决方案,将我所有的网站符号链接到该中央目录。然后,当我进行文件更改时,它将立即传播到所有下游网站。仍然需要我对每个错误进行测试,但不必多次进行更改。单个网站特有的任何内容都可以是非共享文件(仍在链接目录中,只是在其他地方不使用),也可以放在本地帮助程序中。
此外,我还按CI版本保留了单独的系统目录,因此我可以在需要时独立迁移网站-该中央库文件将附加到特定版本,以减少可能的中断。
有人通过这种方法看到潜在的问题或陷阱吗?有人在我应该考虑的另一个方向上做到了吗?
预先感谢!
我认为这实际上是有道理的:]去吧。即使在官方CodeIgniter页面上,他们也提到有可能。
此外,我看不出应该有任何问题的原因。
编辑:这里涉及到多个站点的问题: http:// codeigniter.com/user_guide/general/managing_apps.html
还:
http://codeigniter.com/wiki/Multiple_Applications/
< br> http://www.exclusivetutorials.com/ setting-multiple-websites-in-codeigniter-installation /
如何在CodeIgniter中处理多个项目?
http://codeigniter.com/forums/viewthread/56436/
I run multiple websites all running off of a single installation of CodeIgniter on my server (separate application directories and a single system directory). This has been working fabulously and I don't see any reason to change it at this point.
I find myself writing library classes to extend/override CI all of the time and many times if I find a bug or improve effeciency I have to go back to several websites to make the same adjustments at risk of a typo that breaks one of the websites. Because of this it requires that I change each file and then test that site for bugs.
I have been pondering a solution of using a single libraries directory in a central location and symlinking all of my websites to that central directory. Then when I make a file change it will immediately propagate to all of the downstream websites. It will still require that I test each one for errors, but I won't have to make the changes multiple times. Anything that is specific to a single website will either be a non-shared file (still in the linked directory just not used elsewhere) or can be put in a local helper.
Also, I keep separate 'system' directories by CI version so I can migrate my websites independently if necessary--this central libraries file would be attached to a specific version to reduce possible breaks.
Does anyone see potential issues or pitfalls from taking this approach? Has anyone accomplished this in another direction that I should consider?
Thanks in advance!
I think this actually makes sense :] Go for it. Even on official CodeIgniter page, they mention it's possible.
Also, I don't see one reason why there should be any problem.
Edit: they touch the problem of multiple sites here: http://codeigniter.com/user_guide/general/managing_apps.html
also:
http://codeigniter.com/wiki/Multiple_Applications/
http://www.exclusivetutorials.com/setting-multiple-websites-in-codeigniter-installation/
How to Handle Multiple Projects in CodeIgniter?
http://codeigniter.com/forums/viewthread/56436/
这篇关于Codeigniter共享资源-征求意见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!