Skip to content

Commit 18ca974

Browse files
Augustin Delaporteweaverryan
Augustin Delaporte
authored andcommitted
Fix coding standards #2
Thanks @wouterj and @stof
1 parent 29988aa commit 18ca974

File tree

1 file changed

+25
-36
lines changed

1 file changed

+25
-36
lines changed

cookbook/deployment/platformsh.rst

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ Prepare Your Application
2525

2626
To deploy your Symfony application on Platform.sh, you simply need to add a
2727
``.platform.app.yaml`` at the root of your Git repository which will tell
28-
Platform.sh how to deploy your application (read more about `Platform.sh
29-
configuration files`_).
28+
Platform.sh how to deploy your application (read more about
29+
`Platform.sh configuration files`_).
3030

3131
.. code-block:: yaml
3232
3333
# .platform.app.yaml
34+
3435
# This file describes an application. You can have multiple applications
3536
# in the same project.
3637
3738
# The name of this app. Must be unique within a project.
38-
name: php
39+
name: myphpproject
3940
4041
# The toolstack used to build the application.
4142
toolstack: "php:symfony"
@@ -98,27 +99,27 @@ following file:
9899

99100
.. code-block:: php
100101
101-
# app/config/parameters_platform.php
102+
// app/config/parameters_platform.php
102103
<?php
103104
$relationships = getenv("PLATFORM_RELATIONSHIPS");
104-
if (!$relationships) {
105-
return;
105+
if (!$relationships) {
106+
return;
106107
}
107108
108-
$relationships = json_decode(base64_decode($relationships), TRUE);
109+
$relationships = json_decode(base64_decode($relationships), true);
109110
110111
foreach ($relationships['database'] as $endpoint) {
111-
if (empty($endpoint['query']['is_master'])) {
112-
continue;
113-
}
114-
115-
$container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']);
116-
$container->setParameter('database_host', $endpoint['host']);
117-
$container->setParameter('database_port', $endpoint['port']);
118-
$container->setParameter('database_name', $endpoint['path']);
119-
$container->setParameter('database_user', $endpoint['username']);
120-
$container->setParameter('database_password', $endpoint['password']);
121-
$container->setParameter('database_path', '');
112+
if (empty($endpoint['query']['is_master'])) {
113+
continue;
114+
}
115+
116+
$container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']);
117+
$container->setParameter('database_host', $endpoint['host']);
118+
$container->setParameter('database_port', $endpoint['port']);
119+
$container->setParameter('database_name', $endpoint['path']);
120+
$container->setParameter('database_user', $endpoint['username']);
121+
$container->setParameter('database_password', $endpoint['password']);
122+
$container->setParameter('database_path', '');
122123
}
123124
124125
# Store session into /tmp.
@@ -140,11 +141,12 @@ command that you see on the Platform.sh web UI):
140141

141142
.. code-block:: bash
142143
143-
$ git remote add platform [PROJECT-ID]@git.[CLUSTER].platform.sh:[PROJECT].git
144-
144+
$ git remote add platform [PROJECT-ID]@git.[CLUSTER].platform.sh:[PROJECT-ID].git
145145
146-
* PROJECT-ID: Unique identifier of your project. Something like: *kjh43kbobssae*.
147-
* CLUSTER: Server location where your project is deployed. It can be *eu* or *us*.
146+
``PROJECT-ID``
147+
Unique identifier of your project. Something like ``kjh43kbobssae``
148+
``CLUSTER``
149+
Server location where your project is deplyed. It can be ``eu`` or ``us``
148150

149151
Commit the Platform.sh specific files created in the previous section:
150152

@@ -158,20 +160,7 @@ Push your code base to the newly added remote:
158160

159161
.. code-block:: bash
160162
161-
$ git push -u platform master
162-
163-
Counting objects: 27, done.
164-
Delta compression using up to 4 threads.
165-
Compressing objects: 100% (11/11), done.
166-
Writing objects: 100% (16/16), 2.47 KiB | 0 bytes/s, done.
167-
Total 16 (delta 7), reused 12 (delta 5)
168-
169-
Processing activity environment.push
170-
Found 213 new commits.
171-
172-
Building application 'php' with toolstack 'php:symfony' (tree: 2248cf8)
173-
Found a `composer.json`, installing dependencies.
174-
...
163+
$ git push platform master
175164
176165
That's it! Your application is being deployed on Platform.sh and you'll soon be
177166
able to access it in your browser.

0 commit comments

Comments
 (0)