phplist / phplist4-core
The core module of phpList, the world's most popular open source newsletter manager
Installs: 1 413
Dependents: 0
Suggesters: 0
Security: 0
Stars: 86
Watchers: 17
Forks: 28
Open Issues: 26
Type:phplist-module
Requires
- php: ^7.2|^8.0
- doctrine/common: ^2.6.0
- doctrine/doctrine-bundle: ^1.8.0
- doctrine/orm: ^2.5.0
- jms/serializer-bundle: ^3.8.0
- sensio/distribution-bundle: ^5.0.6
- sensio/framework-extra-bundle: ^5.1.0
- symfony/config: ^3.4.37
- symfony/dependency-injection: ^3.4.37
- symfony/monolog-bundle: ^3.1.0
- symfony/symfony: ^3.4.37
- symfony/yaml: ^3.4.37
Requires (Dev)
- composer/composer: ^1.6.0
- doctrine/instantiator: ^1.0.5
- guzzlehttp/guzzle: ^6.3.0
- nette/caching: ^2.5.0|^3.0.0
- nikic/php-parser: ^3.1.0
- phpmd/phpmd: ^2.6.0
- phpstan/phpstan: ^0.7.0|0.12.57
- phpunit/dbunit: ^3.0.0
- phpunit/phpunit: ^6.5.6
- phpunit/phpunit-mock-objects: ^5.0.6
- squizlabs/php_codesniffer: ^3.2.0
Suggests
- phplist/rest-api: 4.0.x-dev
- phplist/web-frontend: 4.0.x-dev
- dev-main
- v4.0.0-alpha5
- v4.0.0-alpha4
- v4.0.0-alpha3
- v4.0.0-alpha2
- v4.0.0-alpha1
- dev-dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
- dev-phplist3
- dev-cleanup/document-running-phpunit-1
- dev-feature/templates-domain-repository
- dev-wip/access-trait
- dev-test/di
- dev-releases/4.0.0-alpha1
This package is auto-updated.
Last update: 2024-09-03 21:17:21 UTC
README
About phpList
phpList is an open source newsletter manager. This project is a rewrite of the original phpList.
About this package
This is the core module of the successor to phpList 3. It will have the following responsibilities:
- provide access to the DB via Doctrine models and repositories (and raw SQL for performance-critical parts that do not need the models)
- routing (which the web frontend and REST API will use)
- authentication (which the web frontend and REST API will use)
- logging
- a script for tasks to be called from the command line (or a cron job)
- tasks to create and update the DB schema
Please note that this module does not provide a web frontend or a REST API.
There are the separate modules phpList/web-frontend
and phpList/rest-api
for these tasks.
This module should not be modified locally. It should be updated via Composer.
Installation
Since this package is only a service required to run a full installation of phpList 4, the recommended way of installing this package is to run composer install
from within the phpList base distribution which requires this package. phpList/base-distribution
containrs detailed installation instructions in its README.
Contributing to this package
Contributions to phpList repositories are highly welcomed! To get started please take a look at the contribution guide. It contains everything you would need to make your first contribution including how to run local style checks and run tests.
Code of Conduct
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.
Structure
- [Class Docs][docs/phpdoc/]
- Class structure overview
- Graphic domain model and a description of the domain entities
Running the web server
The phpList application is configured so that the built-in PHP web server can run in development and testing mode, while Apache can run in production mode.
Please first set the database credentials in config/parameters.yml
.
Development
To run the application in development mode using PHP's built-in server, use this command:
bin/console server:run -d public/
The server will then listen on http://127.0.0.1:8000
(or, if port 8000 is
already in use, on the next free port after 8000).
You can stop the server with CTRL + C.
Development and Documentation
We use phpDocumentor
to automatically generate documentation for classes. To make this process efficient and easier, you are required to properly "document" your classes
,properties
, methods
... by annotating them with docblocks.
More about generatings docs in PHPDOC.md
Testing
To run the server in testing mode (which normally will only be needed for the
automated tests, provide the --env
option:
bin/console server:run -d public/ --env=test
Production
For documentation on running the application in production mode using Apache, please see the phpList base distribution README.
Changing the database schema
Any changes to the database schema must always be done both in phpList 3 and later versions so that both versions always have the same schema.
For changing the database schema, please edit resources/Database/Schema.sql
and adapt the corresponding domain model classes and repository classes
accordingly.
Developing phpList modules (plugins)
In phpList, plugins are called modules. They are Composer packages which
have the type phplist-module
.
Bundle and route configuration
If your module provides any Symfony bundles, the bundle class names need to be
listed in the extra
section of the module's composer.json
like this:
"extra": { "phplist/core": { "bundles": [ "Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle", "PhpList\\Core\\EmptyStartPageBundle\\PhpListEmptyStartPageBundle" ] } }
Please note that the key of the section with extra
needs to always be
phplist/core
, not the name of your module package. Please have a
look at the
composer.json
in the rest-api
module
for an example.
Similarly, if your module provides any routes, those also need to be listed in
the extra
section of the module's composer.json
like this:
"extra": { "phplist/core": { "routes": { "homepage": { "resource": "@PhpListEmptyStartPageBundle/Controller/", "type": "annotation" } } } }
You can also provide system configuration for your module:
"extra": { "phplist/core": { "configuration": { "framework": { "templating": { "engines": [ "twig" ] } } } } }
It is recommended to define the routes using annotations in the controller classes so that the route configuration in the composer.json is minimal.
Accessing the database
For accessing the phpList database tables from a module, please use the
Doctrine model and repository classes
stored in src/Domain/
in the phplist/core
package (this
package).
For accessing a repository, please have it injected via dependency injection. Please do not get the repository directly from the entity manager as this would skip dependency injection for that repository, causing those methods to break that rely on other services having been injected.
Currently, only a few database tables are mapped as models/repositories. If you need a mode or a repository method that still is missing, please submit a pull request or file an issue.
Accessing the phpList data from third-party applications
To access the phpList data from a third-party application (i.e., not from a phpList module), please use the REST API.
Copyright
phpList is copyright (C) 2000-2021 phpList Ltd.