/**
  * Import all files that need to be included(for lazy loading)
  * @param $event
  */
 public function handleImports($event)
 {
     try {
         $filesToInclude = GeneralCache::getEntry('filesToIncludeForTests');
     } catch (NotFoundException $e) {
         $filesToInclude = FileUtil::getFilesFromDir(Yii::app()->basePath . '/modules', Yii::app()->basePath . '/modules', 'application.modules', true);
         $filesToIncludeFromFramework = FileUtil::getFilesFromDir(Yii::app()->basePath . '/core', Yii::app()->basePath . '/core', 'application.core', true);
         $totalFilesToIncludeFromModules = count($filesToInclude);
         foreach ($filesToIncludeFromFramework as $key => $file) {
             $filesToInclude[$totalFilesToIncludeFromModules + $key] = $file;
         }
         GeneralCache::cacheEntry('filesToIncludeForTests', $filesToInclude);
     }
     foreach ($filesToInclude as $file) {
         Yii::import($file);
     }
 }
 /**
  * Import all files that need to be included(for lazy loading)
  * @param $event
  */
 public function handleImports($event)
 {
     //Clears file cache so that everything is clean.
     if (isset($_GET['clearCache']) && $_GET['clearCache'] == 1) {
         GeneralCache::forgetEntry('filesClassMap');
     }
     try {
         // not using default value to save cpu cycles on requests that follow the first exception.
         Yii::$classMap = GeneralCache::getEntry('filesClassMap');
     } catch (NotFoundException $e) {
         $filesToInclude = FileUtil::getFilesFromDir(Yii::app()->basePath . '/modules', Yii::app()->basePath . '/modules', 'application.modules');
         $filesToIncludeFromCore = FileUtil::getFilesFromDir(Yii::app()->basePath . '/core', Yii::app()->basePath . '/core', 'application.core');
         $totalFilesToIncludeFromModules = count($filesToInclude);
         foreach ($filesToIncludeFromCore as $key => $file) {
             $filesToInclude[$totalFilesToIncludeFromModules + $key] = $file;
         }
         foreach ($filesToInclude as $file) {
             Yii::import($file);
         }
         GeneralCache::cacheEntry('filesClassMap', Yii::$classMap);
     }
     Yii::app()->setAllClassesAreImported();
 }