Permalink
Browse files

Update documentation with PHP SDK services

  • Loading branch information...
beberlei committed Nov 18, 2012
1 parent 3e86820 commit a1442333abd62c41ddece0b6ee8d2aae538d8099
@@ -43,6 +43,12 @@ public function load(array $configs, ContainerBuilder $container)
$this->loadServices($config, $container);
}
+ /**
+ * Create services from PHP Azure SDK (Blob, Table, Queue, ServiceManagement, ServiceBus).
+ *
+ * @param array $config
+ * @param ContainerBuilder $container
+ */
protected function loadServices($config, $container)
{
if ( ! isset($config['services'])) {
@@ -10,7 +10,7 @@ Cloud-Services put constraints on how an application is allowed to run on their
* Command for packaging applications for Windows Azure (Done)
* Startup tasks for cache:clear/cache:warmup are invoked for new instances. (Done)
* Writing cache and log-files into a writable directory. (Done)
-* Distributed sessions
+* Distributed sessions
* PDO (Done)
* Azure Table
* Specific 'azure' environment that is inherits from prod. (Done)
@@ -1,59 +0,0 @@
----
-title: Blob Storage
-layout: default
----
-
-# Blob Storage
-
-The Windows Azure Distribution Bundle comes with support for accessing Windows Blob Storage.
-This can be done using the [Azure Blob Storage](http://github.com/beberlei/aure-blob-storage) library.
-This library is a dependency that you have install.
-
-You can configure blob storages from the config.yml (or config_azure.yml):
-
- windows_azure_distribution:
- blob_storage:
- test:
- accountName: myacc
- accountKey: key
- test_with_stream:
- accountName: myacc2
- accountKey: key2
- stream: azure
-
-There is not yet a mechanism to fallback to a local API if you dont want to hit
-blob storage during development, so you need to put the details into config.yml
-so it works in development.
-
-With this configuration you can access the blob storage accounts from your
-controllers (or any services) using the storage registry service:
-
- <?php
- namespace Vendor\AppBundle\Controller;
-
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
- class MyController extends Controller
- {
- public function indexAction()
- {
- $registry = $this->container->get('windows_azure_distribution.storage_registry');
- $client = $registry->get('test');
- $client2 = $registry->get('test2');
-
- $streamFile = 'azure://container/test.jpg';
- $data = file_get_contents($streamFile);
- }
- }
-
-# Filesystem
-
-Symfony ships with a filesystem API that is very convenient to use for some mass-operations.
-Because some parts of it are incompatible with Azure Streams you can use a subclass of it
-provided by this bundle:
-
- <?php
-
- $filesystem = new \WindowsAzure\DistributionBundle\Filesystem\AzureFilesystem;
- $filesystem->mirror("dir/", "azure://dir");
-
@@ -0,0 +1,41 @@
+---
+layout: default
+title: PHP Azure SDK Services
+---
+
+# Registering PHP Azure SDK Services
+
+The new PHP SDK provides access to all service APIs of Windows
+Azure. The Windows Azure Distribution Bundle allows to
+conveniently register them with the Symfony Dependency Injection
+Container:
+
+ windows_azure_distribution:
+ services:
+ blob:
+ default: UseDevelopmentStorage=true
+ test2: DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
+ table:
+ default: UseDevelopmentStorage=true
+ test2: DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
+ queue:
+ default: UseDevelopmentStorage=true
+ test2: DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
+ service_bus:
+ default: Endpoint=[yourEndpoint];SharedSecretIssuer=[yourWrapAuthenticationName];SharedSecretValue=[yourWrapPassword]
+ management:
+ default: SubscriptionID=[yourSubscriptionId];CertificatePath=[filePathToYourCertificate]
+
+The connection strings for all services are using the exact same
+syntax as the PHP Azure SDK. See their [README](https://github.com/WindowsAzure/azure-sdk-for-php#getting-started-1)
+for more information.
+
+Defining the services like above creates services in the DIC with the naming pattern ``windows_azure.type.name``.
+In our case:
+
+* ``windows_azure.blob.default`` and ``windows_azure.blob.test2``.
+* ``windows_azure.table.default`` and ``windows_azure.table.test2``.
+* ``windows_azure.queue.default`` and ``windows_azure.queue.test2``.
+* ``windows_azure.service_bus.default``
+* ``windows_azure.management.default``
+
View
@@ -1,37 +0,0 @@
----
-title: Table Service
-layout: default
----
-
-# Table Service
-
-Note: Only works with Doctrine Common 2.2
-
-The Windows Azure Distribution bundle comes with support for accessing Windows Table Storage.
-This is done in combination with the [Doctrine KeyValueStore](http://github.com/doctrine/KeyValueStore)
-project.
-
-You can configure the table manager with:
-
- windows_azure_distribution:
- table:
- account: "acc"
- key: "key"
-
-If you configured the manager and installed the Doctrine Key Value Store project you can access the
-table manager with:
-
- <?php
- namespace Vendor\AppBundle\Controller;
-
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
- class MyController extends Controller
- {
- public function indexAction()
- {
- $manager = $this->container->get('windows_azure_distribution.table.manager');
- }
- }
-
-Table entities can be any objects in your project, no additional configuration is necessary. Just
View
@@ -58,8 +58,7 @@
<exec output="packaging.markdown" executable="git"><arg line="show master:Resources/docs/02_packaging.md" /></exec>
<exec output="session.markdown" executable="git"><arg line="show master:Resources/docs/03_session.md" /></exec>
<exec output="azure_env.markdown" executable="git"><arg line="show master:Resources/docs/04_azure_environment.md" /></exec>
- <exec output="storage.markdown" executable="git"><arg line="show master:Resources/docs/04_storage.md" /></exec>
- <exec output="table.markdown" executable="git"><arg line="show master:Resources/docs/05_table.md" /></exec>
+ <exec output="phpsdk.markdown" executable="git"><arg line="show master:Resources/docs/05_phpsdk.md" /></exec>
<exec output="sharding.markdown" executable="git"><arg line="show master:Resources/docs/06_sharding.md" /></exec>
<exec output="assets.markdown" executable="git"><arg line="show master:Resources/docs/07_assets.md" /></exec>
<exec output="logging.markdown" executable="git"><arg line="show master:Resources/docs/09_logging.md" /></exec>

0 comments on commit a144233

Please sign in to comment.