Kessler Posted October 12, 2011 Posted October 12, 2011 File Name: Clean Up On Aisle 3File Submitter: KesslerFile Submitted: 12 Oct 2011File Updated: 12 Oct 2011File Category: Generic ToolsClean Up On Aisle 3 Very simple, is made to run in your forums root folder to clear out older files/folders from IPB 1.x and 2.x installs. THIS SCRIPT IS NOT TESTED! PLEASE DO NOT RUN IT ON A LIVE SITE! THERE IS NO IPS SUPPORT FOR THIS IF YOU RUN IT AND IT CAUSES PROBLEMS!IMPORTANT If you run it, I recommend running it on a backup copy of your community. This is more for people who are comfortable examining the code and like to test out things for the fun of it. This does NOT check to make sure you are running IPB 3.x, it simply attempted to delete some of the known IPB 1.x/2.x related files and folders. Please report issues in the support topic. If you know how to alter/update scripts and you find a way to improve this script, please let me know so I can include it in a future version. I repeat, use this at your OWN risk. You have been warned.Click here to download this file
Martin A. Posted October 12, 2011 Posted October 12, 2011 Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /Applications/MAMP/htdocs/*/cleanuponaisle3.php on line 82echo "<tr><td>{$name}</td>" if ( file_exists( $name ) )
Kessler Posted October 13, 2011 Author Posted October 13, 2011 Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /Applications/MAMP/htdocs/*/cleanuponaisle3.php on line 82echo "<tr><td>{$name}</td>" if ( file_exists( $name ) ) Fixed. Kessler, you didn't even run it? It's untested.
Marcher Technologies Posted October 13, 2011 Posted October 13, 2011 Viably, this script should do gloriously nothing on a board that started life as 3.x install, correct? What I am looking to test for you ;)
Kessler Posted October 13, 2011 Author Posted October 13, 2011 Viably, this script should do gloriously nothing on a board that started life as 3.x install, correct? What I am looking to test for you :wink: It *should* basically run and display a table with a header and no contents underneath. The purpose of it is to do nothing more than to delete files and folders that were used in previous versions but not in the current version. I do appreciate the testing, as getting it to work and there being no damage to other files would help benefit others who want something simple to do the work for them.
Cheshire Cat Posted October 13, 2011 Posted October 13, 2011 Interesting and will help people running old versions as many forums are.
• Jay • Posted October 13, 2011 Posted October 13, 2011 It *should* basically run and display a table with a header and no contents underneath. The purpose of it is to do nothing more than to delete files and folders that were used in previous versions but not in the current version. I do appreciate the testing, as getting it to work and there being no damage to other files would help benefit others who want something simple to do the work for them. Did you use a file comparison tool to tell which files/directories were not in the version your script removes extraneous files for, or was it made by comparing the upload packages manually? Will this also affect add-ons that require files to be uploaded outside of /admin/application_addon? Some add-ons require files to be uploaded to /public/js (or other directories). Will files such as those be deleted?
3DKiwi Posted October 13, 2011 Posted October 13, 2011 I would prefer it if it just gave me a list of files and folders that I could print out. I could then decided whether to remove or not. Personally what I have done to keep reasonably clean is run the version checker utility in the ACP. 3DKiwi
Martin A. Posted October 13, 2011 Posted October 13, 2011 Did you use a file comparison tool to tell which files/directories were not in the version your script removes extraneous files for, or was it made by comparing the upload packages manually? Will this also affect add-ons that require files to be uploaded outside of /admin/application_addon? Some add-ons require files to be uploaded to /public/js (or other directories). Will files such as those be deleted? It will look for a set of folders in the root folder that were in the older version that are no longer with us, and delete those (sources, style_captcha, setup, archive_in, skin_acp, Lang, Skin etc). It should not touch other folders, like /admin/ or /public/.
• Jay • Posted October 13, 2011 Posted October 13, 2011 It will look for a set of folders in the root folder that were in the older version that are no longer with us, and delete those (sources, style_captcha, setup, archive_in, skin_acp, Lang, Skin etc). It should not touch other folders, like /admin/ or /public/. Thanks for the response. :) Could this also delete current skin and language packs?
Kessler Posted October 13, 2011 Author Posted October 13, 2011 Could this also delete current skin and language packs? The sole purpose is to clean up past files, not current files. If someone wants to take this script and develop it into a larger and more involved one, perhaps keeping track of files that have been used and aren't used anymore, then they're welcome to it.
• Jay • Posted October 13, 2011 Posted October 13, 2011 The sole purpose is to clean up past files, not current files. If someone wants to take this script and develop it into a larger and more involved one, perhaps keeping track of files that have been used and aren't used anymore, then they're welcome to it. I just didn't know whether it deleted older version third-party skins/languages, and if so, whether it knew the difference between older skins/languages and current ones. It was not a criticism by any means, I appreciate what you're doing with this. :)
Kessler Posted October 13, 2011 Author Posted October 13, 2011 It was not a criticism by any means, I appreciate what you're doing with this. :smile: Wasn't taking it as criticism. A tool that can correctly determine which existing files are no longer needed, based on the current version of the board, would be great. The version checker in the ACP is useful to a degree, but can't really tell you which files are safe to delete, only which files don't match the current version. A mismatched version could mean that some files need to be reuploaded. To put it simply, for this small script, it's only supposed to go after files and folders that are definitely safe to remove, with those being located at the root of the board. K.I.S.S. - Keep It Short and Simple.
Scape Posted October 15, 2011 Posted October 15, 2011 This mod is something I really hope works properly, but one wish if its not in already or if its possible, the ability to just create a text file with the list of whatever this script has found, so that if one so desires can double check the files manually but still get a pretty good idea of what and how many files are obsolete. I have a board that has been upgraded all the way back since version 1 with probably thousands of outdated files.
Kessler Posted October 15, 2011 Author Posted October 15, 2011 I'm actually mentally toying with the idea of a script that would keep track of what files are obsolete or still in use. The biggest obstacle is in creating a way to easily keep track of changes from one version to another. Once that's figured out, I can try to sell the idea off to someone who develops mods to see if they'd be willing to write it. I have a few ideas in mind and if it works out, there could be a tool that someone could run that would already know which files are safe to remove from no longer being in use. Still tinkering with it in my head for now though.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.