@@ -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)
{
...
...
@@ -256,40 +265,6 @@ class Application extends Module
}
/**
* 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.
die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
die("Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n");
$db=$this->getDbConnection();
// try mark up
$migrations=$this->getNewMigrations();
foreach($migrationsas$i=>$migration)
{
if(strpos($migration,$version.'_')===0)
{
if($this->confirm("Set migration history at $originalVersion?"))
{
$command=$db->createCommand();
for($j=0;$j<=$i;++$j)
{
$command->insert($this->migrationTable,array(
'version'=>$migrations[$j],
'apply_time'=>time(),
));
}
echo"The migration history is set at $originalVersion.\nNo actual migration was performed.\n";
die("Error: CMigrationCommand.connectionID '{$this->connectionID}' is invalid. Please make sure it refers to the ID of a CDbConnection application component.\n");