PHPackages                             ttree/flowplatformsh - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ttree/flowplatformsh

ActiveNeos-package[Utility &amp; Helpers](/categories/utility)

ttree/flowplatformsh
====================

Platform.sh for Flow Framework made easy

1.1.4(7y ago)51.9k31MITPHPPHP ^7.1

Since Jun 28Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ttreeagency/FlowPlatformSh)[ Packagist](https://packagist.org/packages/ttree/flowplatformsh)[ RSS](/packages/ttree-flowplatformsh/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (18)Used By (1)

Platform.sh for Flow Framework made easy
========================================

[](#platformsh-for-flow-framework-made-easy)

Flow framework utility package to parse Platform.sh variables

Configure your distribution to deploy on Platform.sh
----------------------------------------------------

[](#configure-your-distribution-to-deploy-on-platformsh)

```
composer require ttree/flowplatformsh
./flow platform:bootstrap --id fajq56c55mc5s --host eu.platform.sh --database MySQL|PostgreSQL

```

Check and modify the configuration to match your project:

- `.platform/`
- `.platform.app.yaml`
- `.platform.env`

Run a command during Build or Deploy hook
-----------------------------------------

[](#run-a-command-during-build-or-deploy-hook)

You can run any Flow CLI commands during build or deploy hook. Remember that during Build hook you don't have access to services (database, cache, ...). This the default configuration:

```
Ttree:
  FlowPlatformSh:
    buildHooks:
      commands:
        'flow:package:rescan': true
    deployHooks:
      commands:
        'flow:cache:flush': true
        'flow:cache:warmup': true
        'flow:doctrine:migrate': true

```

You can set the value to `false` to disable a command. If the value is an array, the array is passed as command arguments:

```
Ttree:
  FlowPlatformSh:
   deployHooks:
     commands:
      'ttree.neosplatformsh:platform:createadminaccount':
        username: 'admin'
        password: 'changeme'
      'ttree.neosplatformsh:platform:importsitepackage':
        package: 'Neos.Demo'

```

Check that your `.platform.app.yaml` execute `php flow platform:build` and `php flow platform:build` in the respective hook.

You can use a custom FLOW\_CONTEXT during the build hook to avoid issue when Flow try to connect to redis cache, like this `.platform.app.yaml`:

```
variables:
  env:
    FLOW_CONTEXT: 'Production/PlatformSh'
    FLOW_PATH_TEMPORARY_BASE: '/tmp'
    FLOW_REWRITEURLS: 1

hooks:
  build: |
	set -e
	export FLOW_CONTEXT=${FLOW_CONTEXT}Build
	php flow platform:build
  deploy: |
	set -e
	php flow platform:deploy

```

Check the command controller in [Ttree.NeosPlatformSh](https://github.com/ttreeagency/NeosPlatformSh).

How to configure `.platform.env`
--------------------------------

[](#how-to-configure-platformenv)

This file extract variables from `PLATFORM_RELATIONSHIPS` and create env variables that you can use in your configuration (`Settings.yaml`, `Caches.yaml`, ...). Every line contains the variable name and the path to get the variable content from `PLATFORM_RELATIONSHIPS`.

```
DATABASE_HOST = database.0.host
DATABASE_PORT = database.0.port
DATABASE_NAME = database.0.path
DATABASE_USER = database.0.username
DATABASE_PASSWORD = database.0.password

REDIS_HOST = redis.0.host
REDIS_PORT = redis.0.port

REDIS_ALTERNATIVE_HOST = redis.1.host
REDIS_ALTERNATIVE_PORT = redis.1.port

ELASTICSEARCH_HOST = elasticsearch.0.host
ELASTICSEARCH_PORT = elasticsearch.0.port

```

Then you can edit your `Settings.yaml` to use the new env variables:

```
Neos:
  Flow:
    persistence:
      backendOptions:
        driver: pdo_pgsql
        dbname: '%env:DATABASE_NAME%'
        port: '%env:DATABASE_PORT%'
        user: '%env:DATABASE_USER%'
        password: '%env:DATABASE_PASSWORD%'
        host: '%env:DATABASE_HOST%'

```

Push local data to platform.sh
------------------------------

[](#push-local-data-to-platformsh)

You can sync a local project data (resources and databases) to platform with the following command:

```
./flow platform:push --directory Data/Persistent --publish --database --migrate --environment master

```

You can provide the path to your local `.platform.app.yaml` with the paramater `--configuration`.

The options `--publish` run the resources publishing after the rsync command on the remote server.

The options `--database` and `--migrate` clone the local database and run migration on the remote server.

The options `--snapshot` create a snapshot of the current platform environement before the synchronzation.

The options `--environment`, default `master`, allow to target specific platform environment.

The options `--flush` flush all remote caches after the synchronization.

The options `--dry-run` preview the commands and execute nothing.

The options `--yes` non interactive mode.

**Warning**: Currently we push only files and databases, if you use ElasticSearch you need to rebuild the index manually.

You should see this output:

```
Local -> platform.sh

    + Create Snapshot
    + Sync directory Data/Persistent
    + Publish resources
    + Clone database
    + Migrate database

```

Pull data from platform.sh to your local setup
----------------------------------------------

[](#pull-data-from-platformsh-to-your-local-setup)

You can sync a local project data (resources and databases) from a platform environment with the following command:

```
./flow platform:pull --directory Data/Persistent --publish --database --migrate --environment master

```

You can provide the path to your local `.platform.app.yaml` with the paramater `--configuration`.

The options `--publish` run the resources publishing after the rsync command on the remote server.

The options `--database` and `--migrate` clone the remote database and run migration on the local server.

The options `--environment`, default `master`, allow to target specific platform environment.

The options `--flush` flush all local caches after the synchronization.

The options `--dry-run` preview the commands and execute nothing.

The options `--yes` non interactive mode.

**Warning**: Currently we pull only files and databases, if you use ElasticSearch you need to rebuild the index manually.

You should see this output:

```
platform.sh -> Local

    + Sync directory Data/Persistent
    + Publish resources
    + Clone database
    + Migrate database
    + Flush all caches

```

### I use docker locally to host my database, the push command failed

[](#i-use-docker-locally-to-host-my-database-the-push-command-failed)

You can use a custom dump command, by editing your `Settings.yaml`, by example for PostgreSQL:

```
Ttree:
  FlowPlatformSh:
    commands:
      push:
        dump:
          pgsql:
            '*': 'docker exec -e "PGPASSWORD=@PASSWORD@" -t [docker-container-name] pg_dump -c -b -d @DBNAME@ -U @USER@ > Data/Temporary/PlatformShDump-@ENVIRONMENT@.sql'
      pull:
        restore:
          pgsql:
            '*': 'cat Data/Temporary/PlatformShDump-@ENVIRONMENT@.sql | docker exec -e "PGPASSWORD=@PASSWORD@" -i [docker-container-name] psql --host=@HOST@ -U@USER@ @DBNAME@'

```

Replace `[docker-container-name]` by the name or the identifier of the PostgreSQL container.

Acknowledgments
---------------

[](#acknowledgments)

Development sponsored by [ttree ltd - neos solution provider](http://ttree.ch).

We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~122 days

Total

17

Last Release

2709d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/145363?v=4)[ttree](/maintainers/ttree)[@ttree](https://github.com/ttree)

---

Top Contributors

[![dfeyer](https://avatars.githubusercontent.com/u/221173?v=4)](https://github.com/dfeyer "dfeyer (34 commits)")[![sebastiansommer](https://avatars.githubusercontent.com/u/1651774?v=4)](https://github.com/sebastiansommer "sebastiansommer (1 commits)")

### Embed Badge

![Health badge](/badges/ttree-flowplatformsh/health.svg)

```
[![Health](https://phpackages.com/badges/ttree-flowplatformsh/health.svg)](https://phpackages.com/packages/ttree-flowplatformsh)
```

###  Alternatives

[josegonzalez/dotenv

dotenv file parsing for PHP

28010.4M158](/packages/josegonzalez-dotenv)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.2M34](/packages/neos-eel)[neos/fusion-form

Fusion Form

19776.4k41](/packages/neos-fusion-form)[neos/form

Extensible and flexible API for building web forms

18876.7k54](/packages/neos-form)[neos/media

The Media package

101.2M51](/packages/neos-media)[avency/neos-vardump

Neos VarDump Package

147.1k](/packages/avency-neos-vardump)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
