Cleaning up File Structure of CWIS folder

3 posts / 0 new
Last post
Cleaning up File Structure of CWIS folder

I've been running CWIS for a long time and have migrated across many updates. As I was installing the latest version, I noted a much cleaner looking base install than what I see in mine. I see a lot of SPT--XXXXX.php files and Axis--XXXX.php files in the root directory for my app for instance, but not in the clean install folder. Can and should I be cleaning this up, and if so, how might I go about spring cleaning without breaking a working site?

Re: Cleaning up File Structure of CWIS folder

In recent versions of the software, the only two PHP files in the root directory of the installation are index.php and installcwis.php, and the later is (not surprisingly) only used during install.  However if you're using the BackwardCompatibility plugin, it will also create several zero-length PHP files in the root directory, if they're not already present, to try to preserve compatibility with old interface files.

The old files hanging around shouldn't hurt anything, but if it were me, I would want to get things cleaned up, if for no other reason than future compatibility.  In the upcoming 3.9.0 beta release (and the 4.0.0 production release to eventually follow), some of the existing backward compatibility measures have been dropped, both to make the software easier to maintain and customize, and to support new functionality and improve performance.

In newer versions of the software, all of the data specific to the site (logs, uploaded files, etc) and all customized HTML, CSS, PHP, and JS files live under the local directory -- custom interfaces are now stored in local/interface, uploaded images are stored in local/data/images, uploaded files stored in local/data/files, etc -- so once you're running in that mode, you can upgrade to a new version of the software with a completely clean tree just by installing the new version and then moving the local directory into the root directory of the new install. are the steps I would take, testing after each step to make sure nothing is broken:

  1. Back up the site.
  2. Enable the BackwardCompatibility plugin.
  3. Move config.php from the root directory into local (if it's not already in local).
  4. Remove all of the PHP files in the root directory except for index.php and installcwis.php.
  5. Move any custom interface directories into local/interface.
  6. Move any files in FileStorage into local/data/files.
  7. Move any files in ImageStorage/Previews into local/data/images/previews.
  8. Move any files in ImageStorage/Thumbnails into local/data/images/thumbnails.
  9. Move any image files in ImageStorage into local/data/images.

Whether any problems arise during this will depend mostly on how much custom code you have in the site and what version of CWIS that code was written for and/or the site originally started with.  In any event, if you dig into this and run into any issues, please post details and we'll see what we can do to help resolve them.

Re: Cleaning up File Structure of CWIS folder

Thank you Ed, for this clear and prompt response. You've been a good shepherd of this project over many years. I'm going to give this a try and I'll report back if I run into any snags during my spring cleaning.

OERs Rock