Spotlight not indexing PHP files

Discussion in 'macOS' started by g7_chord, May 6, 2005.

  1. g7_chord macrumors newbie

    May 6, 2005
    I have a few dozen PHP files that I edit with TextWrangler, and Spotlight never lists anything in them. Tried several searches. Even reindexed (making the hard disk private, waiting a few minutes, and then making it un-private).

    The "kind" for PHP files is HTML... is that related to the problem? (But it finds files ending in ".html", which are also of HTML kind, OK.)

    Perhaps I can change the "kind"? I'd want to do this on a mass basis (and set a new default), not modify each file individually.

    Ideas? Anyone also see Spotlight skipping ordinary text files?

    (These files existed on my Mac prior to installing Tiger, but I've also tried re-editing them.)
  2. DXoverDY macrumors 6502a

    Apr 19, 2005
    seems to me that spotlight indexes based on extension ... php isn't a recognized extension with spotlight so as such they aren't indexed. maybe i'm wrong here i haven't had much time to fool around with it or try creating a spotlight plugin so i could be wrong.
  3. Mitthrawnuruodo Moderator emeritus


    Mar 10, 2004
    Bergen, Norway
    Spotlight only indexes certain file types:
    But sooner or later someone's going to make a Spotlight Plug-in for html/php/css/js/etc...
  4. ajwitte macrumors member

    Apr 28, 2005
    Or, a plugin which indexes any file for which the 'magic' (output of the file command) contains "text", as text.
  5. g7_chord thread starter macrumors newbie

    May 6, 2005
    What's "plain text"?

    Mitthrawnuruodo writes:

    "Spotlight only indexes certain file types:
    "Plain text"

    But these PHP files ARE plain text! No plug-in is necessary! Isn't there some way to specify this to Spotlight?

    (Programmers deal with lots of plain text files with assorted extensions: html, htm, perl, pl, php, py, js, sql, java, c, cpp, awk, sh, ...)
  6. DXoverDY macrumors 6502a

    Apr 19, 2005
    due to the file TYPE it isn't a recognized file type man. just because it is text doesn't mean spotlight will treat it as that. i believe this is how spotlight indexes..

    1. when a file save or copy occurs spotlight gets the filename
    2. spotlight takes the filename and runs it through a set of plugins to determine whether any of them support this file format.
    3. if a plugin is found use it to index said file

    however php isn't really a "text document".. it is plain text sure, but it isn't a plain text file that anyone and their mom would want to see in spotlight. you'll have to wait until someone releases a plugin. or go write your own, from my understanding they aren't really that difficult.

Share This Page