private function getCSSPathname($path) { if (preg_match('/\\.min\\.css$/', $path)) { return $path; } $altPath = Yii::getRootPath() . preg_replace('/\\.css$/', '.min.css', $path); if (!YII_DEBUG && file_exists($altPath)) { return preg_replace('/\\.css$/', '.min.css', $path); } else { return $path; } }
private function getCSSPathname($path) { if (preg_match('/\\.min\\.css$/', $path)) { return $path; } $fileName = str_replace('/', DIRECTORY_SEPARATOR, str_replace(Yii::app()->baseUrl, '', $path)); $altPath = Yii::getRootPath() . preg_replace('/\\.css(\\?\\d+)?$/', '.min.css', $fileName); if (!YII_DEBUG && file_exists($altPath)) { return preg_replace('/\\.css(\\?\\d+)?$/', '.min.css\\1', $path); } else { return $path; } }
public function actionLicense() { $this->headerTitle = Yii::t('mobile', 'License'); $basePath = Yii::getRootPath(); $filename = implode(DIRECTORY_SEPARATOR, array($basePath, 'LICENSE.txt')); $fh = fopen($filename, 'r'); $license = fread($fh, filesize($filename)); $license = preg_replace('/\\n/', '<br>', $license); fclose($fh); $this->render('license', array('license' => $license)); }