@@ -205,7 +214,7 @@ class Application extends Module
publicfunctionsetRuntimePath($path)
{
if(!is_dir($path)||!is_writable($path)){
thrownew\yii\base\Exception("Application runtime path \"$path\" is invalid. Please make sure it is a directory writable by the Web server process.");
thrownewException("Application runtime path \"$path\" is invalid. Please make sure it is a directory writable by the Web server process.");
}
$this->_runtimePath=$path;
}
...
...
@@ -226,7 +235,7 @@ class Application extends Module
* By default, [[language]] and [[sourceLanguage]] are the same.
* Do not set this property unless your application needs to support multiple languages.
* @param string $language the user language (e.g. 'en_US', 'zh_CN').
* If it is null, the {@link sourceLanguage} will be used.
* If it is null, the [[sourceLanguage]] will be used.
*/
publicfunctionsetLanguage($language)
{
...
...
@@ -255,40 +264,6 @@ class Application extends Module
date_default_timezone_set($value);
}
/**
* Returns the localized version of a specified file.
*
* The searching is based on the specified language code. In particular,
* a file with the same name will be looked for under the subdirectory
* named as the locale ID. For example, given the file "path/to/view.php"
* and locale ID "zh_cn", the localized file will be looked for as
* "path/to/zh_cn/view.php". If the file is not found, the original file
* will be returned.
*
* For consistency, it is recommended that the locale ID is given
* in lower case and in the format of LanguageID_RegionID (e.g. "en_us").
*
* @param string $srcFile the original file
* @param string $srcLanguage the language that the original file is in. If null, the application {@link sourceLanguage source language} is used.
* @param string $language the desired language that the file should be localized to. If null, the {@link getLanguage application language} will be used.
* @return string the matching localized file. The original file is returned if no localized version is found
* or if source language is the same as the desired language.