콘텐츠로 이동

기여 지침

XOOPS 커뮤니티에 참여하여 세계 최고의 CMS가 되도록 도와주세요.


XOOPS는 커뮤니티 기여를 바탕으로 성장하는 오픈 소스 프로젝트입니다. 버그 수정, 기능 추가, 문서 개선, 다른 사람 돕기 등 무엇을 하든 여러분의 기여는 소중합니다.


  • 행동강령
  • 기여 워크플로우
  • 풀 리퀘스트 지침
  • 이슈 보고
  • PHP 코딩 표준
  • JavaScript 표준
  • CSS 지침
  • Smarty 템플릿 표준
  • ADR 지수
  • ADR 템플릿
  • ADR-001: 모듈형 아키텍처
  • ADR-002: 데이터베이스 추상화

Terminal window
# Fork the repository on GitHub
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/XoopsCore27.git
cd XoopsCore27
# Add upstream remote
git remote add upstream https://github.com/XOOPS/XoopsCore27.git
# Install dependencies
composer install
Terminal window
# Sync with upstream
git fetch upstream
git checkout -b feature/my-feature upstream/main

코딩 표준을 따르고 새로운 기능에 대한 테스트를 작성하세요.

Terminal window
# Commit changes
git add .
git commit -m "Add: Brief description of changes"
# Push to your fork
git push origin feature/my-feature

그런 다음 GitHub에서 끌어오기 요청을 생성하세요.


XOOPS는 PSR-1, PSR-4 및 PSR-12 코딩 표준을 따릅니다.

<?php
declare(strict_types=1);
namespace XoopsModules\MyModule;
use Xmf\Request;
use XoopsObject;
/**
* Class Item
*
* Represents an item in the module
*/
class Item extends XoopsObject
{
/**
* Constructor
*/
public function __construct()
{
$this->initVar('id', \XOBJ_DTYPE_INT, null, false);
$this->initVar('title', \XOBJ_DTYPE_TXTBOX, '', true, 255);
$this->initVar('content', \XOBJ_DTYPE_TXTAREA, '', false);
$this->initVar('created', \XOBJ_DTYPE_INT, time(), false);
}
/**
* Get formatted title
*
* @return string
*/
public function getTitle(): string
{
return $this->getVar('title', 'e');
}
}
규칙
클래스 이름PascalCase
메소드 이름camelCase
상수UPPER_SNAKE_CASE
변수$camelCase
파일ClassName.php
들여쓰기4칸
줄 길이최대 120자
{* File: templates/mymodule_index.tpl *}
{* Description: Index page template *}
<{include file="db:mymodule_header.tpl"}>
<div class="mymodule-container">
<h1><{$page_title}></h1>
<{if $items|@count > 0}>
<ul class="item-list">
<{foreach item=item from=$items}>
<li class="item">
<a href="<{$item.url}>"><{$item.title}></a>
</li>
<{/foreach}>
</ul>
<{else}>
<p class="no-items"><{$smarty.const._MD_MYMODULE_NO_ITEMS}></p>
<{/if}>
</div>
<{include file="db:mymodule_footer.tpl"}>

유형패턴
기능feature/descriptionfeature/add-user-export
버그수정fix/descriptionfix/login-validation
핫픽스hotfix/descriptionhotfix/security-patch
출시release/versionrelease/2.7.0

기존 커밋을 따르세요.

<type>(<scope>): <subject>
<body>
<footer>

유형:

  • feat: 새로운 기능
  • fix: 버그 수정
  • docs: 문서
  • style: 코드 스타일(서식)
  • refactor: 코드 리팩토링
  • test: 테스트 추가
  • chore : 유지보수

예:

feat(auth): add two-factor authentication
Implement TOTP-based 2FA for user accounts.
- Add QR code generation for authenticator apps
- Store encrypted secrets in user profile
- Add backup codes feature
Closes #123
fix(forms): resolve XSS vulnerability in text input
Properly escape user input in XoopsFormText render method.
Security: CVE-2024-XXXX

Terminal window
# Run all tests
./vendor/bin/phpunit
# Run specific test suite
./vendor/bin/phpunit --testsuite unit
# Run with coverage
./vendor/bin/phpunit --coverage-html coverage/
<?php
namespace XoopsModulesTest\MyModule;
use PHPUnit\Framework\TestCase;
use XoopsModules\MyModule\Item;
class ItemTest extends TestCase
{
private Item $item;
protected function setUp(): void
{
$this->item = new Item();
}
public function testInitialValues(): void
{
$this->assertNull($this->item->getVar('id'));
$this->assertEquals('', $this->item->getVar('title'));
}
public function testSetTitle(): void
{
$this->item->setVar('title', 'Test Title');
$this->assertEquals('Test Title', $this->item->getVar('title'));
}
public function testTitleEscaping(): void
{
$this->item->setVar('title', '<script>alert("xss")</script>');
$escaped = $this->item->getTitle();
$this->assertStringNotContainsString('<script>', $escaped);
}
}

PR을 제출하기 전에 다음을 확인하세요.

  • 코드는 XOOPS 코딩 표준을 따릅니다.
  • 모든 테스트 통과
  • 새로운 기능에 대한 테스트가 진행 중입니다.
  • 필요한 경우 문서가 업데이트되었습니다.
  • 메인 브랜치와 병합 충돌 없음
  • 커밋 메시지는 설명적입니다.
  • PR 설명에서 변경 사항을 설명합니다.
  • 관련 이슈가 링크되어 있습니다.

ADR은 중요한 아키텍처 결정을 문서화합니다.

# ADR-XXX: Title
## Status
Proposed | Accepted | Deprecated | Superseded
## Context
What is the issue we're addressing?
## Decision
What is the change being proposed?
## Consequences
What are the positive and negative effects?
## Alternatives Considered
What other options were evaluated?
ADR제목상태
ADR-001모듈형 아키텍처수락됨
ADR-002객체 지향 데이터베이스 액세스수락됨
ADR-003Smarty 템플릿 엔진수락됨
ADR-004보안 시스템 설계수락됨
ADR-005PSR-15 미들웨어(4.0.x)제안

기여자는 다음을 통해 인정됩니다.

  • 기여자 목록 - 저장소에 나열됨
  • 릴리스 노트 - 릴리스에 포함됨
  • 명예의 전당 - 뛰어난 기여자
  • 모듈 인증 - 모듈 품질 배지

  • XOOPS 4.0 로드맵
  • 핵심 개념
  • 모듈 개발


#xoops #기여 #오픈 소스 #커뮤니티 #개발 #코딩 표준