RE: Need tool to graphically show all includes/requires -- first version Announcement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Impossible! HAH!

So here's a first stab at this.
http://daevid.com/examples/include_tree.zip

It's not very pretty (yet), but should illustrate where I'm going with it.
Next step is to make it a nice tree view in a .html page or something. I'm
not quite sure what or how I want to do that just yet, but it's quite useful
as it is. Simply redirect the output to a file.

It handles sane define('ROOTPATH', '/myroot/') format substitutions. It does
not handle the other goofy function/variable example given below. I don't
think that's very real-world.

# ./it.php --print_tree --parse_tree --debug

index.php
/includes/
   global.inc.php

Processing: /myroot/tools/include_tree/example/index.php
Processing: /myroot/tools/include_tree/example/includes/global.inc.php
Array
(
    [branding.inc.php] => item Object
        (
            [path] => /
            [file] => branding.inc.php
            [realpath] => .
            [includedByArray] => Array
                (
                    [0] => /includes/global.inc.php
                )

            [requiresArray] => Array
                (
                )

        )

    [db.inc.php] => item Object
        (
            [path] => /myroot/includes
            [file] => db.inc.php
            [realpath] => ROOTPATH."/includes
            [includedByArray] => Array
                (
                    [0] => /index.php
                    [1] => /includes/global.inc.php
                )

            [requiresArray] => Array
                (
                )

        )

    [global.inc.php] => item Object
        (
            [path] => /includes
            [file] => global.inc.php
            [realpath] => /myroot/tools/include_tree/example/includes
            [includedByArray] => Array
                (
                    [0] => /index.php
                )

            [requiresArray] => Array
                (
                    [0] => /locale_default.inc.php
                    [1] => /branding.inc.php
                    [2] => /myroot/includes/db.inc.php
                    [3] => /log.php
                    [4] => /myroot/includes/universal.inc.php
                    [5] => /classes/persistent_variables.php
                )

        )
...

DÆVID  

> -----Original Message-----
> From: Roman Neuhauser [mailto:neuhauser@xxxxxxxxxx] 
> Sent: Saturday, January 20, 2007 4:46 AM
> To: Daevid Vincent
> Cc: 'PHP General'
> Subject: Re:  Need tool to graphically show all includes/requires
> 
> # daevid@xxxxxxxxxx / 2007-01-19 16:52:49 -0800:
> > We have a fairly complex product that is all PHP based GUI.
> > 
> > We're in need of some kind of "graphical tool" (web, stand 
> alone, windows,
> > linux, osx whatever) that will take a directory tree, 
> recursively traverse
> > all the files, look for 'includes' and 'requires' (and the 
> _once versions
> > too) and then map them out so we can see what files are 
> calling what and
> > where.
> 
> That's impossible to tell exactly without running the software you're
> studying. What would you map this to?
> 
> function include_($file) { include $file; }
> 
> Or this?
> 
> define('FOO_INLCUDE_DIR', '/some/path');
> include FOO_INLCUDE_DIR . '/file.php';
> 
> The recursive part is easy:
> 
> find $topsrcdir -name \*.php -print0 | xargs -0n1 
> processing-script-for-one-file


"Some people, when confronted with a problem, think 'I know, I'll use XML.'"
Now they have two problems. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux