forked from oleics/php-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhook.php
More file actions
29 lines (24 loc) · 701 Bytes
/
hook.php
File metadata and controls
29 lines (24 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once('inc.php');
header('Content-Type: text/plain');
if (file_exists('key.php'))
{
$key = require('key.php');
if ($key['current'] === $_SERVER['QUERY_STRING'])
{
$submodule = getcwd();
$project = $submodule.'/../../../';
chdir(dirname($project));
_exec('pwd');
_exec('git pull');
_exec('git submodule update');
_exec('php yiic migrate --interactive=0');
_exec('chmod -R 0777 assets');
$all_files = glob('path/to/assets/*');
foreach($all_files as $one_file){
if(is_file($one_file))
unlink($one_file);
}
}
}
_log(var_export($_POST, true));