Browse Source

Added "@runtime" and "@vendor" aliases.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
22357befad
  1. 4
      extensions/smarty/yii/smarty/ViewRenderer.php
  2. 2
      extensions/twig/yii/twig/ViewRenderer.php
  3. 8
      framework/yii/base/Application.php
  4. 2
      framework/yii/caching/FileCache.php

4
extensions/smarty/yii/smarty/ViewRenderer.php

@ -26,12 +26,12 @@ class ViewRenderer extends BaseViewRenderer
/**
* @var string the directory or path alias pointing to where Smarty cache will be stored.
*/
public $cachePath = '@app/runtime/Smarty/cache';
public $cachePath = '@runtime/Smarty/cache';
/**
* @var string the directory or path alias pointing to where Smarty compiled templates will be stored.
*/
public $compilePath = '@app/runtime/Smarty/compile';
public $compilePath = '@runtime/Smarty/compile';
/**
* @var Smarty

2
extensions/twig/yii/twig/ViewRenderer.php

@ -25,7 +25,7 @@ class ViewRenderer extends BaseViewRenderer
/**
* @var string the directory or path alias pointing to where Twig cache will be stored.
*/
public $cachePath = '@app/runtime/Twig/cache';
public $cachePath = '@runtime/Twig/cache';
/**
* @var array Twig options

8
framework/yii/base/Application.php

@ -102,11 +102,17 @@ class Application extends Module
Yii::setAlias('@app', $this->getBasePath());
unset($config['basePath']);
if (isset($config['vendor'])) {
$this->setVendorPath($config['vendor']);
unset($config['vendorPath']);
}
Yii::setAlias('@vendor', $this->getVendorPath());
if (isset($config['runtime'])) {
$this->setRuntimePath($config['runtime']);
unset($config['runtime']);
}
Yii::setAlias('@app/runtime', $this->getRuntimePath());
Yii::setAlias('@runtime', $this->getRuntimePath());
if (isset($config['timeZone'])) {
$this->setTimeZone($config['timeZone']);

2
framework/yii/caching/FileCache.php

@ -27,7 +27,7 @@ class FileCache extends Cache
* @var string the directory to store cache files. You may use path alias here.
* If not set, it will use the "cache" subdirectory under the application runtime path.
*/
public $cachePath = '@app/runtime/cache';
public $cachePath = '@runtime/cache';
/**
* @var string cache file suffix. Defaults to '.bin'.
*/

Loading…
Cancel
Save