If anything, the Zend framework demonstrates some good ways of performing useful tasks, and interfacing with the libraries. These methods could be adapted for (albeit cut down) for php4 and for the current modx. The Zend framework from what I have seen so far is much simpler than many other frameworks to actually use.
For example, the zend input filter class supplies a simple way for validating input. However provides whitelisting, blacklisting conditionals aswell.
Note: code isnt exact as on zend.
$postFilter = new Zend_Input_Filter($_POST);
$name = $postFilter->isAlpha('name');
$email = $postFilter->isEmail('email');
What an easy way to validate form input. Either the result is returned, or false, simple.
Another example is grabbing feeds(RSS, Atom, etc)
$channel = new Zend_Feed_Rss('http://rss.example.com/channelName');
Or how about sending HTML emails
<?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail->setBodyText('My Nice Test Text');
$mail->setBodyHtml('My Nice <b>Test</b> Text');
$mail->setFrom('[email protected]', 'Some Sender');
$mail->addTo('[email protected]', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send();
?>
Simplicity at its finest.
Coding is normally the easy part, whats difficult is making things simple enough to use without configuration, and flexible enough to address complex needs, Zend seems to be really addressing this with their framework.
I’m going to work on a few wrapper classes (like the input filter) for php4 that will use the same syntax.