You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
619 B

  1. <?php
  2. function getRepositories () {
  3. global $repositories;
  4. $result = array();
  5. if (isset($repositories)) {
  6. $result = $repositories;
  7. }
  8. else {
  9. $result = array(
  10. 'default' => array(
  11. 'path' => $config['categoriesDir'],
  12. ),
  13. );
  14. }
  15. call_hooks("get-repositories", $result);
  16. return $result;
  17. }
  18. function getRepo ($repoId, $repoData) {
  19. switch (array_key_exists('type', $repoData) ? $repoData['type'] : 'dir') {
  20. case 'git':
  21. $repo = new RepositoryGit($repoId, $repoData);
  22. break;
  23. default:
  24. $repo = new RepositoryDir($repoId, $repoData);
  25. }
  26. return $repo;
  27. }