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
29b26232
Commit
29b26232
authored
Jun 25, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Coding Standard Violations and other cleanups
parent
fbc1341d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
18 deletions
+12
-18
bootstrap.php
docs/examples/sharding/bootstrap.php
+1
-1
SingleDatabaseSynchronizer.php
...e/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizer.php
+3
-3
PoolingShardConnection.php
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
+4
-4
SQLAzureFederationsSynchronizer.php
...BAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
+4
-5
SQLAzureShardManager.php
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
+0
-5
No files found.
docs/examples/sharding/bootstrap.php
View file @
29b26232
...
...
@@ -3,7 +3,7 @@
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\Shards\DBAL\SQLAzure\SQLAzureShardManager
;
require_once
"vendor/
composer/
autoload.php"
;
require_once
"vendor/autoload.php"
;
$config
=
array
(
'dbname'
=>
'SalesDB'
,
...
...
lib/Doctrine/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizer.php
View file @
29b26232
...
...
@@ -74,9 +74,9 @@ class SingleDatabaseSynchronizer implements SchemaSynchronizer
if
(
$noDrops
)
{
return
$schemaDiff
->
toSaveSql
(
$this
->
platform
);
}
else
{
return
$schemaDiff
->
toSql
(
$this
->
platform
);
}
return
$schemaDiff
->
toSql
(
$this
->
platform
);
}
/**
...
...
@@ -146,7 +146,7 @@ class SingleDatabaseSynchronizer implements SchemaSynchronizer
public
function
getDropAllSchema
()
{
$sm
=
$this
->
conn
->
getSchemaManager
();
$visitor
=
new
\Doctrine\DBAL\Schema\Visitor\
DropSchemaSqlCollector
(
$this
->
platform
);
$visitor
=
new
DropSchemaSqlCollector
(
$this
->
platform
);
/* @var $schema \Doctrine\DBAL\Schema\Schema */
$schema
=
$sm
->
createSchema
();
...
...
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
View file @
29b26232
...
...
@@ -82,7 +82,7 @@ class PoolingShardConnection extends Connection
private
$connections
;
/**
* @var
Pooling
ShardManager
* @var ShardManager
*/
private
$shardManager
;
...
...
@@ -192,7 +192,7 @@ class PoolingShardConnection extends Connection
public
function
isConnected
(
$shardId
=
null
)
{
if
(
$shardId
===
null
)
{
return
(
$this
->
_conn
!==
null
)
;
return
$this
->
_conn
!==
null
;
}
return
isset
(
$this
->
activeConnections
[
$shardId
]);
...
...
@@ -200,8 +200,8 @@ class PoolingShardConnection extends Connection
public
function
close
()
{
unset
(
$this
->
_conn
)
;
unset
(
$this
->
activeConnections
)
;
$this
->
_conn
=
null
;
$this
->
activeConnections
=
null
;
}
}
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php
View file @
29b26232
...
...
@@ -30,7 +30,7 @@ use Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer;
* SQL Azure Schema Synchronizer
*
* Will iterate over all shards when performing schema operations. This is done
* by partioning the passed schema into subschemas for the federation and the
* by parti
ti
oning the passed schema into subschemas for the federation and the
* global database and then applying the operations step by step using the
* {@see \Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer}.
*
...
...
@@ -38,6 +38,9 @@ use Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer;
*/
class
SQLAzureFederationsSynchronizer
implements
SchemaSynchronizer
{
const
FEDERATION_TABLE_FEDERATED
=
'azure.federated'
;
const
FEDERATION_DISTRIBUTION_NAME
=
'azure.federatedOnDistributionName'
;
/**
* @var Connection
*/
...
...
@@ -53,9 +56,6 @@ class SQLAzureFederationsSynchronizer implements SchemaSynchronizer
*/
private
$synchronizer
;
const
FEDERATION_TABLE_FEDERATED
=
'azure.federated'
;
const
FEDERATION_DISTRIBUTION_NAME
=
'azure.federatedOnDistributionName'
;
public
function
__construct
(
Connection
$conn
,
SQLAzureShardManager
$shardManager
,
SchemaSynchronizer
$sync
=
null
)
{
$this
->
conn
=
$conn
;
...
...
@@ -63,7 +63,6 @@ class SQLAzureFederationsSynchronizer implements SchemaSynchronizer
$this
->
synchronizer
=
$sync
?:
new
SingleDatabaseSynchronizer
(
$conn
);
}
/**
* Get the SQL statements that can be executed to create the schema.
*
...
...
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
View file @
29b26232
...
...
@@ -129,7 +129,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public
function
selectGlobal
()
...
...
@@ -144,7 +143,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public
function
selectShard
(
$distributionValue
)
...
...
@@ -171,7 +169,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public
function
getCurrentDistributionValue
()
...
...
@@ -180,7 +177,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public
function
getShards
()
...
...
@@ -196,7 +192,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public
function
queryAll
(
$sql
,
array
$params
=
array
(),
array
$types
=
array
())
...
...
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