-
Notifications
You must be signed in to change notification settings - Fork 4
/
seed.php
executable file
·55 lines (49 loc) · 2.7 KB
/
seed.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php require_once './bootstrap.php';
function runseed($name, $type, Models_Seeder $seed) {
breadcrumb("in seed with " . $name . " " . $type);
$artifactIds = array();
$groups = "";
$contacts = "";
if ($type==="mendeley_profile") {
$detailList = $seed->getMendeleyProfileArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="mendeley_group") {
$detailList = $seed->getMendeleyGroupArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="slideshare_profile") {
$detailList = $seed->getSlideshareProfileArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="dryad_profile") {
$detailList = $seed->getDryadProfileArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="pubmed_grant") {
$detailList = $seed->getPubMedGrantArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="github_users") {
$detailList = $seed->getGithubUsersArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="github_orgs") {
$detailList = $seed->getGithubOrgsArtifacts($name);
$detailString = implode("\n", $detailList); # \n has to be in DOUBLE quotes not single quotes
$response = array("artifactIds"=>$detailString, "artifactCount"=>count($detailList));
} elseif ($type==="quick_report_contacts") {
$contacts = $seed->getMendeleyProfileContactsDisplay($name);
$response = array("contacts"=>$contacts);
} elseif ($type==="quick_report_groups") {
$groups = $seed->getMendeleyProfileGroupsDisplay($name);
$response = array("groups"=>$groups);
}
return($response);
}
breadcrumb("finished seed.php");
$name = trim($_REQUEST['name']);
$type = trim($_REQUEST['type']);
$seed = new Models_Seeder( new Zend_Config_Ini(CREDS_PATH) );
echo json_encode(runseed($name, $type, $seed));
?>