/** * @return string */ public function getCacheDir() { if (!isset($this->cache_dir)) { $this->cache_dir = Application::current()->getCacheDir() . '/compiled'; Files::mkdir($this->cache_dir); } return $this->cache_dir; }
/** * Gets temporary file name, or write content into a temporary file name and get this name if not * set or file does not exist * * @return string */ private function getTemporaryFileName() { if (isset($this->content) && (empty($this->temporary_file_name) || !file_exists($this->temporary_file_name))) { if (empty($this->temporary_file_name)) { $this->temporary_file_name = Application::current()->getTemporaryFilesPath() . SL . uniqid() . '_' . $this->name; } if (strpos($this->temporary_file_name, SL) !== false) { Files::mkdir(lLastParse($this->temporary_file_name, SL)); } file_put_contents($this->temporary_file_name, $this->content); } return $this->temporary_file_name; }