Skip to content

Instantly share code, notes, and snippets.

<?php
function parse( $inputFiles = false, $iniFile = false, $reset = true, $placement = false )
{
// ...
$files = array( 'site.ini', 'file.ini' );
if ( in_array( $this->FileName, $files ) )
{
$relationships = getenv('PLATFORM_RELATIONSHIPS');
if ( $relationships !== false )
hooks:
build: |
...
curl -sS https://platform.sh/cli/installer | php
....
export PLATFORMSH_CLI_TOKEN=`echo $PLATFORM_VARIABLES | base64 --decode | json_pp | grep PLATFORMSH_CLI_TOKEN | awk '{print $3}' | sed -e 's/"//g' -e 's/,$//'`
TOKEN=`echo $PLATFORM_VARIABLES | base64 --decode | json_pp | grep PLATFORMSH_CLI_TOKEN | awk '{print $3}' | sed -e 's/"//g' -e 's/,$//'`
export PLATFORMSH_CLI_TOKEN=$TOKEN
platform snapshot:create -e master -y -W -q
crons:
snapshot:
spec: '0 */3 * * *'
cmd: 'bash platformsh/bin/bash/snapshot.sh'
crons:
snapshot:
spec: '0 */3 * * *'
cmd: 'bash snapshot.sh'
UPDATE ezcontentobject_attribute SET data_text = REPLACE(data_text, 'xmlns:xhtml="', 'xmlns:xhtml=“');
if [ $PLATFORM_BRANCH != "master" ]; then
exit 0
fi
# platform project:variable:set env:DEPLOY_BLACKOUTS '07:00-12:00;15:20-17:00;22:30-04:00'
TimeSpansString=$DEPLOY_BLACKOUTS
CurrentTime=`expr $(date +%H%M) + 0`
TimeSpans=$(echo $TimeSpansString | tr ";" "\n")
for TimeSpanString in $TimeSpans
hooks:
build: |
curl -sS https://platform.sh/cli/installer | php
...
bash check_deploy_blackouts.sh
# Example:
# platformsh-clone-project contextualcode 4wch6kq727uzs
platformsh-clone-project() {
cd ~/www
git clone [email protected]:contextualcode/$1.git
cd $1
git remote add platform [email protected]:$2.git
}
platformsh-ssh() {