/**
  * Short description of method getImplementationToDelegateTo
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  Resource resource
  * @return core_kernel_versioning_RepositoryInterface
  */
 public function getImplementationToDelegateTo(core_kernel_classes_Resource $resource)
 {
     $returnValue = null;
     $VCStype = $resource->getVCSType();
     $implClass = '';
     // Function of the repository type, define the implementation to attack
     switch ($VCStype->getUri()) {
         case PROPERTY_GENERIS_VCS_TYPE_SUBVERSION:
             $returnValue = core_kernel_versioning_subversion_Repository::singleton();
             break;
         case PROPERTY_GENERIS_VCS_TYPE_SUBVERSION_WIN:
             $returnValue = core_kernel_versioning_subversionWindows_Repository::singleton();
             break;
         case INSTANCE_GENERIS_VCS_TYPE_LOCAL:
             $returnValue = core_kernel_versioning_local_Repository::singleton();
             break;
         default:
             throw new common_exception_Error('unknown Version Control System ' . $VCStype->getLabel() . '(' . $VCStype . ')');
     }
     return $returnValue;
 }
Example #2
0
 /**
  * Singleton
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @return core_kernel_versioning_subversion_Repository
  */
 public static function singleton()
 {
     $returnValue = null;
     if (is_null(self::$instance)) {
         self::$instance = new core_kernel_versioning_subversion_Repository();
     }
     $returnValue = self::$instance;
     return $returnValue;
 }