168169170171172173174175176177178179180181182183184185186 $file = $path . DIRECTORY_SEPARATOR . $name; $fp = fopen($file, 'w'); $replaced = $this->makeReplace($output); $output = str_replace(Yii::$app->request->getCsrfToken(), 'Bj4RLGDsZcWQdCNE3H32icvHDUOsMo6tbNaKnYYqsftsUmNZUdwCt-IRaxurO4LcrvVaNttRwMEEns_43x73zg==', $output); $output = str_replace(["\n","\r","\t"], '', $output); if (!$fp) { throw new Exception('Directory ' . $file . ' does not exists or does not have write permission'); } fwrite($fp, $output); fclose($fp); Yii::$app->assetManager->publish(__DIR__ . DIRECTORY_SEPARATOR, true, 1); return $replaced; } /** * Get cache file name for this controller, action and set of params * * @param Controller $controller