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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,11 @@ For detailed configuration instructions, see the [Mailer Transports documentatio
## Copyright

phpList is copyright (C) 2000-2025 [phpList Ltd](https://www.phplist.com/).


### Translations
command to extract translation strings

```bash
php bin/console translation:extract --force en --format=xlf
```
19 changes: 17 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
"role": "Maintainer"
}
],
"repositories": [
{
"type": "vcs",
"url": "https://github.com/TatevikGr/rss-bundle.git"
}
],
"support": {
"issues": "https://github.com/phpList/core/issues",
"forum": "https://discuss.phplist.org/",
Expand Down Expand Up @@ -68,7 +74,10 @@
"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": "*",
"tatevikgr/rss-feed": "dev-main"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down Expand Up @@ -140,7 +149,8 @@
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle",
"Doctrine\\Bundle\\MigrationsBundle\\DoctrineMigrationsBundle",
"PhpList\\Core\\EmptyStartPageBundle\\EmptyStartPageBundle",
"FOS\\RestBundle\\FOSRestBundle"
"FOS\\RestBundle\\FOSRestBundle",
"TatevikGr\\RssFeedBundle\\RssFeedBundle"
],
"routes": {
"homepage": {
Expand All @@ -149,5 +159,10 @@
}
}
}
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
}
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
6 changes: 6 additions & 0 deletions config/doctrine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ doctrine:
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: false
mappings:
TatevikGrRssBundle:
is_bundle: false
type: attribute
dir: '%kernel.project_dir%/vendor/tatevikgr/rss-feed/src/Entity'
prefix: 'TatevikGr\RssFeedBundle\Entity'
alias: 'RssBundle'
Identity:
is_bundle: false
type: attribute
Expand Down
1 change: 1 addition & 0 deletions config/doctrine_migrations.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
doctrine_migrations:
migrations_paths:
'PhpList\Core\Migrations': '%kernel.project_dir%/src/Migrations'
# 'TatevikGr\RssBundle\RssFeedBundle\Migrations': '%kernel.project_dir%/vendor/tatevikgr/rss-bundle/src/RssFeedBundle/Migrations'
all_or_nothing: true
organize_migrations: false
storage:
Expand Down
45 changes: 44 additions & 1 deletion config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,47 @@ parameters:
env(PHPLIST_DATABASE_USER): 'phplist'
database_password: '%%env(PHPLIST_DATABASE_PASSWORD)%%'
env(PHPLIST_DATABASE_PASSWORD): 'phplist'
database_prefix: '%%env(DATABASE_PREFIX)%%'
env(DATABASE_PREFIX): 'phplist_'

# Email configuration
app.mailer_from: '%%env(MAILER_FROM)%%'
env(MAILER_FROM): 'noreply@phplist.com'
app.mailer_dsn: '%%env(MAILER_DSN)%%'
env(MAILER_DSN): 'null://null'
app.confirmation_url: '%%env(CONFIRMATION_URL)%%'
env(CONFIRMATION_URL): 'https://example.com/confirm/'
env(CONFIRMATION_URL): 'https://example.com/subscriber/confirm/'
app.subscription_confirmation_url: '%%env(SUBSCRIPTION_CONFIRMATION_URL)%%'
env(SUBSCRIPTION_CONFIRMATION_URL): 'https://example.com/subscription/confirm/'
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): 'bounce@phplist.com'
imap_bounce.password: '%%env(BOUNCE_IMAP_PASS)%%'
env(BOUNCE_IMAP_PASS): 'bounce@phplist.com'
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 All @@ -42,3 +72,16 @@ parameters:

graylog_host: 'graylog.example.com'
graylog_port: 12201

app.phplist_isp_conf_path: '%%env(APP_PHPLIST_ISP_CONF_PATH)%%'
env(APP_PHPLIST_ISP_CONF_PATH): '/etc/phplist.conf'

# Message sending
messaging.mail_queue_batch_size: '%%env(MAILQUEUE_BATCH_SIZE)%%'
env(MAILQUEUE_BATCH_SIZE): '5'
messaging.mail_queue_period: '%%env(MAILQUEUE_BATCH_PERIOD)%%'
env(MAILQUEUE_BATCH_PERIOD): '5'
messaging.mail_queue_throttle: '%%env(MAILQUEUE_THROTTLE)%%'
env(MAILQUEUE_THROTTLE): '5'
messaging.max_process_time: '%%env(MESSAGING_MAX_PROCESS_TIME)%%'
env(MESSAGING_MAX_PROCESS_TIME): '600'
92 changes: 44 additions & 48 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
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\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/'
Loading
Loading