-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdispatch.php
executable file
·32 lines (27 loc) · 950 Bytes
/
dispatch.php
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
30
31
32
#!/usr/bin/php
<?php
INCLUDE_ONCE('source/phenegade_functions.php');
$dropfile_path = $argv[1];
$dropfile_payload = unserialize(file_get_contents($dropfile_path));
$master_controller_process_id = $dropfile_payload['master_controller_process_id'];
phenegadeLog('Dispatch.php Begin');
//show something before we load the module
if( isset($dropfile_payload['preview_path']) && strlen($dropfile_payload['preview_path']) )
{
phenShowView($dropfile_payload['preview_path']);
}
//load the module
if( isset($dropfile_payload['module']) )
{
$phen_mod = $dropfile_payload['module'];
phenegadeLog('Dispatch - Module Found: ' . $phen_mod);
$shell_command = 'php modules/' . $phen_mod . '/start.php ' . $dropfile_path;
phenExec($shell_command);
}
//show something when the module is finished
if( isset($dropfile_payload['preview_path']) && strlen($dropfile_payload['preview_path']) )
{
phenShowView($dropfile_payload['preview_path']);
}
nextLine();
?>