Where is the include coming from?


The includes of the system map out the dependencies of the system, which files depend on which, which subsystem depends on which. When working with a system, it’s always useful to map out the dependencies before hand.

Here are some examples:

WordPress 2.2.1
http://wordpress.org

MediaWiki 1.12
http://www.mediawiki.org/

phpBB 3.0
http://www.phpbb.com/

phpMyAdmin 2.9.1.1
http://www.phpmyadmin.net/

Symfony 1.1
http://www.symfony-project.org/

Zend Framework 1.5.2
http://framework.zend.com/

CakePHP
http://www.cakephp.org/

CodeIgniter
http://codeigniter.com/

Seagull Framework
http://seagullproject.org/
(Demian Turner)


68 responses to “Where is the include coming from?”

  1. Thanks for you blog – always very interesting!
    I was working on include graphs to show my team
    the mess they created. Wrote a Java program for this.

    What tool are you using for the analysis and creation
    of the graphs shown here?

    Regards – Martin

  2. Nice post. Trying to follow all the includes and requires is not an easy task. This is a good resource for understanding how the apps work. Thanks for the post.

  3. Are the applications you’re running the frameworks against equivalent in functionality? I see some files included on the ZF app that may or may not be included in standard applications. It’d be good to run these graphs such that similar functionality is compared.

  4. Is there a chance for you to associate the execution time of each file? (using the profiling of XDebug)

  5. […] no blog do Cairo, um cara fez um mapa de todos os arquivos importados pelos métodos include e require do PHP. Ele fez um teste com várias aplicações, confira abaixo o do CakePHP. Gráfico de dependências […]

  6. @Matthew

    You are right, ZF includes more functionality. That’s because I’m using the graph from this post. The idea was to show the workflow of the framework. But yes, I guess I can add more functionality to CakePHP and Symfony, and while I’m at it, upgrade Symfony to version 1.2.

  7. I think every framework and CMS should hire to you make one of these for people new to the systems.

    This makes it so easy to trace.

  8. Awesome work!

    Its interesting to consider if there can be any valuable info gleaned just by comparing the thumbnails.

    WordPress & Cake have very flat, slim organizations.

    Zend Framework has a very deep and wide org.

    Codeigniter, Symfony & phpBB organiztions are slim and shallow.

  9. @Kenny Lee: That’s right.

    @Dude: If I’m not wrong, Kohana is a fork of CI, right? I’m guessing the designs are similar.

  10. @Dude: I’ve just finished browsing Kohana’s source code and you are right, I didn’t find any traces of CI.

  11. Link to Image for symfony 1.1 doesn´t work.

    Can you write a little tutorial how to use Inclued and Graphviz ?

    good job!

  12. Very interesting. Would it be possible to generate graphs for CMS like Joomla, Drupal and Typo3?

  13. Thanks for the mention of Inclued, what a great way to get a snapshot of the development style of a PHP project. Here’s the depgraph for Seagull, http://seagullfiles.phpkitchen.com/seagull_depgraph.png, the shape seems closest to symfony at first glance.

    I think another really important metric, on the subject of framework file structures, is number of included files. This Seagull project has 63, which is mostly dependent on the number of blocks loaded, and caching being disabled. A much simpler project I have in zpf 1.5 loads 89 files but feels much slower. Totally agreed that Zend’s “use at will” approach with minimal coupling is the way to go.

  14. […] diese ihre Dateien, wie sind sie aufgebaut. Es gibt einige nette Grafiken, auch zum Zend Framework. -> Where the Include coming From […]

  15. The Magento (ecommerce) includes diagram should be added to the list. They’re fairly hideous. I didn’t create the view, but you can grab it from here:


    (Image size: 5.5MB. Right click and select Save As…)

  16. Thanks Scott. There’s a lot going on there. I’m sure Magento users are going to find it useful.

  17. Thanks you for your article!

    I just wonder how did you build these include scheme?

    Did you use any special tools for that?

  18. Hi Frederico, thanks for the article – very insightfull.
    I’d like to have a closer look at the diagrams for ZF and Symphony but the links doesn’t seem to work. Is that something there might be a solution to because I’d really like to investigate them further :)

    Kind regards
    Christian Aarø Rasmussen

  19. It seems to be working fine now. WordPress stores all the images in Amazon’s S3, so there’s not much I can do about it.

  20. […] Dependencies maps for popular PHP-based software – if you ever wanted to see how a certain file is used in WordPress, that’s a great way to finally find out […]

  21. Excellent! Handy info which will give better understanding of Frameworks.. This is missing even in Framework docs.. I wonder how u get all these..?

  22. dont you have troubles when compiling the image with your RAM? my cmd always breaks -> “out of memory” when i want to compile the picture

Leave a comment