• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..07-Dec-2021-

.github/H06-Dec-2019-205132

bin/H06-Dec-2019-2922

config/H06-Dec-2019-406333

docs/H06-Dec-2019-493350

public/H03-May-2022-10886

resources/Database/H06-Dec-2019-579533

src/H06-Dec-2019-3,6341,599

tests/H06-Dec-2019-5,3403,017

.gitignoreH A D06-Dec-2019192 1514

.travis.ymlH A D06-Dec-20191.9 KiB9376

CHANGELOG.mdH A D06-Dec-20191.4 KiB5336

CODE_OF_CONDUCT.mdH A D06-Dec-20193.2 KiB7858

LICENSEH A D06-Dec-201933.7 KiB662544

README.mdH A D06-Dec-20196.4 KiB204142

composer.jsonH A D06-Dec-20193.8 KiB120117

phpunit.xml.distH A D06-Dec-2019521 1512

README.md

1# phpList core module
2
3[![Build Status](https://travis-ci.org/phpList/core.svg?branch=master)](https://travis-ci.org/phpList/core)
4[![Latest Stable Version](https://poser.pugx.org/phplist/core/v/stable.svg)](https://packagist.org/packages/phpList/core)
5[![Total Downloads](https://poser.pugx.org/phplist/core/downloads.svg)](https://packagist.org/packages/phpList/core)
6[![Latest Unstable Version](https://poser.pugx.org/phplist/core/v/unstable.svg)](https://packagist.org/packages/phpList/core)
7[![License](https://poser.pugx.org/phplist/core/license.svg)](https://packagist.org/packages/phpList/core)
8
9
10## About phpList
11
12phpList is an open source newsletter manager. This project is a rewrite of the
13[original phpList](https://github.com/phpList/phplist3).
14
15
16## About this package
17
18This is the core module of the successor to phpList 3. It will have the
19following responsibilities:
20
21* provide access to the DB via Doctrine models and repositories (and raw SQL
22  for performance-critical parts that do not need the models)
23* routing (which the web frontend and REST API will use)
24* authentication (which the web frontend and REST API will use)
25* logging
26* a script for tasks to be called from the command line (or a cron job)
27* tasks to create and update the DB schema
28
29Please note that this module does not provide a web frontend or a REST API.
30There are the separate modules `phpList/web-frontend` and `phpList/rest-api`
31for these tasks.
32
33This module should not be modified locally. It should be updated via Composer.
34
35
36## Installation
37
38Please install this package via Composer from within the
39[phpList base distribution](https://github.com/phpList/base-distribution),
40which also has more detailed installation instructions in the README.
41
42
43## Contributing to this package
44
45Please read the [contribution guide](.github/CONTRIBUTING.md) on how to
46contribute and how to run the unit tests and style checks locally.
47
48### Code of Conduct
49
50This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
51By participating in this project and its community, you are expected to uphold
52this code.
53
54
55## Structure
56
57* [class structure overview](docs/ClassStructure.md)
58* [graphic domain model](docs/DomainModel/DomainModel.svg) and
59  a [description of the domain entities](docs/DomainModel/Entities.md)
60
61
62## Running the web server
63
64The phpList application is configured so that the built-in PHP web server can
65run in development and testing mode, while Apache can run in production mode.
66
67Please first set the database credentials in `config/parameters.yml`.
68
69### Development
70
71For running the application in development mode using the built-in PHP server,
72use this command:
73
74```bash
75bin/console server:run -d public/
76```
77
78The server will then listen on `http://127.0.0.1:8000` (or, if port 8000 is
79already in use, on the next free port after 8000).
80
81You can stop the server with CTRL + C.
82
83### Testing
84
85To run the server in testing mode (which normally will only be needed for the
86automated tests, provide the `--env` option:
87
88```bash
89bin/console server:run -d public/ --env=test
90```
91
92### Production
93
94For documentation on running the application in production mode using Apache,
95please see the
96[phpList base distribution README](https://github.com/phpList/base-distribution).
97
98
99## Changing the database schema
100
101Any changes to the database schema must always be done both in phpList 3 and
102later versions so that both versions always have the same schema.
103
104For changing the database schema, please edit `resources/Database/Schema.sql`
105and adapt the corresponding domain model classes and repository classes
106accordingly.
107
108
109## Developing phpList modules (plugins)
110
111In phpList, plugins are called **modules**. They are Composer packages which
112have the type `phplist-module`.
113
114### Bundle and route configuration
115
116If your module provides any Symfony bundles, the bundle class names need to be
117listed in the `extra` section of the module's `composer.json` like this:
118
119```json
120"extra": {
121    "phplist/core": {
122        "bundles": [
123            "Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle",
124            "PhpList\\Core\\EmptyStartPageBundle\\PhpListEmptyStartPageBundle"
125        ]
126    }
127}
128```
129
130Please note that the key of the section with `extra` needs to always be
131`phplist/core`, not the name of your module package. Please have a
132look at the
133[`composer.json` in the `rest-api` module](https://github.com/phpList/rest-api/blob/master/composer.json)
134for an example.
135
136Similarly, if your module provides any routes, those also need to be listed in
137the `extra` section of the module's `composer.json` like this:
138
139```json
140"extra": {
141    "phplist/core": {
142        "routes": {
143            "homepage": {
144                "resource": "@PhpListEmptyStartPageBundle/Controller/",
145                "type": "annotation"
146            }
147        }
148    }
149}
150```
151
152You can also provide system configuration for your module:
153
154```json
155"extra": {
156    "phplist/core": {
157        "configuration": {
158            "framework": {
159                "templating": {
160                    "engines": [
161                        "twig"
162                    ]
163                }
164            }
165        }
166    }
167}
168```
169
170It is recommended to define the routes using
171[annotations](https://symfony.com/doc/current/routing.html#routing-examples)
172in the controller classes so that the route configuration in the composer.json
173is minimal.
174
175### Accessing the database
176
177For accessing the phpList database tables from a module, please use the
178[Doctrine](http://www.doctrine-project.org/) model and repository classes
179stored in `src/Domain/` in the `phplist/core` package (this
180package).
181
182For accessing a repository, please have it injected via
183[dependency injection](https://symfony.com/doc/current/components/dependency_injection.html).
184Please do not get the repository directly from the entity manager as this would
185skip dependency injection for that repository, causing those methods to break
186that rely on other services having been injected.
187
188Currently, only a few database tables are mapped as models/repositories. If you
189need a mode or a repository method that still is missing, please
190[submit a pull request](https://github.com/phpList/core/pulls) or
191[file an issue](https://github.com/phpList/core/issues).
192
193
194## Accessing the phpList data from third-party applications
195
196To access the phpList data from a third-party application (i.e., not from a
197phpList module), please use the
198[REST API](https://github.com/phpList/rest-api).
199
200
201## Copyright
202
203phpList is copyright (C) 2000-2018 [phpList Ltd](https://www.phplist.com/).
204