Useful Developer Tips

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(New page: * [https://addons.mozilla.org/en-US/thunderbird/addon/4268 Colored Diffs Extension for Thunderbird] - A bit slow, but useful for those Thunderbird users subscribed to the commit mailing li...)
m (Reverted edits by Unotefuca (Talk) to last revision by Stupidscript)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
 +
== Thunderbird Convenience ==
 +
* [https://addons.mozilla.org/en-US/thunderbird/addon/4268 Colored Diffs Extension for Thunderbird] - A bit slow, but useful for those Thunderbird users subscribed to the commit mailing list.
* [https://addons.mozilla.org/en-US/thunderbird/addon/4268 Colored Diffs Extension for Thunderbird] - A bit slow, but useful for those Thunderbird users subscribed to the commit mailing list.
 +
 +
 +
== PHP Example ==
 +
 +
The PHP example using AbiCommand floating around the web did not function for me using Fedora 13, PHP 5.3, AbiWord 2.8.6
 +
 +
It was missing line endings, and that resulted in concatenation of all of the commands and failure to load the file.
 +
 +
Here is the original example code:
 +
 +
  $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 +
  fputs($handle, "server");
 +
  fputs($handle, "load /usr/local/apache/sites/Toronto.doc");
 +
  fputs($handle, "save /tmp/toronto1.html");
 +
 +
Here is the corrected code with Linux-style line endings, a corrected "server" command (was missing an argument), using fwrite() instead of its alias fputs(), and closing the resource at the end:
 +
 +
  $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 +
  fwrite($handle, "server /tmp/abiword_errors \n");
 +
  fwrite($handle, "load /usr/local/apache/sites/Toronto.doc \n");
 +
  fwrite($handle, "save /tmp/toronto1.html \n");
 +
  pclose($handler);

Current revision as of 13:18, 27 November 2010

Thunderbird Convenience


PHP Example

The PHP example using AbiCommand floating around the web did not function for me using Fedora 13, PHP 5.3, AbiWord 2.8.6

It was missing line endings, and that resulted in concatenation of all of the commands and failure to load the file.

Here is the original example code:

 $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 fputs($handle, "server");
 fputs($handle, "load /usr/local/apache/sites/Toronto.doc");
 fputs($handle, "save /tmp/toronto1.html");

Here is the corrected code with Linux-style line endings, a corrected "server" command (was missing an argument), using fwrite() instead of its alias fputs(), and closing the resource at the end:

 $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 fwrite($handle, "server /tmp/abiword_errors \n");
 fwrite($handle, "load /usr/local/apache/sites/Toronto.doc \n");
 fwrite($handle, "save /tmp/toronto1.html \n");
 pclose($handler);
Personal tools