Dreamweaver and detecting orphan files


#1

I have a site that I'm building using HTML, CSS, JS, and PHP. The site has a large number of photo albums on it. I'm building the photo albums dynamically using PHP such that all I need do is add files to the file system and they appear on the site. This is great from a programming stand point as once the site is live, I "set it and forget it.," as Ron Popeil would say.

The problem is that Dreamweaver can't parse the script and tell me which images are orphans. Is there any PHP IDE that can?


#2

Which images do you define as "orphan" if you build the gallery from all images available within the filesystem?


#3

An orphan file is a file that is in the site directory that is not referenced by the code and can be removed from the file system without breaking the site.


#4

If this is the case you should not have any orphaned files unless they are outside your folder structure?

I assume you are using glob() to select the files?


#5

I'm guessing that what is happening is you have two versions of the folder:

  • the "live" folder that has no orphans as all of the files in the folder are being put into a page.
  • the "local" folder that DW is using

If so, I think you will need to "synch" or "diff" the two folders


#6

https://helpx.adobe.com/dreamweaver/using/cloaking-files-folders-dreamweaver-site.html


#7

Unfortunately you guys are way off. It's not a matter of syncing folders. It's about removing files that are not used that will waste space on my VPS. I originally downloaded a web template and customized it heavily using PHP. I used glob() to find files for slideshows. I also use glob() to create other links as well. During development, I reorganized the file structure and ended up duplicating some files. I also created test files to play with code. I've removed the duplicate files and test code as well.

DW does a good job identifying orphan files, but when it comes to links created with glob() or other server side code, DW doesn't know that those files are actually being linked and reports them as orphan. I need a program that can look at the site after being run on the server and determine what files are actually being linked so it can report accurately. DW only looks for HTML links and not links created with server side script.


#8

I'm confused. You are using server-side glob() to create photo album pages. Whatever files glob finds will be used and will therefore not be orphans. You say that DW does well at identifying orphans not used by an HTML page but not at identifying orphans in a PHP glob script. Is there no way to have DW use the resulting HTML photo album pages instead of the script file?


#9

As far as I know, DW looks at the code but does not parse the PHP. Maybe I am wrong about this, but it's telling me that all my photo gallery images are orphans when I know they are not. maybe I should be posting in the adobe forums for help with DW.


#10

My guess is that DW doesn't do glob() or understand the regex it uses. Maybe if you assign the found files to a temporary array DW would use that? Not the best idea in terms of memory use, but if DW can't work with the HTML files the script outputs it might be a work-around.


#11

I ended up creating a new site in DW and using the broken links feature to move in only the files that I needed. I then manually inspected the code and added photo files as needed. After that, I popped the site into IIS and used a program called XENU link sluth to parse the site and look for broken links. when none were found, I was ready to move forward.


#12

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.