The README.txt for Beta3 lists a task we need some url/path rewriting. The issue is that the files being indexed are stored in paths somewhere in the filesystem but later on, to retrieve these files when they are part of a search result, a hypertext reference is needed with appropriate paths in the URL. The problem is that also filesystem and URL paths are quite similar they are not identical. That's why I was thinking of url/path rewriting. However, after digging deeper into the topic I came to the conclusion that files in attachments and files in directories need to be handled differently.

This task is dedicated to files in directories.

Files in directories are entirely outside Drupal control. They are uploaded or generated externally, not listed in the core "files" table, not listed in nodes and they cannot generally retrieved through standard Drupal functions. All filesystem paths and URLs are independent of the Drupal core installation.

The following items are to be implemented past Beta3:

  • Keep the directory path in the search_files_directories_directories table verbatim as the user inputs it. For relative paths that means to no longer prepend CWD at submission time.
  • Only list the relative filepath (needs to be renamed from path) in the search_files_directories_files table when traverse for indexing. That means to no longer list absolute paths.
  • The previous two items allow relocation of filesystems trees without re-indexing and give sense to the "Edit" path functionality.
  • Add a uripath counterpart to each filepath and create the links out of them. In other words, throw away the idea of url/path rewriting and replace it by simple prefix replacement.
  • Because the URI includes the scheme, download links like ftp:// could be created.
  • Use realpath() only immediately before getting fileinfo() and running external helpers. This allows data relocation through symlinking and remounting at any time with no need for re-indexing.

Comments

thl’s picture

thl’s picture

Status: Active » Fixed

fixed, see
search_files_directories.install revision 1.1.2.13
search_files_directories.module revision 1.1.2.24

thl’s picture

Status: Fixed » Closed (fixed)