ScriptRefactoring

From LiluxWiki

Suggested improvements:

  • Implement function to send e-mail to different persons, when new user does a registration.
 So, the cashier looks up if payment is done and could write an approvement email to that new member.
  • Use DB.php rather than PHP's builtin DB functions. Advantages are:
    • Same interface no matter what database (useful if we ever want to change to postgresql or some other DB)
    • Safer (supports wildcard parameters even on databases such as mysql which don't have them themselves)
  • Structure code in functions, objects and methods where possible. Add comments (!).
  • Use errorreporting (EERROR | EWARNING | EPARSE | E_NOTICE);

Suggested way to proceed:

  • As this is a background tasks for which we don't want to take away too much time from other tasks, it should be done stepwise: when intervening in the code for some other reason, consider cleaning up and refactoring these parts. Fortunately, DB.php code and old code may be mixed, making the transition easier.