SmartPHP.net
29th March 2003
SmartPHP.net has some useful looking classes, including SmartTemplate (like Smarty but much simpler to use) and SmartCache, a very intelligent caching class that can be used to cache data objects as well as the output from whole pages. The example given caches a database query using the SQL statement as a unique cache key:
require_once "class.smartcache.php"; $query = "select * from ... where ..."; $data = new SmartCache( $query ); if (!$result = $data->read( 120 )) // Reuse only 120 Seconds { result = $db->exec( $query ); // Read DB Result ... $data->write( $result ); // Store result }
More recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024