有没有关于快速 PHP 重构的工具或技巧?

发布于 2024-11-04 21:58:47 字数 319 浏览 2 评论 0原文

我们当前的“内部”新闻通讯系统只是 PHPlist,上面贴有公司徽标。我的任务是向其中添加各种功能,但 PHPlist 的代码是单一的,很难分解。我想首先将其分解为更易于管理的部分,但我最终的目标是使用 CodeIgniter 和 ExtJS 从头开始​​重写整个 UI 和逻辑,仅保持与 PHPlist 的数据库兼容性。

我只能说“管它呢”,完全从头开始编写一个新系统,但我想尽可能多地保留原来的 PHPlist 行为,因此,我要做的第一步是了解 PHPlist 的所有功能在哪里PHPlist 首先被埋葬,并且潜入数十个文件,其中包含数百行至数千行未注释的 PHP,而且没有明显的结构,这并不有趣。 :(

Our current "in-house" newsletter system is just PHPlist with the company logo slapped on it. I am given the task of adding various features into it, but the code of PHPlist is just monolithic and hard to break down. I would like to break it down to more manageable pieces first, but what I aim to do ultimately is to rewrite the whole UI and logic from scratch with CodeIgniter and ExtJS, keeping only database compatibility with PHPlist.

I can just say "screw it" and write a new system completely from scratch, but I would like to keep as much of the original PHPlist behaviour as possible, therefore, the first step I have to do is to understand where all the features of PHPlist are buried first, and diving dozens of files with hundreds to thousands lines of uncommented PHP with no apparant structure is not fun. :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

埋情葬爱 2024-11-11 21:58:48

如果它只是内部的,您是否考虑过其他选项,可能会节省您的时间和金钱,

例如 MailChimp.com
最多可存储 2,000 个订阅者。每月最多发送 12,000 封电子邮件。没有过期的试用版。没有合同。无需信用卡。

if its just internal have you looked at other options, may save you time and money

Eg MailChimp.com
Store up to 2,000 subscribers. Send up to 12,000 emails per month. No expiring trials. No contracts. No credit card required.

望喜 2024-11-11 21:58:47

我的直觉反应是,如果代码那么糟糕,那么你应该把它扔掉。通常,最好的方法是使用一次写入、永不读取的代码。

在此之前:

  • 与用户交谈,了解他们使用的功能
  • 编写规范,并让他们签字
  • 实施新系统,当人们说“我曾经能够”时,在他们面前挥舞签字的报告做 XXX'

如果有任何方法可以让业务人员明白这一点,请告诉他们 RSS 和 ATOM 比群发邮件远远要好。

My gut reaction is that if the code is that bad, then you should just bin it. Often the best approach with write-once-read-never code.

Before you do:

  • Talk to the users, and find out what functionality they use
  • Write a spec, and get them to sign off
  • Implement the new system, and wave the signed-off report in peoples faces when they say 'I used to be able to do XXX'

And if there's any way you can get it across to the business, tell them RSS and ATOM is far better than bulkmail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文