Renamed application to app.

This commit is contained in:
Qiang Xue
2013-02-05 16:12:22 -05:00
parent fcf3f2c893
commit 8b2b7915b4
37 changed files with 87 additions and 86 deletions

View File

@ -55,7 +55,7 @@ class HelpController extends Controller
public function actionIndex($command = null)
{
if ($command !== null) {
$result = Yii::$application->createController($command);
$result = Yii::$app->createController($command);
if ($result === false) {
throw new Exception(Yii::t('yii|No help for unknown command "{command}".', array(
'{command}' => $command,
@ -81,7 +81,7 @@ class HelpController extends Controller
*/
public function getCommands()
{
$commands = $this->getModuleCommands(Yii::$application);
$commands = $this->getModuleCommands(Yii::$app);
sort($commands);
return array_unique($commands);
}

View File

@ -70,7 +70,7 @@ class MigrateController extends Controller
* @var string the directory storing the migration classes. This can be either
* a path alias or a directory.
*/
public $migrationPath = '@application/migrations';
public $migrationPath = '@app/migrations';
/**
* @var string the name of the table for keeping applied migration information.
*/
@ -82,7 +82,7 @@ class MigrateController extends Controller
public $connectionID = 'db';
/**
* @var string the template file for generating new migrations.
* This can be either a path alias (e.g. "@application/migrations/template.php")
* This can be either a path alias (e.g. "@app/migrations/template.php")
* or a file path.
*/
public $templateFile = '@yii/views/migration.php';
@ -121,7 +121,7 @@ class MigrateController extends Controller
}
$this->migrationPath = $path;
$this->db = Yii::$application->getComponent($this->connectionID);
$this->db = Yii::$app->getComponent($this->connectionID);
if (!$this->db instanceof Connection) {
throw new Exception("Invalid DB connection \"{$this->connectionID}\".");
}
@ -150,7 +150,7 @@ class MigrateController extends Controller
{
if (($migrations = $this->getNewMigrations()) === array()) {
echo "No new migration found. Your system is up-to-date.\n";
Yii::$application->end();
Yii::$app->end();
}
$total = count($migrations);
@ -576,7 +576,7 @@ class MigrateController extends Controller
if ($this->db !== null) {
return $this->db;
} else {
$this->db = Yii::$application->getComponent($this->connectionID);
$this->db = Yii::$app->getComponent($this->connectionID);
if ($this->db instanceof Connection) {
return $this->db;
} else {