labels * array) there will be a small performance improvement as the * label doesn't need to be compared to and loaded from the * database anymore. */ public function _getItem($path, $constraints = array()); } interface VersioncontrolUserMapperInterface { /** * Map the author of the passed VersioncontrolOperation object to a Drupal * uid, or FALSE if no uid mapping could be made. * * @param VersioncontrolOperation $commit * The commit to be mapped. * @return mixed * Either a uid (int), or FALSE if the mapping failed. */ public function mapAuthor(VersioncontrolOperation $commit); /** * Map the committer of the passed VersioncontrolOperation object to a Drupal * uid, or FALSE if no uid mapping could be made. * * @param VersioncontrolOperation $commit * The commit to be mapped. * @return mixed * Either a uid (int), or FALSE if the mapping failed. */ public function mapCommitter(VersioncontrolOperation $commit); } interface VersioncontrolAuthHandlerInterface { public function setRepository(VersioncontrolRepository $repository); /** * Determine whether the specified user has any access at all to the * repository. * * @param int $uid * The uid of the Drupal user to be checked. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authAccess($uid); /** * Determine whether the specified user has access to create new branches in * the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolBranch $branch * The VersioncontrolBranch object representing the branch against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchCreate($uid, VersioncontrolBranch $branch); /** * Determine whether the specified user has access to delete the specified * branch in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolBranch $branch * The VersioncontrolBranch object representing the branch against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchDelete($uid, VersioncontrolBranch $branch); /** * Determine whether the specified user has access to write to the specified * branch in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolBranch $branch * The VersioncontrolBranch object representing the branch against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchUpdate($uid, VersioncontrolBranch $branch); /** * Determine whether the specified user has access to create new tags in the * repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolTag $tag * The VersioncontrolTag object representing the tag against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagCreate($uid, VersioncontrolTag $tag); /** * Determine whether the specified user has access to delete the specified * tag in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolTag $tag * The VersioncontrolTag object representing the tag against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagDelete($uid, VersioncontrolTag $tag); /** * Determine whether the specified user has access to update or modify * the specified tag in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolTag $tag * The VersioncontrolTag object representing the tag against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagUpdate($uid, VersioncontrolTag $tag); /** * Retrieve any errors messages that have been enqueued during auth checking. * * Most of the authorization methods will enqueue messages to indicate the * reason for rejecting access. These messages may be useful for logging, or * to provide as feedback to the user. * * @return array * Array of strings with the messages. */ public function getErrorMessages(); } interface VersioncontrolWebviewerUrlHandlerInterface { /** * Retrieve the URL of the repository viewer that displays the main * view of the repository. * * @return * The repository view URL of the associated repository. */ public function getRepositoryViewUrl(); /** * Retrieve the URL of the repository viewer that displays the given commit * in the corresponding repository. * * @param $revision * The revision on the commit operation whose view URL should be retrieved. * * @return * The commit view URL corresponding to the given arguments. * An empty string is returned if no commit view URL has been defined, * or if the commit cannot be viewed for any reason. */ public function getCommitViewUrl($revision); /** * Retrieve the URL of the repository viewer that displays the commit log * of the given item in the corresponding repository. If no such URL has been * specified by the user, the appropriate URL from the Commit Log module is * used as a fallback (if that module is enabled). * * @param $item * The item whose log view URL should be retrieved. * * @return * The item log view URL corresponding to the given arguments. * An empty string is returned if no item log view URL has been defined * (and if not even Commit Log is enabled), or if the item cannot be viewed * for any reason. */ public function getItemLogViewUrl(&$item); /** * Retrieve the URL of the repository viewer that displays the contents of the * given item in the corresponding repository. * * @param $item * The item whose view URL should be retrieved. * * @return * The item view URL corresponding to the given arguments. * An empty string is returned if no item view URL has been defined, * or if the item cannot be viewed for any reason. */ public function getItemViewUrl(&$item); /** * Retrieve the URL of the repository viewer that displays the diff between * two given files in the corresponding repository. * * @param $file_item_new * The new version of the file that should be diffed. * @param $file_item_old * The old version of the file that should be diffed. * * @return * The diff URL corresponding to the given arguments. * An empty string is returned if no diff URL has been defined, * or if the two items cannot be diffed for any reason. */ public function getDiffUrl(&$file_item_new, $file_item_old); } interface VersioncontrolRepositoryManagerWorkerInterface { /** * Set the repository object to be used by this plugin object. */ public function setRepository(VersioncontrolRepository $repository); public function create(); public function delete(); /** * Save the repository to the database. * * Some operations may or may not necessitate updating vcapi's db record for * the attached repository. Including this as an atomic operation allows the * caller to dictate whether or not a save should take place. * */ public function save(); }