php file finder

Discussion in 'PHP' started by akashif, Dec 18, 2006.

  1. #1
    hi

    i have php running on windows server with IIS 5.0.

    i have almost 250 different folders in Document Root containing asp and php and cfm files .

    i need some Script which can tell me all Foldernames which have .php file in it

    a folder can heve upto N subfolders

    i dont need the filename , just the foldername which have atleast 1 php file

    i have tried to do it myself and searched many where but coulf not find some thng good

    one good referance is

    http://www.zend.com/codex.php?id=560&single=1

    but this not notworking ith me

    can anyone tellme how to do this.

    thanks in advance
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    akashif, Dec 18, 2006 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    Right click folder -> Search:

    *.php -> this will pick up all php files in the folder and sub-directories.

    Peace,
     
    Barti1987, Dec 18, 2006 Set Best Answer IP
  3. akashif

    akashif Guest

    Best Answers:
    0
    #3
    :)

    thanks for an excellent suggession, i never knew this :).
    my dear , in reality i have a web server which have more then 800+ sites, and many many subdirectories , and .php is just an example , i need to find many other extensions as well , s
    do you really think i should sit back for days ans searcht the files :)

    anyway thanks for your suggession , this wil be my last action before i commit suicide :D

    thanks
     
    akashif, Dec 18, 2006 Set Best Answer IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    gimme a more detailed structure, also, list all the filetypes you wanna search for and what you want to do with each when you find them.then patiently wait ..... don't commit suicide else you'll be wasting my time :)
     
    krakjoe, Dec 19, 2006 Set Best Answer IP
  5. akashif

    akashif Guest

    Best Answers:
    0
    #5
    ok
    here are the details

    i havea web server , running on IIS , its root is C:\data\

    C:\data\site1\
    C:\data\site2\
    C:\data\site3\
    ...
    ..
    ..
    C:\data\site1000\
    ...
    ..
    ..
    C:\data\site1891\ (1891 is real fugure i have 1891 sites runing )


    each site contails its data, there can be `N` folders in each site, and `n` files.

    these sites are using asp , php , cfm , html , htm

    my server is over loaded , i want to split the server in to 4 servers

    one containing only asp
    one containing only php
    one containing only cfm
    one containing only html , htm

    so
    ineed a script which which takes the input

    C:\\data\ (web server Document ROOT)

    and Give me out put as

    html --> site1
    asp --> site2
    asp --> site3
    php --> site4
    cfm --> site5
    php --> site6
    asp,php --> site8
    asp,php --> site9
    asp,php,cfm --> site10
    ..
    ..
    php --> site1000
    ..

    i know that will be complex, but if you can give me just


    asp --> site2
    asp --> site3
    asp --> site8
    asp --> site9
    asp --> site10
    ...
    ...
    asp --> site1119

    that will be more than enough


    Criterian is

    is a site containing a single asp page (.asp file)
    the site number is Printed with asp ( site Root Folder Name )

    thanks
     
    akashif, Dec 21, 2006 Set Best Answer IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    Barti1987, Dec 21, 2006 Set Best Answer IP
    1 person likes this.
  7. akashif

    akashif Guest

    Best Answers:
    0
    #7
    i am not going to Committ suicide in any case :) cause i think like you 'GOD is always there '

    and thanks for ur link . i am working on it to do `recursion` for internal folders

    i am sure this will really help me out

    thanks
     
    akashif, Dec 21, 2006 Set Best Answer IP