public function cacheThemeConfig($return=false)
	{
		$themes = $this->getThemesFromDb();
		$arrayTheme = array();

		foreach($themes as $theme) {
			if(!in_array($theme->folder, $arrayTheme))
				$arrayTheme[] = $theme->folder;
		}

		if($return == false) {
			$filePath   = Yii::getPathOfAlias('application.config');
			$fileHandle = fopen($filePath.'/cache_theme.php', 'w');
			fwrite($fileHandle, implode("\n", $arrayTheme));
			fclose($fileHandle);

		} else 
			return $arrayTheme;
	}
public function cacheThemeConfig($return=false)
	{
		$themes = $this->getThemesFromDb();
		$arrayTheme = array();

		foreach($themes as $theme) {
			if(!in_array($theme->folder, $arrayTheme))
				$arrayTheme[] = $theme->folder;
		}

		if($return == false) {
			$filePath   = Yii::getPathOfAlias('application.config');
			$fileHandle = fopen($filePath.'/cache_theme.php', 'w');
			fwrite($fileHandle, implode("\n", $arrayTheme));
			fclose($fileHandle);

		} else 
			return $arrayTheme;
	}
public function cacheThemeConfig ( $ return = false ) { $ themes = $ this -> getThemesFromDb ( ) ; $ arrayTheme = array ( ) ; foreach ( $ themes as $ theme ) { if ( ! in_array ( $ theme -> folder , $ arrayTheme ) ) $ arrayTheme [ ] = $ theme -> folder ; } if ( $ return == false ) { $ filePath = Yii :: getPathOfAlias ( 'application.config' ) ; $ fileHandle = fopen ( $ filePath . '/cache_theme.php' , 'w' ) ; fwrite ( $ fileHandle , implode ( "\n" , $ arrayTheme ) ) ; fclose ( $ fileHandle ) ; } else return $ arrayTheme ; }
Cache theme dari database ke bentuk file.
Untuk mengurangi query pada saat install ke database.
Cache theme dari database ke bentuk file . Untuk mengurangi query pada saat install ke database .