/** * Short description of method checkout * * @access public * @author Cédric Alfonsi, <*****@*****.**> * @param Repository vcs * @param string url * @param string path * @param int revision * @return boolean */ public function checkout(core_kernel_versioning_Repository $vcs, $url, $path, $revision = null) { $returnValue = (bool) false; try { $url = $vcs->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_URL)); $path = $vcs->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_PATH)); if (empty($url)) { throw new common_Exception(__CLASS__ . ' -> ' . __FUNCTION__ . '() : the url must be specified'); } if (empty($path)) { throw new common_Exception(__CLASS__ . ' -> ' . __FUNCTION__ . '() : the path must be specified'); } $returnValue = core_kernel_versioning_subversionWindows_Utils::exec($vcs, 'checkout "' . $url . '" "' . $path . '" 2>&1'); } catch (Exception $e) { die('Error code `svn_error_checkout` in ' . $e->getMessage()); } return (bool) $returnValue; }
/** * Authenticate to the repository * * @access public * @author Cédric Alfonsi, <*****@*****.**> * @param Repository vcs * @param string login * @param string password * @return boolean */ public function authenticate(core_kernel_versioning_Repository $vcs, $login, $password) { $returnValue = (bool) false; //if the system has already do its authentication to the repository, return the negociation result if (isset(self::$authenticatedRepositories[$vcs->getUri()])) { $returnValue = self::$authenticatedRepositories[$vcs->getUri()]; } else { svn_auth_set_parameter(PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS, true); // <--- Important for certificate issues! svn_auth_set_parameter(SVN_AUTH_PARAM_NON_INTERACTIVE, true); svn_auth_set_parameter(SVN_AUTH_PARAM_NO_AUTH_CACHE, true); svn_auth_set_parameter(SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, true); svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, $login); svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, $password); if (@svn_info((string) $vcs->getOnePropertyValue(new core_kernel_classes_property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_URL)), false) !== false) { $returnValue = true; } } self::$authenticatedRepositories[$vcs->getUri()] = $returnValue; return (bool) $returnValue; }