public function executeExtract($request) { if ($handle = opendir(sfConfig::get('app_w3s_web_themes_dir'))) { while (false !== ($file = readdir($handle))) { $currentFile = sfConfig::get('app_w3s_web_themes_dir') . DIRECTORY_SEPARATOR . $file; if (is_file($currentFile)) { $fileInfo = pathinfo($currentFile); if ($fileInfo['extension'] == 'zip') { if (w3sCommonFunctions::extractZipFile($currentFile, sfConfig::get('app_w3s_web_themes_dir'))) { unlink($currentFile); } } } } } closedir($handle); return $this->renderPartial('refresh'); }