{"id":439,"date":"2010-12-27T13:05:24","date_gmt":"2010-12-27T12:05:24","guid":{"rendered":"https:\/\/d-mueller.de\/blog\/?p=439"},"modified":"2010-12-27T13:05:24","modified_gmt":"2010-12-27T12:05:24","slug":"php-includes-visualisieren-mit-inclued","status":"publish","type":"post","link":"https:\/\/d-mueller.de\/blog\/php-includes-visualisieren-mit-inclued\/","title":{"rendered":"PHP-Includes visualisieren mit Inclued"},"content":{"rendered":"<p><div id=\"attachment_447\" style=\"width: 160px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/zend-framework.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-447\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/zend-framework-150x150.gif\" alt=\"zend-framework\" title=\"zend-framework\" width=\"150\" height=\"150\" class=\"size-thumbnail wp-image-447\" \/><\/a><p id=\"caption-attachment-447\" class=\"wp-caption-text\">zend-framework<\/p><\/div><br \/>\nIch bin ja ein gro\u00dfer Freund von statischer Codeanalyse und optischer Aufbereitung (siehe auch <a href=\"https:\/\/d-mueller.de\/blog\/codevisualisierung-mit-pfff-php-frontend-for-fun\/\">Codevisualisierung mit pfff: PHP Frontend For Fun<\/a>). Nun bin ich auf was neues aufmerksam geworden: <i>Inclued<\/i>. Mittels dieses coolen Tools lassen sich Includes zwischen Dateien einer Webanwendung visualisieren &#8211; sowas kann durchaus n\u00fctzlich sein, wenn man sich in eine Anwendung reinschaffen m\u00f6chte oder einen \u00dcberblick erhalten will.<\/p>\n<h2>Installationsanleitung<\/h2>\n<p>Ich gehe hier von Ubuntu aus, sollte aber mit kleinen Abwandlungen auch mit anderen Distributionen gut gehen.<\/p>\n<ol>\n<li>Wir brauchen phpize, um inclued zu installieren. Das ist im php-dev Paket enthalten.\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">sudo apt-get install php5-dev<\/pre>\n<\/li>\n<li>Nun wird inclued selbst \u00fcber pecl installiert:\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">sudo pecl install inclued-alpha<\/pre>\n<\/li>\n<li>Zur php.ini muss nun (am besten unter <i>extensions<\/i>) hinzugef\u00fcgt werden:\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">extension=inclued.so\r\ninclued.enabled=1\r\ninclued.dumpdir=\/tmp<\/pre>\n<\/li>\n<li>Apache restarten:\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">sudo apache2ctl restart<\/pre>\n<\/li>\n<li>Jetzt brauchen wir die <i>gengraph.php<\/i>, die inclued mitbringt. Bei mir befand sie sich in <i>\/usr\/share\/php\/gengraph.php<\/i>. Wer sie nicht findet, kann auch das PECL-Paket <a href=\"http:\/\/pecl.php.net\/package\/inclued\/\">von dieser Seite<\/a> herunterladen, da befindet sich dann die gengraph.php drin. Die habe ich nach htdocs verschoben.<\/li>\n<li>Zur Visualisierung des inclued-Outputs brauchen wir gengraph:\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">sudo apt-get install graphviz<\/pre>\n<\/li>\n<li>Anschlie\u00dfend besucht ihr die zu analysierende Webanwendung im Browser, also etwa <i>http:\/\/localhost\/codeigniter\/index.php<\/i>. Daraufhin generiert inclued eine Datei ins oben definierte temp-Verzeichnis. Bei mir hies sie <i>\/tmp\/inclued.07565.1<\/i>, der Name ist aber nicht vorhersehbar.<\/li>\n<li>Nun generieren wir mit der gengraph.php eine dot-Datei, die wir dann sp\u00e4ter visualisieren:\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">php \/var\/www\/gengraph.php -i \/tmp\/inclued.07565.1<\/pre>\n<\/li>\n<li>Mittels\n<pre data-enlighter-language=\"enlighter\" class=\"EnlighterJSRAW\">dot -Tpng -o inclued.png inclued.out.dot<\/pre>\n<p>generieren wir nun eine png-Datei, die dann genauso (bzw. hoffentlich weniger komplex) aussieht, wie die unten folgenden Beispiele.<\/li>\n<\/ol>\n<h2>Beispiele existierender Anwendungen<\/h2>\n<p><div id=\"attachment_440\" style=\"width: 268px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/cake.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-440\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/cake-258x300.png\" alt=\"CakePHP\" title=\"CakePHP\" width=\"258\" height=\"300\" class=\"size-medium wp-image-440\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/cake-258x300.png 258w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/cake-882x1024.png 882w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/cake.png 1722w\" sizes=\"auto, (max-width: 258px) 100vw, 258px\" \/><\/a><p id=\"caption-attachment-440\" class=\"wp-caption-text\">CakePHP<\/p><\/div><br \/>\n<div id=\"attachment_441\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/codeigniter.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-441\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/codeigniter-300x145.png\" alt=\"CodeIgniter\" title=\"CodeIgniter\" width=\"300\" height=\"145\" class=\"size-medium wp-image-441\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/codeigniter-300x145.png 300w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/codeigniter-1024x495.png 1024w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/codeigniter.png 1970w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-441\" class=\"wp-caption-text\">CodeIgniter<\/p><\/div><br \/>\n<div id=\"attachment_442\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/drupal.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-442\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/drupal-300x201.png\" alt=\"Drupal\" title=\"Drupal\" width=\"300\" height=\"201\" class=\"size-medium wp-image-442\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/drupal-300x201.png 300w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/drupal-1024x688.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-442\" class=\"wp-caption-text\">Drupal<\/p><\/div><br \/>\n<div id=\"attachment_443\" style=\"width: 246px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/magento.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-443\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/magento-236x300.png\" alt=\"Magento\" title=\"Magento\" width=\"236\" height=\"300\" class=\"size-medium wp-image-443\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/magento-236x300.png 236w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/magento-808x1024.png 808w\" sizes=\"auto, (max-width: 236px) 100vw, 236px\" \/><\/a><p id=\"caption-attachment-443\" class=\"wp-caption-text\">Magento<\/p><\/div><br \/>\n<div id=\"attachment_444\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/oscommerce.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-444\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/oscommerce-300x211.png\" alt=\"OsCommerce\" title=\"OsCommerce\" width=\"300\" height=\"211\" class=\"size-medium wp-image-444\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/oscommerce-300x211.png 300w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/oscommerce-1024x723.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-444\" class=\"wp-caption-text\">OsCommerce<\/p><\/div><br \/>\n<div id=\"attachment_445\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/phpmyadmin.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-445\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/phpmyadmin-300x91.png\" alt=\"phpMyAdmin\" title=\"phpMyAdmin\" width=\"300\" height=\"91\" class=\"size-medium wp-image-445\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/phpmyadmin-300x91.png 300w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/phpmyadmin-1024x311.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-445\" class=\"wp-caption-text\">phpMyAdmin<\/p><\/div><br \/>\n<div id=\"attachment_446\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/symfony.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-446\" src=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/symfony-300x165.png\" alt=\"Symfony\" title=\"Symfony\" width=\"300\" height=\"165\" class=\"size-medium wp-image-446\" srcset=\"https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/symfony-300x165.png 300w, https:\/\/d-mueller.de\/blog\/wp-content\/uploads\/2010\/12\/symfony-1024x566.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-446\" class=\"wp-caption-text\">Symfony<\/p><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ich bin ja ein gro\u00dfer Freund von statischer Codeanalyse und optischer Aufbereitung (siehe auch Codevisualisierung mit pfff: PHP Frontend For Fun). Nun bin ich auf was neues aufmerksam geworden: Inclued. Mittels dieses coolen Tools lassen sich Includes zwischen Dateien einer &hellip; <a href=\"https:\/\/d-mueller.de\/blog\/php-includes-visualisieren-mit-inclued\/\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8,3],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-php","category-quicktips","category-webdev"],"_links":{"self":[{"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/comments?post=439"}],"version-history":[{"count":0,"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/posts\/439\/revisions"}],"wp:attachment":[{"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/media?parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/categories?post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/d-mueller.de\/blog\/wp-json\/wp\/v2\/tags?post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}