Skip to content

Commit 78502d2

Browse files
Sam Tukeoliverklee
authored andcommitted
[TASK] Change the package name to phplist/core (#275)
1 parent 81a546b commit 78502d2

File tree

13 files changed

+124
-122
lines changed

13 files changed

+124
-122
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1313
- Bidirectional m:n association Subscribers/SubscriberLists (#254)
1414

1515
### Changed
16+
- Rename the Composer package to "phplist/core" (#275)
1617
- Remove the obsolete core classes (#267)
1718
- Adopt more of the default Symfony project structure (#265, #268, #269, #270)
1819

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# phpList 4 core module
1+
# phpList core module
22

3-
[![Build Status](https://travis-ci.org/phpList/phplist4-core.svg?branch=master)](https://travis-ci.org/phpList/phplist4-core)
4-
[![Latest Stable Version](https://poser.pugx.org/phplist/phplist4-core/v/stable.svg)](https://packagist.org/packages/phpList/phplist4-core)
5-
[![Total Downloads](https://poser.pugx.org/phplist/phplist4-core/downloads.svg)](https://packagist.org/packages/phpList/phplist4-core)
6-
[![Latest Unstable Version](https://poser.pugx.org/phplist/phplist4-core/v/unstable.svg)](https://packagist.org/packages/phpList/phplist4-core)
7-
[![License](https://poser.pugx.org/phplist/phplist4-core/license.svg)](https://packagist.org/packages/phpList/phplist4-core)
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)
88

99

1010
## About phpList
@@ -15,7 +15,8 @@ phpList is an open source newsletter manager. This project is a rewrite of the
1515

1616
## About this package
1717

18-
This is the phpList 4 core module. It will have the following responsibilities:
18+
This is the core module of the successor to phpList 3. It will have the
19+
following responsibilities:
1920

2021
* provide access to the DB via Doctrine models and repositories (and raw SQL
2122
for performance-critical parts that do not need the models)
@@ -98,15 +99,15 @@ please see the
9899
## Changing the database schema
99100

100101
Any changes to the database schema must always be done both in phpList 3 and
101-
phpList 4 so that both versions always have the same schema.
102+
later versions so that both versions always have the same schema.
102103

103104
For changing the database schema, please edit `Database/Schema.sql` and adapt
104105
the corresponding domain model classes and repository classes accordingly.
105106

106107

107-
## Developing phpList 4 modules (plugins)
108+
## Developing phpList modules (plugins)
108109

109-
In phpList 4, plugins are called **modules**. They are Composer packages which
110+
In phpList, plugins are called **modules**. They are Composer packages which
110111
have the type `phplist-module`.
111112

112113
### Bundle and route configuration
@@ -116,7 +117,7 @@ listed in the `extra` section of the module's `composer.json` like this:
116117

117118
```json
118119
"extra": {
119-
"phplist/phplist4-core": {
120+
"phplist/core": {
120121
"bundles": [
121122
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle",
122123
"PhpList\\PhpList4\\EmptyStartPageBundle\\PhpListEmptyStartPageBundle"
@@ -126,7 +127,7 @@ listed in the `extra` section of the module's `composer.json` like this:
126127
```
127128

128129
Please note that the key of the section with `extra` needs to always be
129-
`phplist/phplist4-core`, not the name of your module package. Please have a
130+
`phplist/core`, not the name of your module package. Please have a
130131
look at the
131132
[`composer.json` in the `rest-api` module](https://github.com/phpList/rest-api/blob/master/composer.json)
132133
for an example.
@@ -136,7 +137,7 @@ the `extra` section of the module's `composer.json` like this:
136137

137138
```json
138139
"extra": {
139-
"phplist/phplist4-core": {
140+
"phplist/core": {
140141
"routes": {
141142
"homepage": {
142143
"resource": "@PhpListEmptyStartPageBundle/Controller/",
@@ -151,7 +152,7 @@ You can also provide system configuration for your module:
151152

152153
```json
153154
"extra": {
154-
"phplist/phplist4-core": {
155+
"phplist/core": {
155156
"configuration": {
156157
"framework": {
157158
"templating": {
@@ -174,7 +175,7 @@ is minimal.
174175

175176
For accessing the phpList database tables from a module, please use the
176177
[Doctrine](http://www.doctrine-project.org/) model and repository classes
177-
stored in `src/Domain/` in the `phplist/phplist4-core` package (this
178+
stored in `src/Domain/` in the `phplist/core` package (this
178179
package).
179180

180181
For accessing a repository, please have it injected via
@@ -185,8 +186,8 @@ that rely on other services having been injected.
185186

186187
Currently, only a few database tables are mapped as models/repositories. If you
187188
need a mode or a repository method that still is missing, please
188-
[submit a pull request](https://github.com/phpList/phplist4-core/pulls) or
189-
[file an issue](https://github.com/phpList/phplist4-core/issues).
189+
[submit a pull request](https://github.com/phpList/core/pulls) or
190+
[file an issue](https://github.com/phpList/core/issues).
190191

191192

192193
## Accessing the phpList data from third-party applications

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "phplist/phplist4-core",
2+
"name": "phplist/core",
33
"description": "The core module of phpList, the world's most popular open source newsletter manager",
44
"type": "phplist-module",
55
"keywords": [
@@ -18,10 +18,10 @@
1818
}
1919
],
2020
"support": {
21-
"issues": "https://github.com/phpList/phplist4-core/issues",
21+
"issues": "https://github.com/phpList/core/issues",
2222
"forum": "https://discuss.phplist.org/",
23-
"wiki": "https://github.com/phpList/phplist4-core/wiki",
24-
"source": "https://github.com/phpList/phplist4-core"
23+
"wiki": "https://github.com/phpList/core/wiki",
24+
"source": "https://github.com/phpList/core"
2525
},
2626
"require": {
2727
"php": "~7.0.0 || ~7.1.0 || ~7.2.0",
@@ -93,7 +93,7 @@
9393
"symfony-var-dir": "var",
9494
"symfony-web-dir": "public",
9595
"symfony-tests-dir": "tests",
96-
"phplist/phplist4-core": {
96+
"phplist/core": {
9797
"bundles": [
9898
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle",
9999
"Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle",

src/Composer/ModuleFinder.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function findBundleClasses(): array
4949
foreach ($modules as $module) {
5050
$extra = $module->getExtra();
5151
$this->validateBundlesSectionInExtra($extra);
52-
if (empty($extra['phplist/phplist4-core']['bundles'])) {
52+
if (empty($extra['phplist/core']['bundles'])) {
5353
continue;
5454
}
5555

56-
$bundleSets[$module->getName()] = $extra['phplist/phplist4-core']['bundles'];
56+
$bundleSets[$module->getName()] = $extra['phplist/core']['bundles'];
5757
}
5858

5959
return $bundleSets;
@@ -70,27 +70,27 @@ public function findBundleClasses(): array
7070
*/
7171
private function validateBundlesSectionInExtra(array $extra)
7272
{
73-
if (!isset($extra['phplist/phplist4-core'])) {
73+
if (!isset($extra['phplist/core'])) {
7474
return;
7575
}
7676
$this->validatePhpListSectionInExtra($extra);
7777

78-
if (!isset($extra['phplist/phplist4-core']['bundles'])) {
78+
if (!isset($extra['phplist/core']['bundles'])) {
7979
return;
8080
}
81-
if (!is_array($extra['phplist/phplist4-core']['bundles'])) {
81+
if (!is_array($extra['phplist/core']['bundles'])) {
8282
throw new \InvalidArgumentException(
83-
'The extras.phplist/phplist4-core.bundles section in the composer.json must be an array.',
83+
'The extras.phplist/core.bundles section in the composer.json must be an array.',
8484
1505411665146
8585
);
8686
}
8787

8888
/** @var array $bundleExtras */
89-
$bundleExtras = $extra['phplist/phplist4-core']['bundles'];
89+
$bundleExtras = $extra['phplist/core']['bundles'];
9090
foreach ($bundleExtras as $key => $bundleName) {
9191
if (!is_string($bundleName)) {
9292
throw new \InvalidArgumentException(
93-
'The extras.phplist/phplist4-core.bundles. ' . $key .
93+
'The extras.phplist/core.bundles. ' . $key .
9494
'" section in the composer.json must be a string.',
9595
1505412184038
9696
);
@@ -109,9 +109,9 @@ private function validateBundlesSectionInExtra(array $extra)
109109
*/
110110
private function validatePhpListSectionInExtra(array $extra)
111111
{
112-
if (!is_array($extra['phplist/phplist4-core'])) {
112+
if (!is_array($extra['phplist/core'])) {
113113
throw new \InvalidArgumentException(
114-
'The extras.phplist/phplist4-core" section in the composer.json must be an array.',
114+
'The extras.phplist/core" section in the composer.json must be an array.',
115115
1505411436144
116116
);
117117
}
@@ -146,12 +146,12 @@ public function findRoutes(): array
146146
foreach ($modules as $module) {
147147
$extra = $module->getExtra();
148148
$this->validateRoutesSectionInExtra($extra);
149-
if (empty($extra['phplist/phplist4-core']['routes'])) {
149+
if (empty($extra['phplist/core']['routes'])) {
150150
continue;
151151
}
152152

153153
/** @var array $moduleRoutes */
154-
$moduleRoutes = $extra['phplist/phplist4-core']['routes'];
154+
$moduleRoutes = $extra['phplist/core']['routes'];
155155
foreach ($moduleRoutes as $name => $route) {
156156
$prefixedRouteName = $module->getName() . '.' . $name;
157157
$routes[$prefixedRouteName] = $route;
@@ -172,27 +172,27 @@ public function findRoutes(): array
172172
*/
173173
private function validateRoutesSectionInExtra(array $extra)
174174
{
175-
if (!isset($extra['phplist/phplist4-core'])) {
175+
if (!isset($extra['phplist/core'])) {
176176
return;
177177
}
178178
$this->validatePhpListSectionInExtra($extra);
179179

180-
if (!isset($extra['phplist/phplist4-core']['routes'])) {
180+
if (!isset($extra['phplist/core']['routes'])) {
181181
return;
182182
}
183-
if (!is_array($extra['phplist/phplist4-core']['routes'])) {
183+
if (!is_array($extra['phplist/core']['routes'])) {
184184
throw new \InvalidArgumentException(
185-
'The extras.phplist/phplist4-core.routes section in the composer.json must be an array.',
185+
'The extras.phplist/core.routes section in the composer.json must be an array.',
186186
1506429004462
187187
);
188188
}
189189

190190
/** @var array $bundleExtras */
191-
$bundleExtras = $extra['phplist/phplist4-core']['routes'];
191+
$bundleExtras = $extra['phplist/core']['routes'];
192192
foreach ($bundleExtras as $routeName => $routeConfiguration) {
193193
if (!is_array($routeConfiguration)) {
194194
throw new \InvalidArgumentException(
195-
'The extras.phplist/phplist4-core.routes. ' . $routeName .
195+
'The extras.phplist/core.routes. ' . $routeName .
196196
'" section in the composer.json must be an array.',
197197
1506429860740
198198
);
@@ -228,11 +228,11 @@ public function findGeneralConfiguration(): array
228228
foreach ($modules as $module) {
229229
$extra = $module->getExtra();
230230
$this->validateGeneralConfigurationSectionInExtra($extra);
231-
if (!isset($extra['phplist/phplist4-core']['configuration'])) {
231+
if (!isset($extra['phplist/core']['configuration'])) {
232232
continue;
233233
}
234234

235-
$configurationSets[] = $extra['phplist/phplist4-core']['configuration'];
235+
$configurationSets[] = $extra['phplist/core']['configuration'];
236236
}
237237

238238
return array_replace_recursive(...$configurationSets);
@@ -249,17 +249,17 @@ public function findGeneralConfiguration(): array
249249
*/
250250
private function validateGeneralConfigurationSectionInExtra(array $extra)
251251
{
252-
if (!isset($extra['phplist/phplist4-core'])) {
252+
if (!isset($extra['phplist/core'])) {
253253
return;
254254
}
255255
$this->validatePhpListSectionInExtra($extra);
256256

257-
if (!isset($extra['phplist/phplist4-core']['configuration'])) {
257+
if (!isset($extra['phplist/core']['configuration'])) {
258258
return;
259259
}
260-
if (!is_array($extra['phplist/phplist4-core']['configuration'])) {
260+
if (!is_array($extra['phplist/core']['configuration'])) {
261261
throw new \InvalidArgumentException(
262-
'The extras.phplist/phplist4-core.configuration section in the composer.json must be an array.',
262+
'The extras.phplist/core.configuration section in the composer.json must be an array.',
263263
1508165934174
264264
);
265265
}

src/Composer/ScriptHandler.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ScriptHandler extends SensioScriptHandler
1919
/**
2020
* @var string
2121
*/
22-
const CORE_PACKAGE_NAME = 'phplist/phplist4-core';
22+
const CORE_PACKAGE_NAME = 'phplist/core';
2323

2424
/**
2525
* @var string
@@ -66,15 +66,15 @@ private static function getCoreDirectory(): string
6666
}
6767

6868
/**
69-
* Creates the "bin/" directory and its contents, copying it from the phplist4-core package.
69+
* Creates the "bin/" directory and its contents, copying it from the core package.
7070
*
71-
* This method must not be called for the phplist4-core package itself.
71+
* This method must not be called for the core package itself.
7272
*
7373
* @param Event $event
7474
*
7575
* @return void
7676
*
77-
* @throws \DomainException if this method is called for the phplist4-core package
77+
* @throws \DomainException if this method is called for the core package
7878
*/
7979
public static function createBinaries(Event $event)
8080
{
@@ -83,15 +83,15 @@ public static function createBinaries(Event $event)
8383
}
8484

8585
/**
86-
* Creates the "public/" directory and its contents, copying it from the phplist4-core package.
86+
* Creates the "public/" directory and its contents, copying it from the core package.
8787
*
88-
* This method must not be called for the phplist4-core package itself.
88+
* This method must not be called for the core package itself.
8989
*
9090
* @param Event $event
9191
*
9292
* @return void
9393
*
94-
* @throws \DomainException if this method is called for the phplist4-core package
94+
* @throws \DomainException if this method is called for the core package
9595
*/
9696
public static function createPublicWebDirectory(Event $event)
9797
{
@@ -104,15 +104,15 @@ public static function createPublicWebDirectory(Event $event)
104104
*
105105
* @return void
106106
*
107-
* @throws \DomainException if this method is called for the phplist4-core package
107+
* @throws \DomainException if this method is called for the core package
108108
*/
109109
private static function preventScriptFromCorePackage(Event $event)
110110
{
111111
$composer = $event->getComposer();
112112
$packageName = $composer->getPackage()->getName();
113113
if ($packageName === static::CORE_PACKAGE_NAME) {
114114
throw new \DomainException(
115-
'This Composer script must not be called for the phplist4-core package itself.',
115+
'This Composer script must not be called for the core package itself.',
116116
1501240572934
117117
);
118118
}
@@ -123,7 +123,7 @@ private static function preventScriptFromCorePackage(Event $event)
123123
*
124124
* This method overwrites existing files, but will not delete any files.
125125
*
126-
* This method must not be called for the phplist4-core package itself.
126+
* This method must not be called for the core package itself.
127127
*
128128
* @param string $directoryWithoutSlashes directory name (without any slashes) relative to the core package
129129
*

src/Core/ApplicationKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getRootDir()
5757
/**
5858
* Returns the absolute path to the application root.
5959
*
60-
* When phplist4-core is installed as a dependency (library) of an application, this method will return
60+
* When core is installed as a dependency (library) of an application, this method will return
6161
* the application's package path.
6262
*
6363
* When phpList4-core is installed stand-alone (i.e., as an application - usually only for testing),

src/Core/ApplicationStructure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ApplicationStructure
1212
{
1313
/**
14-
* Returns the absolute path to the phplist4-core package root.
14+
* Returns the absolute path to the core package root.
1515
*
1616
* @return string the absolute path without the trailing slash.
1717
*
@@ -25,7 +25,7 @@ public function getCorePackageRoot(): string
2525
/**
2626
* Returns the absolute path to the application root.
2727
*
28-
* When phplist4-core is installed as a dependency (library) of an application, this method will return
28+
* When core is installed as a dependency (library) of an application, this method will return
2929
* the application's package path.
3030
*
3131
* When phpList4-core is installed stand-alone (i.e., as an application - usually only for testing),
@@ -42,7 +42,7 @@ public function getApplicationRoot(): string
4242
if ($corePackageIsRootPackage) {
4343
$applicationRoot = $corePackagePath;
4444
} else {
45-
// remove 3 more path segments, i.e., "vendor/phplist/phplist4-core/"
45+
// remove 3 more path segments, i.e., "vendor/phplist/core/"
4646
$corePackagePath = dirname($corePackagePath, 3);
4747
$applicationRoot = $corePackagePath;
4848
}

0 commit comments

Comments
 (0)