gen.php
[gitlive] / gen.php
1 <?php
2
3 $ar = explode("\n", 
4  
5 ");
6
7
8
9
10 $dir = '/home/alan/gitlive';
11 foreach($ar as $a) {
12         $a = trim($a);
13         if (!file_exists($dir.'/'. $a)) {
14
15                 $cmd = 'git clone http://git.roojs.com:8081/'. $a;
16 echo $cmd ."\n";
17                 `$cmd`;
18         }
19         if (file_exists($dir. '/'. $a.'.komodoproject')) {
20                 continue;
21         }
22         $m = md5(rand());
23         $mm = array();
24         $b = array(8,4,4,4,12);
25         $bl = 0;
26         foreach($b as $bb) {
27                 $mm[] = substr($m, $bl,$bb);
28                 $bl+=$bb;
29         }
30         $mm = implode('-', $mm);
31
32 file_put_contents($dir. '/'. $a.'.komodoproject',
33 '<?xml version="1.0" encoding="UTF-8"?>
34 <!-- Komodo Project File - DO NOT EDIT -->
35 <project id="'.$mm.'" kpf_version="5" name="'.$a.'.komodoproject">
36 <preference-set idref="'.$mm.'">
37   <string relative="path" id="import_dirname">'.$a.'</string>
38   <string id="import_exclude_matches">*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;.git;.hg;.bzr;*%*;tmp*.html;.DS_Store;*.swp;*.kpf;*.komodoproject;*.komodoto
39 ols</string>
40   <string id="import_include_matches"></string>
41   <string relative="path" id="last_local_directory">'.$a.'</string>
42 </preference-set>
43 </project>');
44  
45 }
46