3 require_once 'Pman.php';
5 class Pman_Builder_Dump extends Pman
8 // getAuth - everyone allowed in...
14 function get($app, $opts = array()) {
16 $b = DB_DataObject::Factory('Builder');
19 $dir = "/home/gitlive/";
22 'Clipping' => 'web.MediaOutreach/Pman/Clipping',
23 'PressRelease' => 'web.MediaOutreach/Pman/PressRelease',
24 'Ris' => 'web.Ris/Pman/Ris',
28 'ExampleOld' => false,
30 'DealFlow' => 'web.Dealflow/Pman/DealFlow',
31 'Aviation' => 'web.Aviation/Pman/Aviation',
39 $data = json_decode($b->json);
40 $data->title = $data->name;
41 $data->name = $data->{'|module'};
42 if (empty($data->name)) {
47 // {"id":"roo-file-1","name":"layout test.bjs","parent":"","title":false,"path":"/h
48 //ome/alan/buildertest/layout test.bjs"
49 $fn = $dir ."Pman.". trim($data->app) . '/' . $data->name . '.bjs';
50 if (isseT($map[trim($data->app)])) {
51 if ($map[trim($data->app)] === false) {
54 $fn = $dir .$map[$data->app]. '/' . $data->name . '.bjs';
60 if (!file_exists(dirname($fn))) {
61 print "<B>SKIP " . $fn . "</B>\n";
65 $dirs[dirname($fn)] = true;
66 echo "WRITE : " . $fn . "\n";
67 //echo " " .htmlspecialchars(json_encode($data)) . "\n";
68 file_put_contents($fn, json_encode($data));
73 foreach($dirs as $d => $n)
77 $cmd = 'git pull 2>&1';
78 echo $cmd ."\n" . `$cmd`;
80 $cmd = 'git add --all 2>&1';
81 echo $cmd ."\n" . `$cmd`;
82 $cmd = "git commit -m 'add bjs' -a --author='Alan Knowles <alan@akbkhome.com>' 2>&1";
83 echo $cmd ."\n" . `$cmd`;
84 $cmd = "git push 2>&1";
85 echo $cmd ."\n" . `$cmd`;