Skip to content
Open

Dev #357

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/i18n-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: I18n Validate

on:
pull_request:
paths:
- 'resources/translations/**/*.xlf'
- 'composer.lock'
- 'composer.json'

jobs:
validate-xliff:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
php: ['8.1']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: imap, zip
tools: composer:v2
coverage: none

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: |
~/.composer/cache/files
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-

- name: Install dependencies (no dev autoloader scripts)
run: |
set -euo pipefail
composer install --no-interaction --no-progress --prefer-dist

- name: Lint XLIFF with Symfony
run: |
set -euo pipefail
# Adjust the directory to match your repo layout
php bin/console lint:xliff resources/translations

- name: Validate XLIFF XML with xmllint
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxml2-utils
# Adjust root dir; prune vendor; accept spaces/newlines safely
find resources/translations -type f -name '*.xlf' -not -path '*/vendor/*' -print0 \
| xargs -0 -n1 xmllint --noout

- name: Symfony translation sanity (extract dry-run)
run: |
set -euo pipefail
# Show what would be created/updated without writing files
php bin/console translation:extract en \
--format=xlf \
--domain=messages \
--dump-messages \
--no-interaction
# Note: omit --force to keep this a dry-run
23 changes: 23 additions & 0 deletions .weblate
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .weblate
---
projects:
- slug: phplist-core
name: phpList core
components:
- slug: messages
name: Messages
files:
# {language} is Weblate’s placeholder (e.g., fr, de, es)
- src: resources/translations/messages.en.xlf
template: true
# Where localized files live (mirrors Symfony layout)
target: resources/translations/messages.{language}.xlf
file_format: xliff
language_code_style: bcp
# Ensure placeholders like %name% are preserved
parse_file_headers: true
check_flags:
- xml-invalid
- placeholders
- urls
- accelerated
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
"symfony/sendgrid-mailer": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/messenger": "^6.4",
"symfony/lock": "^6.4"
"symfony/lock": "^6.4",
"webklex/php-imap": "^6.2",
"ext-imap": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
2 changes: 1 addition & 1 deletion config/PHPMD/rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<!-- rules from the "naming" rule set -->
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id,ip,cc"/>
<property name="exceptions" value="id,ip,cc,io"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/LongVariable">
Expand Down
9 changes: 0 additions & 9 deletions config/PhpCodeSniffer/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<!-- Classes -->
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Squiz.Classes.ClassFileName"/>
<rule ref="Squiz.Classes.DuplicateProperty"/>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="Squiz.Classes.SelfMemberReference"/>

Expand All @@ -41,9 +40,6 @@
<!-- Control structures -->
<rule ref="PEAR.ControlStructures.ControlSignature"/>

<!-- Debug -->
<rule ref="Generic.Debug.ClosureLinter"/>

<!-- Files -->
<rule ref="Generic.Files.OneClassPerFile"/>
<rule ref="Generic.Files.OneInterfacePerFile"/>
Expand All @@ -54,7 +50,6 @@
<rule ref="PEAR.Formatting.MultiLineAssignment"/>

<!-- Functions -->
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Squiz.Functions.FunctionDuplicateArgument"/>
<rule ref="Squiz.Functions.GlobalFunction"/>

Expand All @@ -66,9 +61,6 @@
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>

<!-- Objects -->
<rule ref="Squiz.Objects.ObjectMemberComma"/>

<!-- Operators -->
<rule ref="Squiz.Operators.IncrementDecrementUsage"/>
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
Expand Down Expand Up @@ -110,6 +102,5 @@
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
</ruleset>
5 changes: 4 additions & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ parameters:

framework:
#esi: ~
#translator: { fallbacks: ['%locale%'] }
translator:
default_path: '%kernel.project_dir%/resources/translations'
fallbacks: ['%locale%']

secret: '%secret%'
router:
resource: '%kernel.project_dir%/config/routing.yml'
Expand Down
26 changes: 26 additions & 0 deletions config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,32 @@ parameters:
app.password_reset_url: '%%env(PASSWORD_RESET_URL)%%'
env(PASSWORD_RESET_URL): 'https://example.com/reset/'

# bounce email settings
imap_bounce.email: '%%env(BOUNCE_EMAIL)%%'
env(BOUNCE_EMAIL): '[email protected]'
imap_bounce.password: '%%env(BOUNCE_IMAP_PASS)%%'
env(BOUNCE_IMAP_PASS): '[email protected]'
imap_bounce.host: '%%env(BOUNCE_IMAP_HOST)%%'
env(BOUNCE_IMAP_HOST): 'imap.phplist.com'
imap_bounce.port: '%%env(BOUNCE_IMAP_PORT)%%'
env(BOUNCE_IMAP_PORT): '993'
imap_bounce.encryption: '%%env(BOUNCE_IMAP_ENCRYPTION)%%'
env(BOUNCE_IMAP_ENCRYPTION): 'ssl'
imap_bounce.mailbox: '%%env(BOUNCE_IMAP_MAILBOX)%%'
env(BOUNCE_IMAP_MAILBOX): '/var/spool/mail/bounces'
imap_bounce.mailbox_name: '%%env(BOUNCE_IMAP_MAILBOX_NAME)%%'
env(BOUNCE_IMAP_MAILBOX_NAME): 'INBOX,ONE_MORE'
imap_bounce.protocol: '%%env(BOUNCE_IMAP_PROTOCOL)%%'
env(BOUNCE_IMAP_PROTOCOL): 'imap'
imap_bounce.unsubscribe_threshold: '%%env(BOUNCE_IMAP_UNSUBSCRIBE_THRESHOLD)%%'
env(BOUNCE_IMAP_UNSUBSCRIBE_THRESHOLD): '5'
imap_bounce.blacklist_threshold: '%%env(BOUNCE_IMAP_BLACKLIST_THRESHOLD)%%'
env(BOUNCE_IMAP_BLACKLIST_THRESHOLD): '3'
imap_bounce.purge: '%%env(BOUNCE_IMAP_PURGE)%%'
env(BOUNCE_IMAP_PURGE): '0'
imap_bounce.purge_unprocessed: '%%env(BOUNCE_IMAP_PURGE_UNPROCESSED)%%'
env(BOUNCE_IMAP_PURGE_UNPROCESSED): '0'

# Messenger configuration for asynchronous processing
app.messenger_transport_dsn: '%%env(MESSENGER_TRANSPORT_DSN)%%'
env(MESSENGER_TRANSPORT_DSN): 'doctrine://default?auto_setup=true'
Expand Down
96 changes: 48 additions & 48 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
imports:
- { resource: 'services/*.yml' }
- { resource: 'services/*.yml' }

services:
_defaults:
autowire: true
autoconfigure: true
public: false

PhpList\Core\Core\ConfigProvider:
arguments:
$config: '%app.config%'

PhpList\Core\Core\ApplicationStructure:
public: true

PhpList\Core\Security\Authentication:
public: true

PhpList\Core\Security\HashGenerator:
public: true

PhpList\Core\Routing\ExtraLoader:
tags: [routing.loader]

PhpList\Core\Domain\Common\Repository\AbstractRepository:
abstract: true
autowire: true
autoconfigure: false
public: true
factory: ['@doctrine.orm.entity_manager', getRepository]

# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
PhpList\Core\EmptyStartPageBundle\Controller\:
resource: '../src/EmptyStartPageBundle/Controller'
public: true
tags: [controller.service_arguments]

doctrine.orm.metadata.annotation_reader:
alias: doctrine.annotation_reader

doctrine.annotation_reader:
class: Doctrine\Common\Annotations\AnnotationReader
autowire: true

doctrine.orm.default_annotation_metadata_driver:
class: Doctrine\ORM\Mapping\Driver\AnnotationDriver
arguments:
- '@annotation_reader'
- '%kernel.project_dir%/src/Domain/Model/'
_defaults:
autowire: true
autoconfigure: true
public: false

PhpList\Core\Core\ConfigProvider:
arguments:
$config: '%app.config%'

PhpList\Core\Core\ApplicationStructure:
public: true

PhpList\Core\Security\Authentication:
public: true

PhpList\Core\Security\HashGenerator:
public: true

PhpList\Core\Routing\ExtraLoader:
tags: [routing.loader]

PhpList\Core\Domain\Common\Repository\AbstractRepository:
abstract: true
autowire: true
autoconfigure: false
public: true
factory: ['@doctrine.orm.entity_manager', getRepository]

# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
PhpList\Core\EmptyStartPageBundle\Controller\:
resource: '../src/EmptyStartPageBundle/Controller'
public: true
tags: [controller.service_arguments]

doctrine.orm.metadata.annotation_reader:
alias: doctrine.annotation_reader

doctrine.annotation_reader:
class: Doctrine\Common\Annotations\AnnotationReader
autowire: true

doctrine.orm.default_annotation_metadata_driver:
class: Doctrine\ORM\Mapping\Driver\AnnotationDriver
arguments:
- '@annotation_reader'
- '%kernel.project_dir%/src/Domain/Model/'
2 changes: 1 addition & 1 deletion config/services/builders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ services:
autowire: true
autoconfigure: true

PhpListPhpList\Core\Domain\Messaging\Service\Builder\MessageOptionsBuilder:
PhpList\Core\Domain\Messaging\Service\Builder\MessageOptionsBuilder:
autowire: true
autoconfigure: true
4 changes: 4 additions & 0 deletions config/services/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ services:
PhpList\Core\Domain\Identity\Command\:
resource: '../../src/Domain/Identity/Command'
tags: ['console.command']

PhpList\Core\Domain\Messaging\Command\ProcessBouncesCommand:
arguments:
$protocolProcessors: !tagged_iterator 'phplist.bounce_protocol_processor'
Loading
Loading