|
|
|
@ -211,8 +211,6 @@ class AssetManager extends Component
|
|
|
|
|
$this->basePath = Yii::getAlias($this->basePath); |
|
|
|
|
if (!is_dir($this->basePath)) { |
|
|
|
|
throw new InvalidConfigException("The directory does not exist: {$this->basePath}"); |
|
|
|
|
} elseif (!is_writable($this->basePath)) { |
|
|
|
|
throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$this->basePath = realpath($this->basePath); |
|
|
|
@ -427,7 +425,7 @@ class AssetManager extends Component
|
|
|
|
|
* discussion: http://code.google.com/p/yii/issues/detail?id=2579 |
|
|
|
|
* |
|
|
|
|
* @param string $path the asset (file or directory) to be published |
|
|
|
|
* @param array $options the options to be applied when publishing a directory. |
|
|
|
|
* @param array $options the options to be applied when publishing a directory. |
|
|
|
|
* The following options are supported: |
|
|
|
|
* |
|
|
|
|
* - only: array, list of patterns that the file paths should match if they want to be copied. |
|
|
|
@ -443,6 +441,7 @@ class AssetManager extends Component
|
|
|
|
|
* |
|
|
|
|
* @return array the path (directory or file path) and the URL that the asset is published as. |
|
|
|
|
* @throws InvalidArgumentException if the asset to be published does not exist. |
|
|
|
|
* @throws InvalidConfigException |
|
|
|
|
*/ |
|
|
|
|
public function publish($path, $options = []) |
|
|
|
|
{ |
|
|
|
@ -456,6 +455,10 @@ class AssetManager extends Component
|
|
|
|
|
throw new InvalidArgumentException("The file or directory to be published does not exist: $path"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!is_writable($this->basePath)) { |
|
|
|
|
throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (is_file($src)) { |
|
|
|
|
return $this->_published[$path] = $this->publishFile($src); |
|
|
|
|
} |
|
|
|
|