How to verify that all files are intact prior to install?

Posted by Kalle H. Väravas on Programmers See other posts from Programmers or by Kalle H. Väravas
Published on 2012-07-04T00:43:35Z Indexed on 2012/07/04 3:22 UTC
Read the original article Hit count: 254

I'm working on my CMS (in PHP platform) for a long time now. The main program is done and I'm currently developing the Installer part. Installation itself will be fairly simple:

  1. Upload all files
  2. Verify that the "content/" dir has correct permissions
  3. Check if ALL files are intact and not modified [This is the subject of this question]
  4. Insert the config data and first settings
  5. Run install (Generate all DB tables and insert sample data etc.)

Now the question-mark is at step 3. How do I verify ALL files? Verification itself should compare all CMS root-directories files against a list from remote location. List should contain filename, filesize and filetype. This way the user can check, that there are no unnecessary or corrupted files, that could indicated a breach in the software.

I have seen some software installers do that, but I cannot find any right now and there for I'm clueless on the most optimal method for this. Of course there always is a simple array trick, but there surely must be a better and faster method?!

© Programmers or respective owner

Related posts about php

Related posts about installer