架构:多个网站。一个代码库。自定义代码
好的。我目前正在构建一个 php 应用程序(平台),该应用程序将被部署多次,只是使用不同的配置。该应用程序由后端和前端组成。通过后端,我们可以配置哪些模块处于活动状态、设置是什么以及平台的外观。
我们预计客户将开始要求其平台上的特定功能。这意味着该平台将与其他平台不同。但是,我们维护一个代码库。
解决这个问题的最佳方法是什么?由于我们不断修复错误并开发新功能,因此应该很容易照顾所有平台。我们有一个脚本,用于将平台更新部署到所有平台。
我们是否应该将所有功能转换为插件,以便每个平台都可以根据需要手动更新?因此,如果客户想要与原始插件不同的东西,我们复制该插件并创建他们自己的客户插件?但是,如果我们决定更新插件,代码是否容易维护?
或者我们应该在代码中为每个客户编写异常吗?
我们是否应该有单独的文件来使用自定义代码覆盖每个平台的基本文件?
最好的方法是什么?
Okay. I am currently building an php application (platform) which will be deployed multiple times, only with different configurations. The application consists of a backend and frontend. Through the backend, we are able to configure which modules are active, what there settings are and how the platform looks like.
We expect that customers will start asking for specific functionality on their platform. This means that there platform will be different then the other ones. But, we maintain one codebase.
What's the best way to solve this? Since we keep on fixing bugs and developing new features, it should be easy to take care of all the platforms. We have a script which we use to deploy our platform updates to all our platforms.
Should we convert all our functionality into plugins so every platform can be updated manually if they want? So if a customer wants something differently then the original plugin, we duplicate the plugin and create their own customer-plugin? But is the code easily to maintain then if we ever decide to update the plugin?
Or should we write exceptions in the code for every customer?
Should we have separate files which override the base files for every platform with custom code?
What's the best way to go?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最大的技巧是平衡客户的不同需求,而不会最终导致无法维护的极其复杂的系统。您应该考虑以下几种方法:
:最后,如果您还不了解它们,您可以使用或简单地借用一些现有的 PHP 框架 - PHP 开源社区相当强大。查看 Zend 框架。
The big trick will be balancing the diverging needs of customers without ending up with a massively complex system that is impossible to maintain. Here's a few approaches you should consider:
Edit: Finally, if you're not already aware of them, there are existing PHP frameworks that you might be able to use or simply borrow approaches from - the PHP Open Source community is fairly strong. Check out the Zend Framework.