Care2x Development Blog

All the news regarding Care2x development

Using inclued 0.3 under Ubuntu 8.04

think that some of you has read this post : Where is the include coming from ?. It was an interesting post appeared on the PHP::Impact blog, which i re posted and linked here because i thought it was an interesting one regarding the future of care2x.

Well, how to create those diagrams for Care2x ? In this brief tutorial i’ll try to explain the steps to follow to have the inclued php extension to work under ubuntu – 8.04 in my case.

supposing you have installed apache, and php correctly.

Step 1

before downloading and installing the inclued extension we have to install graphviz :

sudo apt-get install graphviz

Step 2

now we download the extension from here : http://t3.dotgnu.info/code/inclued-0.3.tar.gz

then we have to extract it somewhere, so

tar zxf inclued-0.3.tar.gz
cd inclued-0.3
phpize
./configure
make
sudo make install

and that was the hardes part.

Step 3

now we have to configure php to load it as an extension

sudo gedit /etc/php5/apache2/php.ini

and add those lines at the end of the file

extension=inclued.so
inclued.enabled = On
inclued.dumpdir = /tmp/inclued/

save it and restart apache

sudo /etc/init.d/apache2 restart

and now getting the actual graphs.

open up your browser and point it to your care2x installation, in my case http://localhost/care2x and login, open up a patient registration and then do a logout.

if you now do a cd /tmp you will see a lot of files named like : inclued.07933.1, inclued.07933.2, … ecc.

these files have to be parsed with the given gengraph.php.

you can use the given gengraph script with the following syntax :

./gengraph.php -i <inclued_dump> [-t includes|classes] [-o <output_file>] [-d docroot]

then to create a png file with :

dot -Tpng -o inclued.png inclued.out.dot

to speed up things a bit i’ve written the following short shell script which will parse all the inclued generated files in the current directory :

#!/bin/sh
for file in *
do
if [ -f “$file” ]; then
./gengraph.php -i $file -t includes -o $file.dot
dot -Tpng -o $file.inclued.png $file.dot
fi
done

don’t forget to chmod u+x it to make it executable.

and that’s all, now you can have an idea of which files are included during c2x functions.

hope you find it useful.

Advertisements

Filed under: c3x, General

One Response - Comments are closed.

  1. […] egyes fájlok, hogy include-olják egymást. Nem igazán bő a kínálat ezzel kapcsolatban, de a Care2x Development Blogon találtam egy leírást, hogy hogyan lehet élete kelteni egy ilyen szolgáltatást nyújtó […]

%d bloggers like this: