It is possible to configure Eclipse PDT to format my php code after a standard like MySource or Zend?
You looking for code indentation .
I hope this may help you
http://drupal.org/node/75242
https://github.com/ginatrapani/ThinkUp/wiki/Developer-Guide:-Setting-Up-Eclipse-PDT
You can, except maybe max line length. Preferences->PHP->Code Style->Formatter will change indention.
Preferences->General->Workspace will change text file formatting (i.e; line termination)
Preferences->PHP->Editor->Typing there is an option for closing PHP tag
Related
I'm trying to format numbers in an Excel file using PHP and opentbs.
Here's template code I'm working from:
[gross_pay_names;block=begin;sub1=departments][gross_pay_names.name]
[gross_pay_names_sub1;block=begin]
[gross_pay_names_sub1.val; ope=tbs:num]
[gross_pay_names_sub1;block=end]
[gross_pay_names;block=end]
The problem is in the third line:
[gross_pay_names_sub1.val; ope=tbs:num]
It always renders with an apostrophe in the beginning ('0.00). So I can't use it in other formulas in the file.
Ok, I found a solutions myself. In case anybody needs it in the future here's the template code I ended up using:
[gross_pay_names.name;block=tbs:row;sub1=departments] [gross_pay_names_sub1.val;block=tbs:cell;ope=tbs:num]
This question is in reference to:
Free (preferably) PHP RTF to HTML converter?
I'm trying to execute that last line of code in my php:
exec(rtf2htm file.rtf file.html)
I understand what parameters need to go within the parentheses, I just do not know how to write it. I've looked at multiple examples along with the php documentation and still I remain confused, so could someone show me how it is written? rtf2htm refers to a PHP file which converts RTF to HTML.
Ultimately what I am trying to do is convert the content of numerous RTF docs to HTML, maintaining the formatting, while not creating tags such as<head> or <body> which programs like Word or TextEdit generate when converting to HTML.
rtf2htm is not a php script, it is a program installed on the server. exec() is used to call external applications.
EDIT: After looking up this script, it seems that it is indeed a php script. But it has been coded to be usable from the command line only.
This should work:
<?php
exec('php /path/to/rtf2htm /path/to/source.rtf /path/to/output.html');
?>
I'm trying to get Perl to read an offline pcap file and save the output into XML file so I can work with it in PHP.
I can't use PHP because its not my server but I can Perl. So my aim is to convert the PCAP file into XML so I have fun with it.
I have no idea where to start and have looked at the Perl Net::Pcap but I just don't understand the language.
Any ideas on what I should do?
Thank-you
Paul
Using Net::Pcap is a decent idea, although figuring out the format you'd want to write out the capture in doesn't seem all that easy. My favourite solution would be to use tshark (the command line version of wireshark) like so:
tshark -r $dmp_filename -Tpsml
This would give you the output in a XML standard format.
Of course if you don't have tshark, not very helpful...
Is there any way to convert rtf format to pdf using PHP?
Thanks
If you want to stick with pure PHP, you can probably use HTML as an intermediary:
Convert RTF to HTML
http://freshmeat.net/projects/rtf2htm/ , http://www.phpclasses.org/package/1930-PHP-RTF-to-HTML-converter-with-latin-character-support.html
Optionally: clean up the HTML
http://htmlpurifier.org/
Convert HTML to PDF
http://dompdf.github.io/
You can use OpenOffice command line interface for that. Check my answer to a similar question.
Ted is the tool you're looking for. Ted brings also a script called rtf2pdf.sh you can execute by PHP to create a PDF file.
You should try out livedocx livedocx.com . The latest Zend Framework 1.10 has a ready built module to help you out. You can read more about it at this place http://www.phpfreaks.com/tutorial/template-based-document-generation-using-livedocx-and-zend-framework
Can you suggest some method of converting PHP Code Sniffer XML report into HTML page(s). I guess I might need some XSLT translation… Thanks in advance for the advice.
Few days ago I posted XSLT stylesheet on my blog: http://phpdojo.blogspot.com/2010/12/converting-phpcodesniffer-xml-report.html including new type of report: xsl.
Just to add: If you run phpcs through Jenkins, then you can output the report in 'checkstyle' format.
phpcs --report=checkstyle --report-file=/phpcs/out.xml
Then configure your Jenkins job to parse the output using that file.
Here's the plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin
Here's some output samples:
XSLT is quite cumbersome to write, very few people I know can do it well; you can instead parse the XML in a PHP script and spit out HTML.
CodeSniffer can also output its report as a CSV file - if that's easier for you to parse, use that instead.