/** * Gets the full path of the file. * * @param IExportPolicy $policy * @param CDbCriteriaBuilder $builder * @return string */ public function getFileName(IExportPolicy $policy, CDbCriteriaBuilder $builder) { $fullpath = $this->basePath; foreach ($policy->getExportPathHierarchy($builder) as $dirname) { $fullpath .= DIRECTORY_SEPARATOR . $dirname; if (!is_dir($fullpath)) { if (!@mkdir($fullpath)) { throw new CException(Yii::t('export.CFileWriter', 'The given path "{path}" is not writable.', array('{path}' => $fullpath))); } } } $fullpath .= DIRECTORY_SEPARATOR . $policy->getExportedFilename($builder) . '.' . $policy->getFormat()->getFileExtension(); return $fullpath; }