本文整理汇总了PHP中Repository::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::getName方法的具体用法?PHP Repository::getName怎么用?PHP Repository::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
/**
* View the repository
*
*/
function view()
{
if ($this->active_repository->isNew()) {
$this->httpError(HTTP_ERR_NOT_FOUND);
}
// if
if (!$this->active_repository->canView($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$this->addBreadcrumb(str_excerpt(clean($this->active_repository->getName()), 10), mobile_access_module_get_view_url($this->active_repository));
$this->addBreadcrumb(lang('View'));
$per_page = 20;
$page = intval(array_var($_GET, 'page')) > 0 ? array_var($_GET, 'page') : 1;
list($commits, $pagination) = Commits::paginateByRepository($this->active_repository, $page, $per_page);
$commits = group_by_date($commits);
$this->smarty->assign(array('pagination' => $pagination, 'commits' => $commits, 'pagination_url' => assemble_url('mobile_access_view_repository', array('object_id' => $this->active_repository->getId(), 'project_id' => $this->active_project->getId())), 'page_back_url' => assemble_url('mobile_access_view_project', array('project_id' => $this->active_project->getId()))));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:22,代码来源:MobileAccessProjectRepositoriesController.class.php
示例2: edit
/**
* Edit repository
*
* @param null
* @return void
*/
function edit()
{
if (!$this->active_repository->canEdit($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$repository_data = $this->request->post('repository');
if (!is_array($repository_data)) {
$repository_data = array('name' => $this->active_repository->getName(), 'url' => $this->active_repository->getUrl(), 'username' => $this->active_repository->getUsername(), 'password' => $this->active_repository->getPassword(), 'repositorytype' => $this->active_repository->getRepositoryType(), 'updatetype' => $this->active_repository->getUpdateType(), 'visibility' => $this->active_repository->getVisibility());
}
if ($this->request->isSubmitted()) {
db_begin_work();
$this->active_repository->setAttributes($repository_data);
$this->active_repository->loadEngine($this->active_repository->getRepositoryType());
$this->repository_engine = new RepositoryEngine($this->active_repository);
$this->repository_engine->triggerred_by_handler = true;
$result = $this->repository_engine->testRepositoryConnection();
if ($result === true) {
$save = $this->active_repository->save();
if ($save && !is_error($save)) {
db_commit();
flash_success(lang('Repository has been successfully updated'));
$this->redirectToUrl($this->active_repository->getHistoryUrl());
} else {
db_rollback();
$this->smarty->assign('errors', $save);
}
//if
} else {
db_rollback();
$errors = new ValidationErrors();
$errors->addError(lang('Failed to connect to repository: :message', array('message' => $result)));
$this->smarty->assign('errors', $errors);
}
// if
}
// if
js_assign('repository_test_connection_url', assemble_url('repository_test_connection', array('project_id' => $this->active_project->getId())));
$this->smarty->assign(array('types' => $this->active_repository->types, 'update_types' => $this->active_repository->update_types, 'repository_data' => $repository_data, 'active_repository' => $this->active_repository, 'disable_url_and_type' => instance_of($this->active_repository->getLastCommit(), 'Commit'), 'aid_url' => lang('The path to the existing repository cannot be changed'), 'aid_engine' => lang('Repository type cannot be changed')));
}
示例3: add
/**
* Add a Github repository
*
* @return void
* @return null
**/
function add()
{
if (!Repository::canAdd($this->logged_user, $this->active_project)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$repository_data = $this->request->post('repository');
if (!is_array($repository_data)) {
$repository_data = array('visibility' => $this->active_project->getDefaultVisibility());
}
// if
if ($this->request->isSubmitted()) {
$repository_data['name'] = trim($repository_data['name']) == '' ? $repository_data['url'] : $repository_data['name'];
$this->active_repository->setAttributes($repository_data);
$this->active_repository->setBody(clean(array_var($repository_data, 'url', null)));
$this->active_repository->setProjectId($this->active_project->getId());
$this->active_repository->setCreatedBy($this->logged_user);
$this->active_repository->setState(STATE_VISIBLE);
$result = $this->active_repository->testRepositoryConnection();
if ($result === true) {
$save = $this->active_repository->save();
if ($save && !is_error($save)) {
flash_success(lang('Project repository ":name" has been added successfully'), array('name' => $this->active_repository->getName()));
$this->redirectToUrl(github_module_url($this->active_project));
} else {
$save->errors['-- any --'] = $save->errors['body'];
$this->smarty->assign('errors', $save);
}
//if
} else {
$errors = new ValidationErrors();
$errors->addError(lang('Failed to connect to repository: :message', array('message' => $result)));
$this->smarty->assign('errors', $errors);
}
// if
}
// if
$this->smarty->assign(array('repository_data' => $repository_data));
}
示例4: testValidRepoName
/**
* @dataProvider validNameProvider
*/
public function testValidRepoName($name)
{
$config = new Config('/tmp');
$repo = new Repository($name, $config);
$this->assertSame($name, $repo->getName());
}