public function setUp() { GenerisPhpUnitTestRunner::initTest(); $this->fsPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'taoFileTestCase' . DIRECTORY_SEPARATOR; mkdir($this->fsPath); $this->fileSource = core_kernel_fileSystem_FileSystemFactory::createFileSystem(new core_kernel_classes_Resource(INSTANCE_GENERIS_VCS_TYPE_LOCAL), '', '', '', $this->fsPath, 'testFileSource', true); }
protected function setUp() { GenerisPhpUnitTestRunner::initTest(); $this->directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "testrepo" . DIRECTORY_SEPARATOR; mkdir($this->directory); $this->repository = core_kernel_fileSystem_FileSystemFactory::createFileSystem(new core_kernel_classes_Resource(INSTANCE_GENERIS_VCS_TYPE_LOCAL), '', '', '', $this->directory, 'UnitTestRepository', true); }
/** * Short description of method run * * @access public * @author Cédric Alfonsi, <*****@*****.**> * @return mixed */ public function run() { if ($this->options['enable']) { $typeUri = !is_null($this->options['type']) ? $this->options['type'] : PROPERTY_GENERIS_VCS_TYPE_SUBVERSION; if (!is_null($this->options['type'])) { //Regarding to the versioning sytem type switch ($this->options['type']) { case 'svn': $typeUri = PROPERTY_GENERIS_VCS_TYPE_SUBVERSION; break; default: throw new common_Exception("Unable to recognize the given type " . $this->options['type']); } } else { $typeUri = PROPERTY_GENERIS_VCS_TYPE_SUBVERSION; } $type = new core_kernel_classes_Resource($typeUri); //following parameters required $url = $this->options['url']; $login = $this->options['login']; $password = $this->options['password']; $path = $this->options['path']; $repo = core_kernel_fileSystem_FileSystemFactory::createFileSystem($type, $url, $login, $password, $path, ''); try { //Initialize $success = $repo->enable(); if ($success) { $this->out(__('repository added & enabled'), array('color' => 'light_blue')); } else { $this->out(__('repository could not be enabled'), array('color' => 'red')); } } catch (Exception $e) { $this->out($e->getMessage(), array('color' => 'red')); } } }
/** * Add a local Filesource * * @access public * @author Joel Bout, <*****@*****.**> * @param string label * @param string path * @return core_kernel_versioning_Repository */ public function addLocalSource($label, $path) { $returnValue = core_kernel_fileSystem_FileSystemFactory::createFileSystem(new core_kernel_classes_Resource(INSTANCE_GENERIS_VCS_TYPE_LOCAL), '', '', '', $path, $label, true); return $returnValue; }
/** * Repository factory * * @access public * @author Jerome Bogaerts, <*****@*****.**> * @param Resource type * @param string url * @param string login * @param string password * @param string path * @param string label * @param string comment * @param string uri * @return core_kernel_versioning_Repository * @deprecated */ public static function create(core_kernel_classes_Resource $type, $url, $login, $password, $path, $label, $comment, $uri = '') { return core_kernel_fileSystem_FileSystemFactory::createFileSystem($type, $url, $login, $password, $path, $label); }