Multi.Dictionary object can be also used to share variables inside one php application, with the same functionality as Application object in ASP. You can use the COM object as hi-performance memory cache, for example.
Application scope dictionary in PHP | |
---|---|
//on begin of request $Application = New COM("Multi.Dictionary"); $Application->connect("App"); //call the application dictionary function getUri ($categoryId) { global $Application; $out = $Application['cu'.$categoryId]; if (empty($out)){ global $db; $qSelect = $db->query("SELECT categoryURL FROM Categories WHERE categoryId=$categoryId"); $vSelect = $db->fetchRow($qSelect); $out = $vSelect['categoryURL']; $Application['cu'.$categoryId]=$out; } return $out; } |
Free-threaded (multithreaded) dictionary object. Lets you work with unique/non-unique keys in VBScript and JScript envinronment (share application/session variables in ASP) or any other programming language. You can share dictionary variables between processes or computers, you can save or restore dictionary variables to a disk, work with keys using regular expression and more.
© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz