Bug #2256 [NEW]: Translation2 Cache flushing/write update

From: Date: Tue, 31 Aug 2004 03:10:51 +0000
Subject: Bug #2256 [NEW]: Translation2 Cache flushing/write update
Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-3038@lists.php.net to get a copy of this message
From: matthewh at meta-bit dot com Operating system: WinXP PHP version: 4.3.6 Package: Bug System Bug Type: Bug Bug description: Translation2 Cache flushing/write update Description: ------------ The current Translation2 Decorator CacheMemory, does not provide a facility to flush/purge the cache. This is required in order to re-read strings after the Translation2_Admin class has added,updated or removed a string. A similar flush method should possibly be provided on the CacheLiteFunction Translation2 Decorator too. For example, allowing invocation of the underlying CacheLite::clean() method. Reproduce code: --------------- // Init. an Admin + Cache. $admin =& new Translation2_Admin( .... ); $translation2 =& $translation2->getDecorator('CacheMemory'); // Retrieve something...[populates cache] $initialString = $translation2->get( $id, $page, 'en' ); // Now update that string $dirtyList = array( 'en' => 'new '); // Update dbase.. $admin->add( $id, $page, $dirtyList ); // Dbase + Cache are now out of sync. $staleString = $translation2->get( $id, $page, 'en' ); // assert: $staleString != 'new' // Want to be able to do this - flush the cache... $translation2->flush( $page, 'en' ); $correctString = $translation2->get( $id, $page, 'en' ); // assert: $correctString == 'new' -------------------------------------------------------- Similarly, a Translation2_Decorator_CacheLiteFunction instance could delegate the flush() to the underlying clean() method within its CacheLiteFunction member. Expected result: ---------------- * After flushing the cache, the given page of strings are cleared. * Subsequent retrieves from the cache populate it with the newly updated strings. Actual result: -------------- * Currently, once the strings are loaded into the CacheMemory decorator, there's no way to clear the cache and re-read them after an update/addition/removal of a string. * Same applies with Translation2_Decorator_CacheLiteFunction - no easy way to flush/purge cache. -- Edit bug report at http://pear.php.net/bugs/bug.php?id=2256&edit=1 --

« previous php.pear.webmaster (#3038) next »