GitRepository.class.php 850 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Define a gitrepository.
  4. * @author Administrateur
  5. * @category Plugin
  6. * @license copyright
  7. */
  8. class GitRepository extends Entity{
  9. public $id;
  10. public $url; //Adresse http (Texte Long)
  11. public $login; //Login (Texte)
  12. public $password; //Mot de passe (Texte)
  13. public $synchronise; //Synchroniser (Booléen)
  14. protected $TABLE_NAME = 'git_git_repository';
  15. public $fields =
  16. array(
  17. 'id' => 'key',
  18. 'url' => 'longstring',
  19. 'login' => 'string',
  20. 'password' => 'string',
  21. 'synchronise' => 'boolean'
  22. );
  23. public $links = array(
  24. );
  25. public function directory(){
  26. require_once(__DIR__.SLASH.'..'.SLASH.'document'.SLASH.'Element.class.php');
  27. $name = preg_replace('/\.git$|^http(s)?:\/\//is','',$this->url);
  28. return Element::root().'repository'.SLASH.slugify($name);
  29. }
  30. //Colonnes indexées
  31. public $indexes = array();
  32. }
  33. ?>