Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4bee9e84
Commit
4bee9e84
authored
Jan 08, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1852 from creocoder/activerecord-tablename-prefix-fixes
[WIP] ActiveRecord::tableName() hardcoded prefix fix
parents
d9dd7292
ecf7942a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
15 deletions
+15
-15
DbCache.php
framework/yii/caching/DbCache.php
+1
-1
MigrateController.php
framework/yii/console/controllers/MigrateController.php
+1
-1
ActiveRecord.php
framework/yii/db/ActiveRecord.php
+4
-3
Connection.php
framework/yii/db/Connection.php
+2
-3
DbMessageSource.php
framework/yii/i18n/DbMessageSource.php
+2
-2
DbTarget.php
framework/yii/log/DbTarget.php
+1
-1
DbManager.php
framework/yii/rbac/DbManager.php
+3
-3
DbSession.php
framework/yii/web/DbSession.php
+1
-1
No files found.
framework/yii/caching/DbCache.php
View file @
4bee9e84
...
@@ -63,7 +63,7 @@ class DbCache extends Cache
...
@@ -63,7 +63,7 @@ class DbCache extends Cache
* When using DbCache in a production server, we recommend you create a DB index for the 'expire'
* When using DbCache in a production server, we recommend you create a DB index for the 'expire'
* column in the cache table to improve the performance.
* column in the cache table to improve the performance.
*/
*/
public
$cacheTable
=
'
tbl_cache
'
;
public
$cacheTable
=
'
{{%cache}}
'
;
/**
/**
* @var integer the probability (parts per million) that garbage collection (GC) should be performed
* @var integer the probability (parts per million) that garbage collection (GC) should be performed
* when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance.
* when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance.
...
...
framework/yii/console/controllers/MigrateController.php
View file @
4bee9e84
...
@@ -73,7 +73,7 @@ class MigrateController extends Controller
...
@@ -73,7 +73,7 @@ class MigrateController extends Controller
/**
/**
* @var string the name of the table for keeping applied migration information.
* @var string the name of the table for keeping applied migration information.
*/
*/
public
$migrationTable
=
'
tbl_migration
'
;
public
$migrationTable
=
'
{{%migration}}
'
;
/**
/**
* @var string the template file for generating new migrations.
* @var string the template file for generating new migrations.
* This can be either a path alias (e.g. "@app/migrations/template.php")
* This can be either a path alias (e.g. "@app/migrations/template.php")
...
...
framework/yii/db/ActiveRecord.php
View file @
4bee9e84
...
@@ -177,13 +177,14 @@ class ActiveRecord extends BaseActiveRecord
...
@@ -177,13 +177,14 @@ class ActiveRecord extends BaseActiveRecord
/**
/**
* Declares the name of the database table associated with this AR class.
* Declares the name of the database table associated with this AR class.
* By default this method returns the class name as the table name by calling [[Inflector::camel2id()]]
* By default this method returns the class name as the table name by calling [[Inflector::camel2id()]]
* with prefix 'tbl_'. For example, 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes
* with prefix [[DbConnection::tablePrefix]]. For example if [[DbConnection::tablePrefix]] is 'tbl_',
* 'tbl_order_item'. You may override this method if the table is not named after this convention.
* 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes 'tbl_order_item'. You may override this method
* if the table is not named after this convention.
* @return string the table name
* @return string the table name
*/
*/
public
static
function
tableName
()
public
static
function
tableName
()
{
{
return
'
tbl_'
.
Inflector
::
camel2id
(
StringHelper
::
basename
(
get_called_class
()),
'_'
)
;
return
'
{{%'
.
Inflector
::
camel2id
(
StringHelper
::
basename
(
get_called_class
()),
'_'
)
.
'}}'
;
}
}
/**
/**
...
...
framework/yii/db/Connection.php
View file @
4bee9e84
...
@@ -219,10 +219,9 @@ class Connection extends Component
...
@@ -219,10 +219,9 @@ class Connection extends Component
/**
/**
* @var string the common prefix or suffix for table names. If a table name is given
* @var string the common prefix or suffix for table names. If a table name is given
* as `{{%TableName}}`, then the percentage character `%` will be replaced with this
* as `{{%TableName}}`, then the percentage character `%` will be replaced with this
* property value. For example, `{{%post}}` becomes `{{tbl_post}}` if this property is
* property value. For example, `{{%post}}` becomes `{{tbl_post}}`.
* set as `"tbl_"`.
*/
*/
public
$tablePrefix
;
public
$tablePrefix
=
'tbl_'
;
/**
/**
* @var array mapping between PDO driver names and [[Schema]] classes.
* @var array mapping between PDO driver names and [[Schema]] classes.
* The keys of the array are PDO driver names while the values the corresponding
* The keys of the array are PDO driver names while the values the corresponding
...
...
framework/yii/i18n/DbMessageSource.php
View file @
4bee9e84
...
@@ -68,11 +68,11 @@ class DbMessageSource extends MessageSource
...
@@ -68,11 +68,11 @@ class DbMessageSource extends MessageSource
/**
/**
* @var string the name of the source message table.
* @var string the name of the source message table.
*/
*/
public
$sourceMessageTable
=
'
tbl_source_message
'
;
public
$sourceMessageTable
=
'
{{%source_message}}
'
;
/**
/**
* @var string the name of the translated message table.
* @var string the name of the translated message table.
*/
*/
public
$messageTable
=
'
tbl_message
'
;
public
$messageTable
=
'
{{%message}}
'
;
/**
/**
* @var integer the time in seconds that the messages can remain valid in cache.
* @var integer the time in seconds that the messages can remain valid in cache.
* Use 0 to indicate that the cached data will never expire.
* Use 0 to indicate that the cached data will never expire.
...
...
framework/yii/log/DbTarget.php
View file @
4bee9e84
...
@@ -52,7 +52,7 @@ class DbTarget extends Target
...
@@ -52,7 +52,7 @@ class DbTarget extends Target
* of some queries about message levels and categories. Depending on your actual needs, you may
* of some queries about message levels and categories. Depending on your actual needs, you may
* want to create additional indexes (e.g. index on `log_time`).
* want to create additional indexes (e.g. index on `log_time`).
*/
*/
public
$logTable
=
'
tbl_log
'
;
public
$logTable
=
'
{{%log}}
'
;
/**
/**
* Initializes the DbTarget component.
* Initializes the DbTarget component.
...
...
framework/yii/rbac/DbManager.php
View file @
4bee9e84
...
@@ -41,15 +41,15 @@ class DbManager extends Manager
...
@@ -41,15 +41,15 @@ class DbManager extends Manager
/**
/**
* @var string the name of the table storing authorization items. Defaults to 'tbl_auth_item'.
* @var string the name of the table storing authorization items. Defaults to 'tbl_auth_item'.
*/
*/
public
$itemTable
=
'
tbl_auth_item
'
;
public
$itemTable
=
'
{{%auth_item}}
'
;
/**
/**
* @var string the name of the table storing authorization item hierarchy. Defaults to 'tbl_auth_item_child'.
* @var string the name of the table storing authorization item hierarchy. Defaults to 'tbl_auth_item_child'.
*/
*/
public
$itemChildTable
=
'
tbl_auth_item_child
'
;
public
$itemChildTable
=
'
{{%auth_item_child}
'
;
/**
/**
* @var string the name of the table storing authorization item assignments. Defaults to 'tbl_auth_assignment'.
* @var string the name of the table storing authorization item assignments. Defaults to 'tbl_auth_assignment'.
*/
*/
public
$assignmentTable
=
'
tbl_auth_assignment
'
;
public
$assignmentTable
=
'
{{%auth_assignment}}
'
;
private
$_usingSqlite
;
private
$_usingSqlite
;
...
...
framework/yii/web/DbSession.php
View file @
4bee9e84
...
@@ -65,7 +65,7 @@ class DbSession extends Session
...
@@ -65,7 +65,7 @@ class DbSession extends Session
* When using DbSession in a production server, we recommend you create a DB index for the 'expire'
* When using DbSession in a production server, we recommend you create a DB index for the 'expire'
* column in the session table to improve the performance.
* column in the session table to improve the performance.
*/
*/
public
$sessionTable
=
'
tbl_session
'
;
public
$sessionTable
=
'
{{%session}}
'
;
/**
/**
* Initializes the DbSession component.
* Initializes the DbSession component.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment