<?php
$payload = json_decode('{"repository": {"website": "http://clients.namanyayg.com/davidado/asianfanfics", "fork": false, "name": "AsianFanfics", "scm": "git", "owner": "namanyayg", "absolute_url": "/namanyayg/asianfanfics/", "slug": "asianfanfics", "is_private": true}, "truncated": false, "commits": [{"node": "5741782e36cb", "files": [{"type": "removed", "file": "README.md"}], "raw_author": "Namanyay Goel <mail@namanyayg.com>", "utctimestamp": "2014-03-05 09:58:52+00:00", "author": "namanyayg", "timestamp": "2014-03-05 10:58:52", "raw_node": "5741782e36cbac80dc01bc3605eda95640a3f480", "parents": ["1d0a82c82718"], "branch": "master", "message": "Removed README\n", "revision": null, "size": -1}], "canon_url": "https://bitbucket.org", "user": "namanyayg"}');
$repo = $payload->repository;
echo "Hi!";
$payload = $_POST['payload'];
$repo = $payload->repo;
echo 'Deploying on ' . date('l jS \of F Y h:i:s A');
echo $payload == true;
echo $repo->owner === 'namanyayg';
echo strrpos($repo->absolute_url, 'namanyayg') == true;
if ( $payload == true && $repo->owner === 'namanyayg' && strrpos($repo->absolute_url, 'namanyayg') == true )
{
$url = str_replace('http://clients.namanyayg.com/', '', $repo->website);
$bitbucketurl = substr($repo->absolute_url, 1, -1);
echo 'True! ' . $url . $bitbucketurl;
$makeandcdcommand = 'mkdir ' . $url . ' && cd ' . $url;
$gitclonecommand = 'rm -rf * && ' . 'git clone git@bitbucket.org:' . $bitbucketurl . '.git'
echo 'True! ' . $makeandcdcommand . $gitclonecommand;
$makeandcd = shell_exec($makeandcdcommand);
$gitclone = shell_exec($gitclonecommand);
echo $makeandcd . $gitclone);
};
?>
- Output for 5.4.0 - 5.4.25
- Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/5tjjh on line 27
Process exited with code 255. - Output for 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected T_ECHO in /in/5tjjh on line 27
Process exited with code 255.
preferences:
199.29 ms | 1395 KiB | 62 Q