bootstrap.php 690 B

1234567891011121314151617181920212223242526
  1. <?php
  2. // bootstrap.php
  3. use Doctrine\DBAL\DriverManager;
  4. use Doctrine\Shards\DBAL\SQLAzure\SQLAzureShardManager;
  5. require_once "vendor/autoload.php";
  6. $config = array(
  7. 'dbname' => 'SalesDB',
  8. 'host' => 'tcp:dbname.windows.net',
  9. 'user' => 'user@dbname',
  10. 'password' => 'XXX',
  11. 'sharding' => array(
  12. 'federationName' => 'Orders_Federation',
  13. 'distributionKey' => 'CustId',
  14. 'distributionType' => 'integer',
  15. )
  16. );
  17. if ($config['host'] == "tcp:dbname.windows.net") {
  18. die("You have to change the configuration to your Azure account.\n");
  19. }
  20. $conn = DriverManager::getConnection($config);
  21. $shardManager = new SQLAzureShardManager($conn);