/**
  * Searches for languagesets containing the current systemid. either as a language or a referenced record.
  * Called whenever a records was deleted using the common methods.
  * Implement this method to be notified when a record is deleted, e.g. to to additional cleanups afterwards.
  * There's no need to register the listener, this is done automatically.
  * Make sure to return a matching boolean-value, otherwise the transaction may be rolled back.
  *
  * @param string $strEventName
  * @param array $arrArguments
  *
  * @return bool
  */
 public function handleEvent($strEventName, array $arrArguments)
 {
     $objChangelog = new class_module_system_changelog();
     return $objChangelog->processCachedInserts();
 }
コード例 #2
0
 public function testPerformance()
 {
     $objChanges = new class_module_system_changelog();
     $objChanges->processCachedInserts();
     $intFired = class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache();
     for ($intI = 0; $intI < 100; $intI++) {
         $objChanges->createLogEntry(new dummyObject(generateSystemid()), "1");
         $objChanges->processCachedInserts();
     }
     $intFiredAfter = class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache();
     $this->assertTrue($intFiredAfter - $intFired >= 100);
     echo "Queries: " . ($intFiredAfter - $intFired) . "\n";
     $intFired = class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache();
     $objChanges = new class_module_system_changelog();
     for ($intI = 0; $intI < 100; $intI++) {
         $objChanges->createLogEntry(new dummyObject(generateSystemid()), "1");
     }
     $objChanges->processCachedInserts();
     $intFiredAfter = class_carrier::getInstance()->getObjDB()->getNumber() - class_carrier::getInstance()->getObjDB()->getNumberCache();
     $this->assertTrue($intFiredAfter - $intFired < 10);
     echo "Queries: " . ($intFiredAfter - $intFired) . "\n";
 }
コード例 #3
0
ファイル: class_carrier.php プロジェクト: jinshana/kajonacms
 /**
  * A general helper to flush the systems various caches.
  *
  * @param int $intCacheType A bitmask of caches to be flushed, e.g. class_carrier::INT_CACHE_TYPE_DBQUERIES | class_carrier::INT_CACHE_TYPE_ORMCACHE
  */
 public function flushCache($intCacheType = 0)
 {
     if ($intCacheType & self::INT_CACHE_TYPE_DBQUERIES) {
         $this->getObjDB()->flushQueryCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_DBSTATEMENTS) {
         $this->getObjDB()->flushPreparedStatementsCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_DBTABLES) {
         $this->getObjDB()->flushTablesCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_ORMCACHE) {
         class_orm_rowcache::flushCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_OBJECTFACTORY) {
         class_objectfactory::getInstance()->flushCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_MODULES) {
         class_module_system_module::flushCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_CLASSLOADER) {
         class_classloader::getInstance()->flushCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_APC) {
         class_apc_cache::getInstance()->flushCache();
     }
     if ($intCacheType & self::INT_CACHE_TYPE_CHANGELOG) {
         $objChangelog = new class_module_system_changelog();
         $objChangelog->processCachedInserts();
     }
 }