I want to make an existing script object oriented and convert it to a class or classes. It also was not written in a great fashion and needs to be cleaned up.
## Deliverables
Here is the original request from RAC about the attached software. (To install it, you just need to CHMOD 777 the folder)
I need to create a script that will help me figure out which images are no longer in use on my webserver. The concept is that I can choose a directory, and the script will scan through all files that end in (.html,.php,.css) and look for files that end in .[login to view URL]). It will then create some XML files based on the result. The form you would fill out to do this is below:
Page 1:
Generate report
<form>
Page Types to Scan: <input type="text" name="extensions" value=".txt,.html,.htm,.php, .css">
<br />
Images Types to Look For: <input type="text" name="ImageExtensions" value=".gif,.png,.jpg">
<br />
Start Scan Folder: <input type="text" name="scan directory" value="/users/home/web/">
<br />
Web Root: <input type="text" name="scan directory" value="/users/home/web/">
<br />
Base URL: <input type="text" name="scan directory" value="[http://www.somewhere.<wbr />com/][1]">
<br />
Include all Subdirectories: <input type="checkbox" name="SubDirs" value="Y">
<br />
<input type="submit">
</form>
When submitted, this would create 3 xml files. 1 that lists all images referenced from inside of a file, something like this:
FILE 1: Image Reference inside of Files
<image>
<name>[login to view URL]</name>
<size>1233</size>
<lastmodified>12/12/2008</<wbr />lastmodified>
<path>/users/home/web/images/<<wbr />/path>
<webpath>[http://www.somewhere.<wbr />com/images/][2]</webpath>
<file>[login to view URL]</file>
<filepath>/</filepath>
<fileurl>[http://www.somewhere.<wbr />com][1]</fileurl>
</image>
And then an XML file that details all the images found in the file system, like this:
File 2: Images in folders
<file>
<name>[login to view URL]</name>
<size>1233</size>
<lastmodified>12/12/2008</<wbr />lastmodified>
<path>/users/home/web/images/<<wbr />/path>
<webpath>[http://www.somewhere.<wbr />com/images/][2]</webpath>
</file>
And then an XML file that lists all the images that are on the server, but not referenced inside of a file
File 3: Images in Folders, that are NOT referenced inside of Files.
<file>
<name>[login to view URL]</name>
<size>1233</size>
<lastmodified>12/12/2008</<wbr />lastmodified>
<path>/users/home/web/images/<<wbr />/path>
<webpath>[http://www.somewhere.<wbr />com/images/][2]</webpath>
</file>