Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_official / html / includes [ view in CVS ]
Date | Directory [filter] | File(s) [view] | Author [filter] |
27 Jul 2002 00:27:24 | postnuke_official/html/includes | pnMod.php,1.42.2.2,1.42.2.3 | Mike |
some performance improvement |
Update of /home/cvsroot/postnuke_official/html/includes In directory ns7.hostnuke.net:/tmp/cvs-serv18940 Modified Files: Tag: PostNuke_71 pnMod.php Log Message: some performance improvement Index: pnMod.php =================================================================== RCS file: /home/cvsroot/postnuke_official/html/includes/pnMod.php,v retrieving revision 1.42.2.2 retrieving revision 1.42.2.3 diff -C2 -d -r1.42.2.2 -r1.42.2.3 *** pnMod.php 11 Jun 2002 23:54:50 -0000 1.42.2.2 --- pnMod.php 27 Jul 2002 00:27:22 -0000 1.42.2.3 *************** *** 36,46 **** function pnModGetVar($modname, $name) { - list($dbconn) = pnDBGetConn(); - $pntable = pnDBGetTables(); - if ((empty($modname)) || (empty($name))) { return false; } $modulevarstable = $pntable['module_vars']; $modulevarscolumn = &$pntable['module_vars_column']; --- 36,51 ---- function pnModGetVar($modname, $name) { if ((empty($modname)) || (empty($name))) { return false; } + global $pnmodvar; + if (isset($pnmodvar[$modname][$name])) { + return $pnmodvar[$modname][$name]; + } + + list($dbconn) = pnDBGetConn(); + $pntable = pnDBGetTables(); + $modulevarstable = $pntable['module_vars']; $modulevarscolumn = &$pntable['module_vars_column']; *************** *** 56,59 **** --- 61,65 ---- if ($result->EOF) { + $pnmodvar[$modname][$name] = false; return; } *************** *** 62,65 **** --- 68,72 ---- $result->Close(); + $pnmodvar[$modname][$name] = $value; return $value; } *************** *** 74,84 **** function pnModSetVar($modname, $name, $value) { - list($dbconn) = pnDBGetConn(); - $pntable = pnDBGetTables(); - if ((empty($modname)) || (empty($name))) { return false; } $curvar = pnModGetVar($modname, $name); --- 81,91 ---- function pnModSetVar($modname, $name, $value) { if ((empty($modname)) || (empty($name))) { return false; } + list($dbconn) = pnDBGetConn(); + $pntable = pnDBGetTables(); + $curvar = pnModGetVar($modname, $name); *************** *** 107,110 **** --- 114,119 ---- } + global $pnmodvar; + $pnmodvar[$modname][$name] = $value; return true; } *************** *** 119,129 **** function pnModDelVar($modname, $name) { - list($dbconn) = pnDBGetConn(); - $pntable = pnDBGetTables(); - if ((empty($modname)) || (empty($name))) { return false; } $modulevarstable = $pntable['module_vars']; $modulevarscolumn = &$pntable['module_vars_column']; --- 128,138 ---- function pnModDelVar($modname, $name) { if ((empty($modname)) || (empty($name))) { return false; } + list($dbconn) = pnDBGetConn(); + $pntable = pnDBGetTables(); + $modulevarstable = $pntable['module_vars']; $modulevarscolumn = &$pntable['module_vars_column']; *************** *** 137,140 **** --- 146,153 ---- } + global $pnmodvar; + if (isset($pnmodvar[$modname][$name])) { + unset($pnmodvar[$modname][$name]); + } return true; } *************** *** 147,157 **** function pnModGetIDFromName($module) { - list($dbconn) = pnDBGetConn(); - $pntable = pnDBGetTables(); - if (empty($module)) { return false; } $modulestable = $pntable['modules']; $modulescolumn = &$pntable['modules_column']; --- 160,175 ---- function pnModGetIDFromName($module) { if (empty($module)) { return false; } + static $modid = array(); + if (isset($modid[$module])) { + return $modid[$module]; + } + + list($dbconn) = pnDBGetConn(); + $pntable = pnDBGetTables(); + $modulestable = $pntable['modules']; $modulescolumn = &$pntable['modules_column']; *************** *** 166,169 **** --- 184,188 ---- if ($result->EOF) { + $modid[$module] = false; return false; } *************** *** 172,175 **** --- 191,195 ---- $result->Close(); + $modid[$module] = $id; return $id; } *************** *** 188,191 **** --- 208,216 ---- } + static $modinfo = array(); + if (isset($modinfo[$modid])) { + return $modinfo[$modid]; + } + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); *************** *** 209,212 **** --- 234,238 ---- if ($result->EOF) { + $modinfo[$modid] = false; return false; } *************** *** 221,224 **** --- 247,251 ---- $result->Close(); + $modinfo[$modid] = $resarray; return $resarray; } *************** *** 671,674 **** --- 698,710 ---- } + static $modstate = array(); + if (isset($modstate[$modname])) { + if ($modstate[$modname] == _PNMODULE_STATE_ACTIVE) { + return true; + } else { + return false; + } + } + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); *************** *** 686,689 **** --- 722,726 ---- if ($result->EOF) { + $modstate[$modname] = _PNMODULE_STATE_MISSING; return false; } *************** *** 692,695 **** --- 729,733 ---- $result->Close(); + $modstate[$modname] = $state; if ($state == _PNMODULE_STATE_ACTIVE) { return true; *************** *** 877,879 **** } ! ?> \ No newline at end of file --- 915,917 ---- } ! ?>
View Statistics - Next Notice - Previous Notice
Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |