We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22815
    • 1,097 Posts
    Would this work, and would this help?

    We write a routine that checks the filesize of *every* file in a MODx install, and saves out a list.
    This list is then bundled with the MODx installer.
    At some point in the install, a routine runs that checks the filesizes of the files that have been uploaded against that list, and warns the user about anything that has uploaded as 0kb or hasn’t uploaded at all.

    I think this would save a lot of hassle on the forums.

    I don’t know how exactly we’d go about doing this; I suspect that there must be existing facilities out there.
      No, I don't know what OpenGeek's saying half the time either.
      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
      Forum: Where to post threads about add-ons | Forum Rules
      Like MODx? donate (and/or share your resources)
      Like me? See my Amazon wishlist
      MODx "Most Promising CMS" - so appropriate!
      • 13577
      • 302 Posts
      Mostly thinking out loud.... so take it for what it’s worth.

      I think this is a good idea.

      It might be easier to have a list of the files requied, and check to be sure they’re > 0 (rather than an exact file size). I know it wouldn’t be quite as "tight" of a validation, but it would catch most cases and it would seem to be much easier than having to redo parts of the list every time someone made a minor change to one file.

      Or - even easier, might be to write a little PHP script to traverse the file tree and count the files (and count any that have size == 0). Then we don’t even specifically need to know what the files are - only that there are X number of them and there should be Y.
        Standard Disclaimer
        I could be totally wrong.
        • 25663 MODX Staff
        • 12,272 Posts
        Then there is the checksum idea...
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 22815
          • 1,097 Posts
          The problem with a count, and with some checksum methods, is that they don’t account for the times when there are perfectly harmless old files in a directory. Like when someone upgrades from 0.9.2.1 to 0.9.5 - what matters is that the 0.9.5 files are there, and a simple count (or a checksum method not based on specified individual files) would find 0.9.2.1 or add-in pages, thus skewing the results.

          I do like the > 0 check idea, which could give a different warning to the "not right size" one. I would not recommend making either of these prevent the install from continuing but rather appear as a warning. That way it only needs updating on actual releases, rather than on each SVN version.

          I’ve seen checksum programs for desktops, but I’ve not seen one working as part of a PHP-based install checking the extracted & uploaded files. And my initial searches have only turned up MD5s of archives - which isn’t what I mean.
            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!