I have some source code and I would like to auto generate class diagrams in PHP.
What software can I use to do this?
Duplicate
PHP UML Generator
UML tool for php
Doxygen can do class diagrams, too (if what I'm thinking of are "class diagrams" :) ).
Umbrello can do it.
Hava a look at Instant Reverse
This answer is for people who visits stackoverflow for finding answers to their queries.
http://pear.php.net/package/PHP_UML/
I have not evaluated PHP UML package thoroughly, but It should satisfy the need of small to medium size project.
Related
Im looking for an prefferably automated tool that generates a diagram over the
structure of a laaaaaaaaaarge php project, files with 10 000 lines of code in them.
Mixed php with html with css and javascript here and there.
Need the ones in charge to realize that the project needs refactoring.
Theres not really any oop in this project so some kind of class diagram overview
would only show a small part of the project since its 99% functions.
Anyone that could point me in the right direction to sort out this mess? :)
I don't know if this will truly help but it's too big for a comment..
There is a program called Doxygen which can generate documentation from php source files, now bear with me..
There is an extension to this program that generates structographs(?) structograms based on the source too, it may be of some help.
Failing that this question and maybe this one can offer you some advice on how to get the message across.
I'm intrested in the best way to draw a graph: i have a network and i'd like to draw a map of it. I know how to use gd, but i don't know how to make this graph good for viewing: i mean no line crossing etc.
So, i guess there must be some tools or even php classes for doing this (maybe for graphviz dot?).
Any help will be great for me!
Well, maybe you could use the PEAR Image_GraphViz class?
Personally, I'd off-load the work of drawing the graph to the browser.
A good Javascript graphing library such as gRaphael can draw the graph using vector graphics (ie SVG), and can look much better than most static images generated by PHP, and can have features which static images can't, such as popups when you roll-over data points.
If you do it this way, all your PHP code has to supply is the graph data.
Hope that helps.
As you've laready hinted at, the quickest and simplest approach is to use graphviz. Given the abstraction provided by the dot language, there's little point in providing a PHP abstraction layer on top of it.
Use google!
http://code.google.com/apis/visualization/documentation/using_overview.html#load_your_libraries
They have great graphs. You just need to present the information in the right matter for google to understand. It's pretty simple.
I am trying to implement the job assignment Hungarian algorithm. http://en.wikipedia.org/wiki/Hungarian_algorithm#The_algorithm_in_terms_of_bipartite_graphs
[I think I understand the algorithm, but am not able to appreciate why is it O(n^3). But that is just a curiosity.]
What I am looking for is a PHP implementation of Hungarian algorithm. The Wikipedia link does have a link to implementations, but I have not found PHP version yet.
Most likely you want to look at this article Floyd-Warshall and the all-pairs-shortest-path problem. Unfortunately it is in C but it can help you with the implementation in php ( http://wilanw.blogspot.com/2010/01/floyd-warshall-all-pairs-shortest-path.html ).
This code in Python should be fairly easy to translate to PHP
http://pastebin.com/tn6v0HDr
Is there any libraries to visualizate simple dependency graphs?
I suppose that SVG is good solution.
GraphViz does a nice job for tiny graphs, but not for huge ones. If your graph is reasonlably large, try aiSee or have a look at the alternatives on this list.
I'm not sure about PHP libraries, but there's the tool called Graphviz which can be invoked from your PHP code and produce .SVG visialization of your graph.
I really like Google Chart API: http://code.google.com/intl/fr/apis/chart/
Really simple to implement and there are quite a lot of graph styles.
Checkout http://thejit.org/
I used http://www.aditus.nu/jpgraph/ for drawing simple graphs.
ChartDirector is the best, and it has a lot of flavors thus has versions for PHP/ASP/COM/VB/.NET/JSP/Java/ColdFusion/Perl/Python/Ruby/C++.
By learning one, you then be able to use in many programming languages.
The if you mean graphs like in "dependency graph", then Graphviz should be mentioned.
How can I make a PDF file in PHP. What I want to make is a student list. So I want to query the database, get the information and give it to the user as a PDF when he clicks generate student list.
You have two good options first is the standard php library for manipulating pdf's: http://us2.php.net/pdf
Or you can use http://www.fpdf.org/. I would recommend the second.
Other options include:
www.pdflib.com
PEAR has the PEAR::File_PDF package.
There are are already many libraries available with PHP bindings. One that comes to mind is PDFLib (www.pdflib.com). If I am not mistaken there should even be a lite version that you can use for free. But just check it out.
Hope it helps
I use the ezPDF class. Lightweight, simple, easy to use, and handles most cases.
FPDF is a classical in the field. It seems it has limitations when handling Unicode (eg. Asian char sets), so there are libraries extending it (UFPDF, TCPDF...).