Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

Where is the include coming from?

with 68 comments

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)

About these ads

Written by Federico

August 4, 2008 at 12:16 am

68 Responses

Subscribe to comments with RSS.

  1. [...] Alguém imaginou e postou aqui. [...]

    Cairo’sBlog

    August 4, 2008 at 12:40 am

  2. 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

    Martin

    August 4, 2008 at 6:36 am

  3. I’m using Inclued and Graphviz.

    Federico

    August 4, 2008 at 9:21 am

  4. Thanks a lot!

    Very interesting blog though.

    Alexander Schmidt

    August 4, 2008 at 11:48 am

  5. Could you post a CodeIgniter map too ?

    Mihai Georgescu

    August 4, 2008 at 11:59 am

  6. 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.

    Scott Spear

    August 4, 2008 at 1:33 pm

  7. Thanks for the comments :)

    @Mihai: Yes, I’ll add it tonight.

    Federico

    August 4, 2008 at 1:38 pm

  8. Nice blog post. Useful. Can you be troubled to do drupal? ;)

    Lei Teh

    August 4, 2008 at 2:11 pm

  9. @Lei: Added to my list.

    Federico

    August 4, 2008 at 2:12 pm

  10. Drupal and CodeIgniter would be great! ++++

    Blake

    August 4, 2008 at 4:26 pm

  11. Excellent work.

    jesusvld

    August 4, 2008 at 6:01 pm

  12. 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.

    Matthew Weier O'Phinney

    August 4, 2008 at 6:16 pm

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

    JoaoJose

    August 4, 2008 at 7:43 pm

  14. [...] 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 [...]

    Gráfico de includes

    August 4, 2008 at 8:24 pm

  15. @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.

    Federico

    August 5, 2008 at 12:39 am

  16. I second the Drupal (6.x?) map :)

    Great article!

    Shawn

    August 5, 2008 at 2:15 am

  17. Great! Very usefull
    But I’m confusing about: phpMyAdmin 5.0.45
    Latest stable version: phpMyAdmin 2.11.8.1

    handyblogger

    August 5, 2008 at 5:29 am

  18. Great work!
    does anybody know if there is a windows version for the Inclued library ?

    Gjergji

    August 5, 2008 at 7:22 am

  19. Not that I know of.

    @handyblogger: Well spotted, thanks :)

    Federico

    August 5, 2008 at 8:30 am

  20. @Federico Thank you for adding CodeIgniter ;) Looks great.

    Mihai Georgescu

    August 5, 2008 at 12:56 pm

  21. [...] that could ease a bit the decision is this comparison made here. It;s based on the number of include calls made by the boot-up of the framework. Some examples can [...]

    Care2x Devlopment Blog

    August 5, 2008 at 9:32 pm

  22. [...] Includes of the system map out of the dependencies of the system. [ Here [...]

  23. 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.

    David

    August 6, 2008 at 6:27 pm

  24. 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.

    Brad

    August 6, 2008 at 7:57 pm

  25. [...] Блог PHP::Impact опубликовал очень интересную подборку диаграмм. [...]

  26. Seems like Zend Framework is the most decoupled of the lot?

    Kenny Lee

    August 8, 2008 at 5:03 am

  27. [...] PHP::Impact ( [str Blog] ) map for all the includes in CodeIgniter from the time the framework [...]

    Lasercake

    August 8, 2008 at 5:48 am

  28. please make a graph for kohanaphp!

    Dude

    August 8, 2008 at 6:47 pm

  29. @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.

    Federico

    August 9, 2008 at 9:23 am

  30. [...] a tightly-coupled framework (you can get a feel for this by viewing Federico Cargnelutti’s dependency graphs for some common PHP [...]

  31. kohana is no longer a fork of ci. it has been completely rewritten in 2.0

    Dude

    August 9, 2008 at 11:36 pm

  32. [...] Where is the include coming from? [...]

    rpsblog.com

    August 10, 2008 at 10:35 pm

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

    Federico

    August 10, 2008 at 11:34 pm

  34. [...] Where is the include coming from? Shows the module dependencies for different open-source projects – very eye-opening. [...]

    GrantPalin.com

    August 11, 2008 at 4:04 am

  35. wow good job!

    sibirya

    August 11, 2008 at 12:36 pm

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

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

    good job!

    Omar

    August 11, 2008 at 5:16 pm

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

    Pascal

    August 13, 2008 at 1:15 am

  38. [...] Interessante questo post [...]

    Digital Design News

    August 14, 2008 at 8:00 am

  39. 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.

    Demian Turner

    August 14, 2008 at 6:16 pm

  40. Very interesting, thanks Demian :)

    Federico

    August 14, 2008 at 11:12 pm

  41. could you post joomla 1.5 map as well .. thanks :D

    adwin

    August 16, 2008 at 5:56 am

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

    Yangtze

    August 18, 2008 at 11:59 am

  43. 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:

    http://example.preinheimer.com/dump/magento.png
    (Image size: 5.5MB. Right click and select Save As…)

    Scott

    August 23, 2008 at 5:41 am

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

    Federico

    August 23, 2008 at 11:48 am

  45. Thanks you for your article!

    I just wonder how did you build these include scheme?

    Did you use any special tools for that?

    grakoff

    August 28, 2008 at 4:23 pm

  46. 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

    Christian Aarø Rasmussen

    August 30, 2008 at 3:58 pm

  47. 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.

    Federico

    August 30, 2008 at 6:06 pm

  48. This is awesome! :P

    Napolux

    September 1, 2008 at 6:22 pm

  49. [...] questi grafici che mostrano tutti gli “include” e i “require” della versione 2.2.1 di WordPress e di altri [...]

    Napolux

    September 3, 2008 at 11:30 am

  50. [...] 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 [...]

    Perfect Blogger

    September 21, 2008 at 10:52 am

  51. CodeIgniter looks “light”.

    As there wasn’t any graph for Joomla yet, I decided to generated one: http://www.joomlavue.com/blog/14-joomla-files-includes

    It is based on Joomla 1.5.7

    eddy

    October 3, 2008 at 5:54 pm

  52. Thanks eddy, I’ll add it to the post.

    Federico

    October 4, 2008 at 12:05 am

  53. [...] of PHP::Impact ( [str Blog] ), here’s a detailed “map” of the CodeIgniter system’s file structure when [...]

    Good Idea, Bad Idea

    October 24, 2008 at 12:32 am

  54. Cool! but I really need the OSCommerce’s graph!!
    Can someone help?

    Thanks

    Johnny

    December 15, 2008 at 4:39 am

  55. [...] Where is the include coming from? [...]

    Top Posts 2008

    January 10, 2009 at 2:29 pm

  56. [...] arquitectura y funcionamiento son muy simples y es muy liviano para el servidor. Les invito a que comparen su flujo de código contra los de otros frameworks. 12 de February de 2009 a las 07:07 pm — Enlace permanente a esta entrada [...]

  57. [...] Dépendance graphique d’un “Hello World” sur Zend Framework (gif). À comparer avec d’autres frameworks php [...]

    iWeb Blog

    March 26, 2009 at 12:00 pm

  58. @Johnny A little late but I just blogged about the Inclued extension and put a graph of osCommerce.

    Then I noticed this lovely article thanks to @tychay :)

    Heres the link: http://short.ie/pecl-inclued

    Che

    April 27, 2009 at 5:28 pm

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

    dinesh

    July 1, 2009 at 6:30 am

  60. 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

    KeepOn

    February 13, 2010 at 1:28 am

  61. very, very nice… tank you! good job ;-)

    webdesignfirenze

    April 27, 2010 at 10:31 pm

  62. great work.. CodeIgniter map worked for me too

    kerem bekman

    June 20, 2011 at 8:10 am

  63. [...] to do our common tasks and make our own ‘NoFramework’. I totally agree with this. Also, an analysis of all frameworks and models is here. CI [...]

  64. do you have inclued for windows???

    rain

    August 16, 2011 at 5:22 am

  65. [...] any case, compare with other frameworks (note not all these are graphs of hello world, some seem to be graphs of the default page or a [...]

  66. could you also do a Magento map too. :)

    Luv

    January 16, 2012 at 5:57 am

  67. [...] any case, compare with other frameworks (note not all these are graphs of hello world, some seem to be graphs of the default page or a [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 381 other followers