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.
Related
I wonder if it's possible to view a PHP code source in a way that https://j11y.io/jquery/ shows a JQ code. Of course I mean reading code from a given file, not from websites code.
I'm not looking for programs like the PHPdocumentor.
Thank you in advance for any reasonable reply.
P.S. For perfectionists - I'm searching for a nice website or software (and I would prefer that option, so that I can be quite sure about the security), which will give me such a useful ability. I'm disturbed after using CTRL-F all the time ;)
The title may have sounded a little vague, but I did not know how to articulate the question.
I want to create a webpage that will contain links to other webpages. But, I want to make it a little modular and want to write all of the functions in one page and access it from the php script(webpage) that contains the part about displaying contents.
In short, I want to create a php page exclusively for displaying contents, and another for running the background functions.
Also, I have a LAMP architecture, and I just have the index.html page to begin with. How do I make it redirect to a php page?
First of all you should start exploring HTML, then Javascript, then PHP, then AJAX.
Take one by one, using books, using other script sources, usign stackoverflow.com to get answers.
I learned all those steps in that order just by reading other peaople sources, exploring and testing then on my own.
Basic HTML is pretty simple if you know how is works.
Learn what can you do with javascript, of course, if you need it.
Your best friend for php is php.net as it will always answer most of the questions
These days javascript frameworks like jQuery simply tells you step by step how to do what you need.
Assuming your LAMP stack is correctly configured, you just need to rename your index.html to index.php.
Then start reading the manual! (I know that sounds unhelpful, but that's where I started and it's the best way for me to learn).
http://www.php.net/manual/en/index.php
Simply rename your index.html to index.php and it should work.
tizag.com (excellent beginner tutorials)
php.net – Contains the PHP manual, user-contributed examples and other
documentation related to PHP.
phpfreaks.com (tutorials)
I ran two PHP workshops in 091 labs and made very trimmed down example apps. Slides and code here: http://091labs.com/wiki/?id=introduction_to_php
Edit: There's an error in the slides for week 1 there, the zend_extension line on setting up xdebug should have a .dll after php_xdebug
I see you already have a project in mind. Programming is best learned with a project rather than focusing on learning by reading alone, so stick with that.
What you described is essentially the Model-View-Controller paradigm used by most web application frameworks. MVC is designed to separate business logic from presentation.
I can't really give you a more specific answer since your question is very vague, but the simplest, most stripped-down way to accomplish MVC is to have two php files, one accessible from the outside, which then includes another file in a protected directory.
So for example you can have a functions.php file and then in your index.php file
require_once('lib/functions.php');
//call functions defined in functions.php
Aside from that, I think you just need to read up a bit and experiment on your own.
If you are starting PHP from scratch and you have LAMP up and running I would advise making a MySQL table with a bunch of strings that represent links to other pages.
I would then attempt to write an index.php page that can access this table and loop through the table displaying the links.
This is probably the easiest non trivial example of using PHP. Remember your page will need to be called index.php not index.html. Place the file in the same folder as your index.html for now.
Good luck!
I would suggest checking out lynda.com It's worth the money and it is a very good introduction to PHP/MySql
Hey guys, I'm learning PHP and I would like to have a look at the source code of a small "commercial grade" PHP project.
Why small? Well because I'm a beginner and big projects such as Drupal or Wordpress are overwhelming right now, aka I don't understand a lot.
Why "commercial grade"? I would like to see if things are done in a different way in comparison to theory, courses and books.
Thanks for any suggestion!
At Google Code you can search for open-source projects in PHP, browse and download its code and even contribute!
I wouldn't write off Drupal or WordPress completely because of their complexity. One good way to bite off a small chunk is to look at the code for a module or plugin. In particular, look for a popular module or plugin that looks interesting. Since those "popular" modules are in use on a lot of sites, they are likely to be more "commercial grade" than the less popular ones.
Check this out:
https://github.com/languages/PHP
http://sourceforge.net/directory/language:php/os:windows/freshness:recently-updated/
You will find lots of small projects.
I'm developing my first web application using PHP, MySql, and HTML, but I'm at a roadblock: now I have to start piecing all the pages, modules, and included files into an actual 'application'. I'm really trying to make this an answerable question, and not a discussion topic, but now I'm thinking about 'web design' - and I don't want to have to learn css and all that, because I want to speand my time programming and not designing. So what I'd like is a utility where I can visually design, say a menu bar, and just paste the code into my application where I can work with it. Or I want to format text visually, and paste the css file into my application. I guess what I want to easily design a layout with forms, images and graphics, and have them show up with my dynamic tables. So my question is - is it a good option to go with a big design program like Dreamweaver for this, or is there an easier way? I'm not really even a programmer (can you tell?), and I'm figuring this out as I go. As an aside, I'm pretty pleased with what I've got so far - I think the functions and modules are pretty useful, and the end product (however I get there) will be great. Apologies for the rambling question, and any advice is really appreciated.
In a perfect world, development would happen entirely independently of design and you could focus on only what most interests you.
But that isn't reality.
Learning HTML and CSS will be invaluable if you expect to have any success with this project or your next. And they are not that hard to learn.
My advice? Download Notepad++ (or TextWrangler if you're on a Mac), FireFox, FireBug, and start playing around. Do some tutorials. Force yourself to go through the process.
No reason to avoid learning something.
You should really learn HTML and CSS or alternatively hire a web designer. Code produced by Dreamweaver and similar programs is terrible. Especially if you try to mix it with PHP you'll get problem. Really, at least write the markup yourself, the styling may be done by another person ;)
I think even if you don't want to become a "web designer", it's still worth learning the basics of CSS. Just read through the W3Schools CSS tutorial - that will give you enough to get started, and won't take long.
I wouldn't recommend going the Dreamweaver route - you'll learn a lot more if you code by hand.
I've looked through several Google searches now, and continue to keep coming up empty when it comes to finding some end-user documentation for the File_PDF package.
A lot of people have pointed to FPDF, which is a predecessor, and as far I know, no longer compatible. FPDF hasn't been updated (http://fpdf.org/) since 2008, either.
I've found a few small snippets of code for File_PDF here and there, but nothing over like 20 lines of code.
Then I came across this little "nugget" of wealth: http://dev.horde.org/pdf/
There's plenty of examples, none of which I've looked through yet, but I'm hoping it does the trick.
In the mean time, does anyone else have some recommendations for PDF generation with PHP?
Last time I needed to generate PDF files with PHP that is what I used (admittedly back in '07) with no major problems.
Things change though and if File_PDF is more intuitive to use or has a better feature-set then you should obviously use it instead.
I feel obliged to point out that there appears to be a later version of File_PDF available at http://pear.php.net/package/File_PDF than at http://dev.horde.org/pdf/
Have you evaluated any of the PDF related classes at http://www.phpclasses.org?
Ended up using tcpdf, as many examples were provided from their site.