Skip to content

Commit

Permalink
A lot of changes (update)
Browse files Browse the repository at this point in the history
  • Loading branch information
gubi committed Nov 20, 2018
1 parent f0d16cd commit 081492e
Show file tree
Hide file tree
Showing 838 changed files with 230 additions and 746,916 deletions.
4 changes: 4 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

dataverse-php-library/
export/

__index.php
.~lock.*
composer.lock
curl.log
Empty file modified README.md
100644 → 100755
Empty file.
194 changes: 137 additions & 57 deletions common/classes/Agrovoc.php
100644 → 100755

Large diffs are not rendered by default.

28 changes: 25 additions & 3 deletions common/classes/Obj.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* PHP Version 7.2.11
*
* @copyright 2018 Bioversity International (http://www.bioversityinternational.org/)
* @copyright
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3
* @link https://github.com/gubi/bioversity_agrovoc-indexing
*/
Expand All @@ -29,9 +29,9 @@ class Obj {
public static function list($array) {
if(is_array($array)) {
sort($array);
$res = preg_replace('/\,\s+(\w+)$/', " and $1", implode(", ", $array));
return (is_numeric($res)) ? (int)$res : $res;
}
$res = preg_replace('/\,\s+(\w+)$/', " and $1", implode(", ", $array));
return (is_numeric($res)) ? (int)$res : $res;
}

/**
Expand Down Expand Up @@ -78,6 +78,28 @@ public static function move_to_bottom($array, $key) {
}
return $array + array_splice($array, array_search($key, array_keys($array)), 1);
}

/**
* Display data on screen
*
* @param string|object|array $data What to display
* @param boolean $json Display as JSON?
*/
function output($data, $json = false) {
if($json) {
// Display the output as json
header("Content-type: application/json");
// print_r(json_encode($changes, JSON_PRETTY_PRINT));
if(is_array($data)) {
print_r(json_encode($data, JSON_PRETTY_PRINT));
} else {
print_r($data);
}
} else {
header("Content-type: text/plain");
print_r($data);
}
}
}

?>
2 changes: 1 addition & 1 deletion common/classes/XML.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* PHP Version 7.2.11
*
* @copyright 2018 Bioversity International (http://www.bioversityinternational.org/)
* @copyright
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3
* @link https://github.com/gubi/bioversity_agrovoc-indexing
*/
Expand Down
200,750 changes: 0 additions & 200,750 deletions export/output.json

This file was deleted.

280,333 changes: 0 additions & 280,333 deletions export/output.txt

This file was deleted.

Loading

0 comments on commit 081492e

Please sign in to comment.