$sourceFile))); } $viewFile = $this->getViewFile($sourceFile); if (@filemtime($sourceFile) > @filemtime($viewFile)) { $this->generateViewFile($sourceFile, $viewFile); @chmod($viewFile, $this->filePermission); } return $context->renderInternal($viewFile, $data, $return); } /** * Generates the resulting view file path. * @param string $file source view file path * @return string resulting view file path */ protected function getViewFile($file) { if ($this->useRuntimePath) { $crc = sprintf('%x', crc32(get_class($this) . Yii::getVersion() . dirname($file))); $viewFile = Yii::app()->getRuntimePath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $crc . DIRECTORY_SEPARATOR . basename($file); if (!is_file($viewFile)) { @mkdir(dirname($viewFile), $this->filePermission, true); } return $viewFile; } else { return $file . 'c'; } } }