Hi!
All of this work will be happening on my local machine or a LAN server which does little else. I can deal with the CPU consumption.
I see, now this all makes much more sense.
I could probably wade through the s9y code myself, and waste a few hours creating my own proprietary version. I'm betting someone else out there has some use for this software, which is why I ask how to write a plugin for this.
Actually writing a plugin for this will not be easy. Let me explain.
The reason is that the easiest place to put this feature is within our DB layer. You can find the functions in include/db/mysql.inc.php for example. Basically all you need to do is alter the serendipity_db_query(), serendipity_db_connect() and serendipity_db_schema_import() functions.
I must admit I haven't looked at the mysql encryption features, but they must be able to be placed there. You would need to modify the $query for each query to encrypt/decrypt data and write (or use) a parser for that data.
Now you could hook in your own plugin into this by making this decode/encode pass in a plugin. For this you could patch the serendipity_db_query() function like this:
Code: Select all
// Allow plugins to modify the query:
serendipity_plugin_api::hook_event('db_query', $sql);
if ($expectError) {
$c = @mysql_query($sql, $serendipity['dbConn']);
} else {
$c = mysql_query($sql, $serendipity['dbConn']);
}
Then your plugins could parse and modify $sql.
And now the reason why this isn't good/easy: Every call to a plugin hook costs performance, even if no plugins are executed in the queue stack. That'S because s9y has to query each plugin, if it wants to execute the hook. That means, for every DB Query s9y would have to query toe plugin API which would make it terribly slow even without plugins using it.
That's the reason why we cannot include that patch in the distribution on this place.
Another way for this to be "transportable" would be to write your own DB abstraction layer, just how we did layers for mysqli, postgresql and sqlite. Just add a file "mysql_encoded" and you could put all your en/decryption features into that file.
If this isn't something you guys would find valuable to have, let me know and I guess I will hack it myself.

I do think it's a nice and nifty feature for your isolated causes, and I would like to offer such functionality. But I myself don't have the time to dig into this, so if you're willing to do the work, that would be great! If you need help or have questions, feel free to ask!
Best regards,
Garvin