public static function forgetAllCaches()
 {
     RedBeanModelsCache::forgetAll();
     RedBeansCache::forgetAll();
     PermissionsCache::forgetAll();
     RightsCache::forgetAll();
     PoliciesCache::forgetAll();
     GeneralCache::forgetAll();
     BeanModelCache::forgetAll();
     Currency::resetCaches();
     //php only cache
 }
 protected static function resolveCacheAndMapMetadataForAllClassesInHeirarchy()
 {
     try {
         // not using default value to save cpu cycles on requests that follow the first exception.
         $cachedData = BeanModelCache::getEntry(self::CACHE_IDENTIFIER . get_called_class());
         static::resolveCachedMetadataForIntegrity($cachedData);
         self::$attributeNamesToClassNames[get_called_class()] = $cachedData['attributeNamesToClassNames'][get_called_class()];
         self::$attributeNamesNotBelongsToOrManyMany[get_called_class()] = $cachedData['attributeNamesNotBelongsToOrManyMany'][get_called_class()];
         self::$relationNameToRelationTypeModelClassNameAndOwns[get_called_class()] = $cachedData['relationNameToRelationTypeModelClassNameAndOwns'][get_called_class()];
         self::$derivedRelationNameToTypeModelClassNameAndOppposingRelation[get_called_class()] = $cachedData['derivedRelationNameToTypeModelClassNameAndOppposingRelation'][get_called_class()];
     } catch (NotFoundException $e) {
         self::mapMetadataForAllClassesInHeirarchy();
         $cachedData = array();
         $cachedData['attributeNamesToClassNames'][get_called_class()] = self::$attributeNamesToClassNames[get_called_class()];
         $cachedData['attributeNamesNotBelongsToOrManyMany'][get_called_class()] = self::$attributeNamesNotBelongsToOrManyMany[get_called_class()];
         $cachedData['relationNameToRelationTypeModelClassNameAndOwns'][get_called_class()] = self::$relationNameToRelationTypeModelClassNameAndOwns[get_called_class()];
         $cachedData['derivedRelationNameToTypeModelClassNameAndOppposingRelation'][get_called_class()] = self::$derivedRelationNameToTypeModelClassNameAndOppposingRelation[get_called_class()];
         BeanModelCache::cacheEntry(self::CACHE_IDENTIFIER . get_called_class(), $cachedData);
     }
 }
Exemple #3
0
 protected static function resolveCacheAndMapMetadataForAllClassesInHeirarchy()
 {
     try {
         $cachedData = BeanModelCache::getEntry(self::CACHE_IDENTIFIER . get_called_class());
         self::$attributeNamesToClassNames[get_called_class()] = $cachedData['attributeNamesToClassNames'][get_called_class()];
         self::$attributeNamesNotBelongsToOrManyMany[get_called_class()] = $cachedData['attributeNamesNotBelongsToOrManyMany'][get_called_class()];
         self::$relationNameToRelationTypeModelClassNameAndOwns[get_called_class()] = $cachedData['relationNameToRelationTypeModelClassNameAndOwns'][get_called_class()];
         self::$derivedRelationNameToTypeModelClassNameAndOppposingRelation[get_called_class()] = $cachedData['derivedRelationNameToTypeModelClassNameAndOppposingRelation'][get_called_class()];
     } catch (NotFoundException $e) {
         self::mapMetadataForAllClassesInHeirarchy();
         $cachedData = array();
         $cachedData['attributeNamesToClassNames'][get_called_class()] = self::$attributeNamesToClassNames[get_called_class()];
         $cachedData['attributeNamesNotBelongsToOrManyMany'][get_called_class()] = self::$attributeNamesNotBelongsToOrManyMany[get_called_class()];
         $cachedData['relationNameToRelationTypeModelClassNameAndOwns'][get_called_class()] = self::$relationNameToRelationTypeModelClassNameAndOwns[get_called_class()];
         $cachedData['derivedRelationNameToTypeModelClassNameAndOppposingRelation'][get_called_class()] = self::$derivedRelationNameToTypeModelClassNameAndOppposingRelation[get_called_class()];
         BeanModelCache::cacheEntry(self::CACHE_IDENTIFIER . get_called_class(), $cachedData);
     }
 }
Exemple #4
0
 public static function tearDownAfterClass()
 {
     if (static::$activateDefaultLanguages) {
         Yii::app()->languageHelper->deactivateLanguagesForTesting();
     }
     TestDatabaseUtil::deleteRowsFromAllTablesExceptLog();
     PermissionsCache::forgetAll();
     AllPermissionsOptimizationCache::forgetAll();
     RedBeanModel::forgetAll();
     RedBeanDatabase::close();
     assert('!RedBeanDatabase::isSetup()');
     // Not Coding Standard
     GeneralCache::forgetAll();
     BeanModelCache::forgetAll();
 }