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

@ -96,7 +96,7 @@ class ActiveRecord extends Model
*/
public static function getDb()
{
return \Yii::$application->getDb();
return \Yii::$app->getDb();
}
/**

View File

@ -387,7 +387,7 @@ class Command extends \yii\base\Component
/** @var $cache \yii\caching\Cache */
if ($db->enableQueryCache && $method !== '') {
$cache = \Yii::$application->getComponent($db->queryCacheID);
$cache = \Yii::$app->getComponent($db->queryCacheID);
}
if (isset($cache)) {

View File

@ -51,7 +51,7 @@ class Migration extends \yii\base\Component
{
parent::init();
if ($this->db === null) {
$this->db = \Yii::$application->getComponent('db');
$this->db = \Yii::$app->getComponent('db');
}
}

View File

@ -117,7 +117,7 @@ class Query extends \yii\base\Component
public function createCommand($db = null)
{
if ($db === null) {
$db = \Yii::$application->db;
$db = \Yii::$app->db;
}
$sql = $db->getQueryBuilder()->build($this);
return $db->createCommand($sql, $this->params);

View File

@ -87,7 +87,7 @@ abstract class Schema extends \yii\base\Object
$realName = $this->getRealTableName($name);
/** @var $cache Cache */
if ($db->enableSchemaCache && ($cache = \Yii::$application->getComponent($db->schemaCacheID)) !== null && !in_array($name, $db->schemaCacheExclude, true)) {
if ($db->enableSchemaCache && ($cache = \Yii::$app->getComponent($db->schemaCacheID)) !== null && !in_array($name, $db->schemaCacheExclude, true)) {
$key = $this->getCacheKey($cache, $name);
if ($refresh || ($table = $cache->get($key)) === false) {
$table = $this->loadTableSchema($realName);
@ -171,7 +171,7 @@ abstract class Schema extends \yii\base\Object
public function refresh()
{
/** @var $cache \yii\caching\Cache */
if ($this->db->enableSchemaCache && ($cache = \Yii::$application->getComponent($this->db->schemaCacheID)) !== null) {
if ($this->db->enableSchemaCache && ($cache = \Yii::$app->getComponent($this->db->schemaCacheID)) !== null) {
foreach ($this->_tables as $name => $table) {
$cache->delete($this->getCacheKey($cache, $name));
}