Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm in the process of generating API docs for an in-house web app that's undergoing some expansion. It's a DHTML project, with a mix of both some OO and mostly procedural PHP, and purely procedural Javascript. At the moment, it's pretty much all documented for the appropriate doc generators (phpdocumentor and jsdoc), but the two were never "connected". I could go through and add manual link statements to the doc blocks, but managing all those links (like "../jsdoc/filename.html#function) is a real pain.
Any suggestions for documentation generators that handle both PHP and JavaScript, and allow something like #see functionName between languages?
If worst comes to worst, I can hack together a script to rewrite LINK URLs from some magic syntax (i.e. js: and php:), but I'd really rather have something that will allow a unified tree view of everything.
Thanks,
Jason
After looking at a number of options, I wrote a PHP script that parses JS files, pulls out the doc blocks and function definitions, and then writes it to a file that phpdoc can process. It just needs one line added to phpDocumentor.ini so it will parse .js files.
The blog post talking about it is at:
http://blog.jasonantman.com/2010/08/documentation-generation-for-web-apps-php-and-javascript/
And the script is at:
http://svn.jasonantman.com/misc-scripts/
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Right now, I am using CI 3.0 . And for create report like invoice, monthly report sales, I using dompdf which is so spending time to debug coz dompdf not really support JS.
I was wondering a tools like crystal report , drag and drop report. I am not sure that PHP have like that.
I found php-reports, it looks interesting. But I dont know how to integrate it.
Perhaps, someone out there have solution to this PHP Reports, or maybe if you are share how to simplified creating a report in CI.
Thank You
maybe look at; http://www.hkvstore.com/phpreportmaker/
this questions lightly talks about using it; here
CI is great in that you are allowed to break the rules if you want. if its painful working inside the M-V-C approach then bend some rules or look at another method; like writing a library, or have your model generate more than just the dataset and include html ready for your CSS that your view just has to output (rather than parse).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Can anybody advise on the best PDF generator class/library to use with PHP? Preferably one which is maintained.
I am aware that this is a duplicate of the following question, however, the accepted answer is over 3 years old and I want to know whether the answer has changed since this time.
Which one is the best PDF-API for PHP?
Thank you
Try TCPDF, have good features
http://www.tcpdf.org/examples.php
Also simple HTML to PDF Converter API in (PHP, C#, ASP.net C#, ASP VB.net, JAVA,...)
from "PDF CROWD"
http://pdfcrowd.com/html-to-pdf-api/
very simple to use, but I think this API may need to purchase even they provide a free test account..
Have you tried http://www.PDFnow.com?
Provides a powerful template engine, and is pretty easy to use.
Supports complex layouts, layouts for multiple pages, invoices spreading separate pages, pagenumbers, headers, footers, etc. Definitively much better than fpdf.
You can simply integrate it into your PHP code by:
generatePdf(<templateName>, <ParameterArray>);
very straightforward.
Have a look on http://wkhtmltopdf.org/ Convert HTML to PDF using WebKit engine.
It can be used from PHP easily. For example, there is a bundle for Symfony2: http://knpbundles.com/KnpLabs/KnpSnappyBundle
Best One is TCPDF
http://www.tcpdf.org/
Never Use DOMPDF
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a server-side library (preferably in PHP) to parse and extract the content of web-pages that is free for commercial use. It should be able to extract the headline and html (including images) of the content part of a page, but filter out ads and irrelevant content.
The Readability Parser API is a non-free software that does that, but I'm looking for free alternatives.
Any thoughts?
I'm using Boilerpipe. It's for Java unfortunately, but if you won't find anything in PHP, it may be useful to you. It's not perfect, obviously, but it's worth a try. It's also open source, thus it's possible to make necessary changes.
It has several so-called 'extractors', so you can choose the one which suits your need the most.
Usage is also pretty straightforward, on example:
URL url = new URL("http://example.com/article");
String articleText = ArticleExtractor.INSTANCE.getText(url);
Try using Simple HTML DOM
I used it to build a scraper for a rather complex website. Works very well.
The best way to get any data from page, like the geographic position of the Eiffel Tower from Wikipedia, is jQuery DOM.
<span class="geo-dms">
<span class="geo-lat">48°51′29″</span>
<span class="geo-lon">2°17′40″</span>
</span>
Test in FireBug console jQuery('.geo-lat').text(). jQuery is a JavaScript library and the best result you get with server-side JavaScript web-server Node.js. There is a lot of good Node.js solutions for web crawling with DOM traversing.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there any PHP refactoring tool that would transform a huge noodle code to a proper function based one?
No, you can't do that automatized. Static analysis may reformat your code, eliminate bad practices or inform you about security vulnerabilities, but it can't turn your code into nice and clean OOP.
2019+ answer
Nowadays you can use a tool called Rector (I'm author of).
It uses nikic/php-parser, static analysis and node based rules. That means you can e.g. rename every case of function strlen to Nette\Utils\Strings::length().
Or basically anything you want to. Many rules are supported from in the core code (see Rector on Github), e.g. upgrade from PHP 5.2 throughout to 7.4.
But it can be configured to do what you want. It will take some thinking to determine how to detect what should be extracted and what not. If you can put the transformation into words as a human, it's possible to put that into PHP code so it will do everywhere in your code for you.
Zend Studio (for Eclipse) has support for refactoring code - it allows you to select a piece of code and extract functions/methods. For example:
It also allows for renaming of variables to further clean up your code. While this is not a fully automated solution, it will significantly help you clean up the mess. Hope this helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there a library out there which will validate CSS?
The only tools I can find to do so are web sites. If one of these sites has an API, that would fit the bill, too.
I have a script that serves as a CSS compiler. It sets various variables according to settings for a theme, and generates and writes a CSS file. Before committing to writing the CSS file, I'd like to validate it to make sure there aren't any invalid entries.
PHP would be convenient, but Python, Perl, Ruby, Java, or anything executable from a shell would be fine.
Ideally, there's something out there that I can use as part of a sequence like:
$css_file=theme_compile('theme-name');
if(!validate_css($css_file)){
echo "css file contained invalid entry 'width:px'";//just an example, of course
}
else{
file_put_contents('/path/css_file',$css_file);
}
W3C has an API:
http://jigsaw.w3.org/css-validator/api.html
You can also download the validator and run it locally:
http://jigsaw.w3.org/css-validator/DOWNLOAD.html
You need to be able to run java from your script.
Python library:
http://cthedot.de/cssutils/
There is a pear package called Services_W3C_CSSValidator which does this.
You can download the PHP class directly from the github if you prefer.
Its very simple to use.
require_once 'Services/W3C/CSSValidator.php';
$v = new Services_W3C_CSSValidator();
$result = $v->validateFile('pear_manual.css'); // XML
It includes all features available at http://jigsaw.w3.org/css-validator