Commit 4325c5a62b49f8ca1f6bfd0a4e7eb34865cab5cb

Authored by nbm
1 parent 3233b61c

Silence a bunch of PHP Notice-level warnings to make it easier to

understand when real problems are happening (and reduce logging
overhead).


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6030 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 9 additions and 7 deletions
lib/ktentity.inc
... ... @@ -583,7 +583,7 @@ class KTEntityUtil {
583 583 }
584 584 $aRet = array();
585 585 foreach ($aIDs as $iId) {
586   - $aRet[] =& call_user_func(array($sClassName, 'get'), $iId);
  586 + $aRet[] = call_user_func(array($sClassName, 'get'), $iId);
587 587 }
588 588 return $aRet;
589 589 }
... ... @@ -726,20 +726,22 @@ class KTEntityUtil {
726 726 }
727 727  
728 728 $allcode[] = sprintf('function &_fetch() {
729   - $oObject =& KTUtil::arrayGet($GLOBALS["_OBJECTCACHE"][%s], $this->iId);
730   - if ($oObject) { return $oObject; }
  729 + if (!empty($GLOBALS["_OBJECTCACHE"]["%s"][$this->iId])) {
  730 + $oObject =& $GLOBALS["_OBJECTCACHE"]["%s"][$this->iId];
  731 + return $oObject;
  732 + }
731 733 $oObject =& new %s;
732 734 $res = $oObject->load($this->iId);
733 735 if (PEAR::isError($res)) {
734 736 return $res;
735 737 }
736   - $GLOBALS["_OBJECTCACHE"][%s][$this->iId] =& $oObject;
  738 + $GLOBALS["_OBJECTCACHE"]["%s"][$this->iId] =& $oObject;
737 739 return $oObject;
738 740 }
739   - ', $sClassName, $sClassName, $sClassName);
  741 + ', $sClassName, $sClassName, $sClassName, $sClassName);
740 742  
741   - $allcode[] = sprintf('function &_save(&$oObject) {
742   - $GLOBALS["_OBJECTCACHE"][%s][$this->iId] =& $oObject;
  743 + $allcode[] = sprintf('function _save(&$oObject) {
  744 + $GLOBALS["_OBJECTCACHE"]["%s"][$this->iId] =& $oObject;
743 745 }
744 746 ', $sClassName);
745 747  
... ...