ort_plugindecode
ort_plugindecode.php is a script that allows you to decode a Textpattern plugin in order to get a source .php file you can edit and modify and then compile using the standard zem_tpl.
It has two different modes: command line mode works from the command line (just like zem_tpl does). Web mode works in a php enabled web server and you can invoke it from a standard browser.
Command line usage
There are three different ways to invoke the script from the command line (the php command must be in your executable path):
php ort_plugindecode.php compiled_plugin.txt decoded_plugin.php
This way, the decoder takes the ‘compiled_plugin.txt’ input file and outputs the decoded php source a file named ‘decoded_plugin.php’php ort_plugindecode.php compiled_plugin.txt
If you omit the output file name, the file will be created based in the plugin name contained within the plugin itself ($plugin['name']).
php ort_plugindecode.php <compiled_plugin.txt
Alternatively, you can provide the input file in standard input. In this case the output file name will also be generated based on the plugin name.
NOTE: The standard input mode will no longer work in version 2.0
Web mode usage
Upload ort_plugindecode.php to a php enabled web server (like the one where you run Textpattern).
Invoke the script in a web browser (e.g. if your web server is www.example.net and you put the script in the root of that web server you will see it in a browser in http://www.example.net/ort_plugindecode.php).
This will show you a little table where you can either browse your local machine for the compiled plugin file, or paste the compiled plugin code in a small window.
There is a live sample (which you can use and don’t even bother to download and install this tool) at http://ybab.net/textpattern_plugins/ort_plugindecode.php
History
This tool was inspired by this forum thread.
Martín Laudati is a student in the Instituto de Tecnología ORT and, when asked to find a project to develop a plugin for Textpattern, which he had to do to pass the course Seminario de Aplicaciones, he chose not to do a plugin but rather a plugin decoder.
Initially the decoder only worked on-line in a browser, but I asked him to generate also a command line utility, he combined both in one.
Coming soon
Walter Mir, Martín Zeni and Iván de Miguel, students of the first semester 2008, are working on version 2.0 which will become a Textpattern plugin so that you’ll get the same functionality from the admin interface (of course, the two original modes will continue to work as always (the first triple play plugin) :-)









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.