2012-01-03 4 views
2

symfony2는 app \ cache 폴더에 캐시를 유지합니다.symfony 캐시 기본 폴더 경로

다른 경로로 변경하는 방법이 있습니까?

도움 주셔서 감사합니다.

답변 : 이것에 대한 Aurelijus Valeiša에

감사합니다!

나는이 같은 (AppKernel.php에) 메소드를 추가 않았다

public function getCacheDir() 
{ 
    // Remove whole method if you want to go back to the original cache folder 
    return 'c:/Users/Mike/Documents/www/cache/'.$this->environment; 
} 

당신이 로그가이 방법을 추가 폴더와 동일한 작업을 수행하려면 다음

public function getLogDir() 
{ 
    // Remove whole method if you want to go back to the original log folder 
    return 'c:/Users/Mike/Documents/www/logs'; 
} 

모두 그 메모를 확인을 방법은 단지 원래 덮어 심포니 \ 구성 요소에서 생성되는 \ 커널 클래스 \

답변

4

예, app/AppKernel.php 파일 재정 getCacheDir() 방법 (0에서 정의 HttpKernel). 예를 들어, 확장 된 AppKernel 클래스에서 다음을 가질 수 있습니다.

public function getCacheDir() 
{ 
    return $this->rootDir.'/superduper_cache/'.$this->environment; 
}