Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
5c5966aa
Commit
5c5966aa
authored
Jul 12, 2017
by
Marco Pivetta
Committed by
GitHub
Jul 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2776 from AlessandroMinoccheri/fix_array_in_sharding_dir
Use short array declarations
parents
a55b83ea
8e72d1ee
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
PoolingShardConnection.php
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
+1
-1
PoolingShardManager.php
lib/Doctrine/DBAL/Sharding/PoolingShardManager.php
+3
-3
SQLAzureFederationsSynchronizer.php
...BAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
+3
-3
SQLAzureShardManager.php
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
+2
-2
MultiTenantVisitor.php
...rine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php
+3
-3
No files found.
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
View file @
5c5966aa
...
...
@@ -236,7 +236,7 @@ class PoolingShardConnection extends Connection
{
$params
=
$this
->
getParams
();
$driverOptions
=
isset
(
$params
[
'driverOptions'
])
?
$params
[
'driverOptions'
]
:
array
()
;
$driverOptions
=
isset
(
$params
[
'driverOptions'
])
?
$params
[
'driverOptions'
]
:
[]
;
$connectionParams
=
$this
->
connections
[
$shardId
];
...
...
lib/Doctrine/DBAL/Sharding/PoolingShardManager.php
View file @
5c5966aa
...
...
@@ -88,10 +88,10 @@ class PoolingShardManager implements ShardManager
public
function
getShards
()
{
$params
=
$this
->
conn
->
getParams
();
$shards
=
array
()
;
$shards
=
[]
;
foreach
(
$params
[
'shards'
]
as
$shard
)
{
$shards
[]
=
array
(
'id'
=>
$shard
[
'id'
])
;
$shards
[]
=
[
'id'
=>
$shard
[
'id'
]]
;
}
return
$shards
;
...
...
@@ -113,7 +113,7 @@ class PoolingShardManager implements ShardManager
throw
new
\RuntimeException
(
"No shards found."
);
}
$result
=
array
()
;
$result
=
[]
;
$oldDistribution
=
$this
->
getCurrentDistributionValue
();
foreach
(
$shards
as
$shard
)
{
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
View file @
5c5966aa
...
...
@@ -69,7 +69,7 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
*/
public
function
getCreateSchema
(
Schema
$createSchema
)
{
$sql
=
array
()
;
$sql
=
[]
;
list
(
$global
,
$federation
)
=
$this
->
partitionSchema
(
$createSchema
);
...
...
@@ -234,7 +234,7 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
private
function
work
(
Schema
$schema
,
\Closure
$operation
)
{
list
(
$global
,
$federation
)
=
$this
->
partitionSchema
(
$schema
);
$sql
=
array
()
;
$sql
=
[]
;
$this
->
shardManager
->
selectGlobal
();
$globalSql
=
$operation
(
$this
->
synchronizer
,
$global
);
...
...
@@ -290,7 +290,7 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
private
function
getCreateFederationStatement
()
{
$federationType
=
Type
::
getType
(
$this
->
shardManager
->
getDistributionType
());
$federationTypeSql
=
$federationType
->
getSQLDeclaration
(
array
()
,
$this
->
conn
->
getDatabasePlatform
());
$federationTypeSql
=
$federationType
->
getSQLDeclaration
(
[]
,
$this
->
conn
->
getDatabasePlatform
());
return
"--Create Federation
\n
"
.
"CREATE FEDERATION "
.
$this
->
shardManager
->
getFederationName
()
.
" ("
.
$this
->
shardManager
->
getDistributionKey
()
.
" "
.
$federationTypeSql
.
" RANGE)"
;
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
View file @
5c5966aa
...
...
@@ -198,14 +198,14 @@ class SQLAzureShardManager implements ShardManager
/**
* {@inheritDoc}
*/
public
function
queryAll
(
$sql
,
array
$params
=
array
(),
array
$types
=
array
()
)
public
function
queryAll
(
$sql
,
array
$params
=
[],
array
$types
=
[]
)
{
$shards
=
$this
->
getShards
();
if
(
!
$shards
)
{
throw
new
\RuntimeException
(
"No shards found for "
.
$this
->
federationName
);
}
$result
=
array
()
;
$result
=
[]
;
$oldDistribution
=
$this
->
getCurrentDistributionValue
();
foreach
(
$shards
as
$shard
)
{
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php
View file @
5c5966aa
...
...
@@ -78,7 +78,7 @@ class MultiTenantVisitor implements Visitor
* @param string $tenantColumnName
* @param string|null $distributionName
*/
public
function
__construct
(
array
$excludedTables
=
array
()
,
$tenantColumnName
=
'tenant_id'
,
$distributionName
=
null
)
public
function
__construct
(
array
$excludedTables
=
[]
,
$tenantColumnName
=
'tenant_id'
,
$distributionName
=
null
)
{
$this
->
excludedTables
=
$excludedTables
;
$this
->
tenantColumnName
=
$tenantColumnName
;
...
...
@@ -94,9 +94,9 @@ class MultiTenantVisitor implements Visitor
return
;
}
$table
->
addColumn
(
$this
->
tenantColumnName
,
$this
->
tenantColumnType
,
array
(
$table
->
addColumn
(
$this
->
tenantColumnName
,
$this
->
tenantColumnType
,
[
'default'
=>
"federation_filtering_value('"
.
$this
->
distributionName
.
"')"
,
)
);
]
);
$clusteredIndex
=
$this
->
getClusteredIndex
(
$table
);
...
...
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