-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdump-project-info.drush.php
38 lines (30 loc) · 1.26 KB
/
dump-project-info.drush.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
33
34
35
36
37
38
<?php
// First, delete some projects nodes.
$kill = array(
103482, // sandbox
);
foreach ($kill as $nid) {
node_delete($nid);
}
$result = db_query('SELECT cp.directory, p.uri, COALESCE((tn.tid NOT IN (13, 29)), 1) as strip_trans, p.nid FROM project_projects AS p INNER JOIN cvs_projects AS cp ON p.nid = cp.nid INNER JOIN node AS n on p.nid = n.nid LEFT JOIN term_node tn ON n.vid = tn.vid AND tn.tid IN (13, 14, 15, 29, 32, 96)');
$fileobj = new SplFileObject(dirname(__FILE__) . '/project-migrate-info', 'w');
while ($row = db_fetch_object($result)) {
$function = '_tggm_exception_' . $row->uri;
if (function_exists($function) && !$function($row)) {
// Skip this item if the exception function exists and returns FALSE.
continue;
}
$fileobj->fwrite(sprintf('%s,%s,%d,%d' . PHP_EOL, $row->directory, $row->uri, $row->strip_trans, $row->nid));
}
function _tggm_exception_sandbox(&$row) {
// The 'sandbox' catchall project would cause us to import ALL sandboxes. No freakin way.
return FALSE;
}
function _tggm_exception_hostmaster(&$row) {
$row->directory = 'git://git.aegirproject.org/export/hostmaster.git';
return TRUE;
}
function _tggm_exception_provision(&$row) {
$row->directory = 'git://git.aegirproject.org/export/provision.git';
return TRUE;
}