İçeriğe geç

Katkıda Bulunma Kuralları

XOOPS topluluğuna katılın ve onun dünyadaki en iyi CMS olmasına yardımcı olun.


XOOPS, topluluğun katkılarıyla gelişen açık kaynaklı bir projedir. Hataları düzeltiyor, özellikler ekliyor, belgeleri geliştiriyor veya başkalarına yardım ediyor olun, katkılarınız değerlidir.


  • Davranış Kuralları
  • Katkı İş Akışı
  • Çekme Talebi Yönergeleri
  • Sorun Raporlama
  • PHP Kodlama Standartları
  • JavaScript Standartlar
  • CSS Yönergeler
  • Smarty template Standartları
  • ADR Dizin
  • ADR template
  • ADR-001: Modüler Mimari
  • ADR-002: database Soyutlaması

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

Kodlama standartlarını takip edin ve yeni özellikler için testler yazın.

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

Ardından GitHub’da bir Çekme İsteği oluşturun.


XOOPS, PSR-1, PSR-4 ve PSR-12 kodlama standartlarına uygundur.

<?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');
}
}
KuralÖrnek
Sınıf adlarıPascalCase
Yöntem adlarıcamelCase
SabitlerUPPER_SNAKE_CASE
Değişkenler$camelCase
DosyalarClassName.php
Girinti4 alan
Hat uzunluğuMaksimum 120 karakter
{* 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"}>

TürDesenÖrnek
Özellikfeature/descriptionfeature/add-user-export
Hata düzeltmefix/descriptionfix/login-validation
Düzeltmehotfix/descriptionhotfix/security-patch
Sürümrelease/versionrelease/2.7.0

Geleneksel taahhütleri takip edin:

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

Türler:

  • feat: Yeni özellik
  • fix: Hata düzeltmesi
  • docs: Belgeler
  • style: Kod stili (biçimlendirme)
  • refactor: Kodun yeniden düzenlenmesi
  • test: Test ekleme
  • chore: Bakım

Örnekler:

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 göndermeden önce aşağıdakilerden emin olun:

  • Kod XOOPS kodlama standartlarına uygundur
  • Tüm testler başarıyla geçti
  • Yeni özelliklerin testleri var
  • Gerekirse belgeler güncellenir
  • Ana şubeyle birleştirme çakışması yok
  • Commit mesajları açıklayıcıdır
  • Halkla İlişkiler açıklaması değişiklikleri açıklıyor
  • İlgili konular bağlantılıdır

ADR’ler önemli mimari kararları belgelemektedir.

# 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?
ADRBaşlıkDurum
ADR-001Modüler MimariKabul edildi
ADR-002Nesneye Yönelik database ErişimiKabul edildi
ADR-003Smarty template MotoruKabul edildi
ADR-004Güvenlik Sistemi TasarımıKabul edildi
ADR-005PSR-15 Ara yazılım (4.0.x)Önerilen

Katkıda bulunanlar aşağıdakiler aracılığıyla tanınır:

  • Katkıda Bulunanlar Listesi - Depoda listelenmiştir
  • Sürüm Notları - Sürümlere dahil edildi
  • Şeref Listesi - Üstün katkıda bulunanlar
  • module Sertifikasyonu - modules için kalite rozeti

  • XOOPS 4.0 Yol Haritası
  • Temel Kavramlar
  • module Geliştirme


#xoops #katkıda bulunma #açık kaynak #topluluk #geliştirme #kodlama standartları