Commit Graph

3501 Commits

Author SHA1 Message Date
Franz Liedke
484c6d2edb
Extract DatabaseConfig class with validation 2019-01-31 21:52:09 +01:00
Franz Liedke
8b68ff6232
Extract AdminUser class that enforces invariants 2019-01-31 21:52:09 +01:00
Franz Liedke
0a59b7164e
Move password confirmation validation to frontends
Since this is not strictly speaking a domain invariant, but rather
specific to the user interface where passwords are not displayed, and
should therefore be entered twice to prevent mistakes going unnoticed,
this stuff should be checked in the frontend, not in the install steps.

Next step: Ensure that all domain-specific validation is done in the
installer's domain layer. This will ensure these validations cannot be
forgotten, and keep the frontends DRY.
2019-01-31 21:52:08 +01:00
Franz Liedke
0879829dc4
Use dedicated temporary variable instead of array 2019-01-31 21:52:08 +01:00
Franz Liedke
78ba3bd854
Combine building and storing config in one step 2019-01-31 21:52:08 +01:00
Franz Liedke
44c91099cd
Get rid of DefaultsDataProvider
Since we do not provide a development VM anymore, it does not make sense
to have "default" credentials etc.

To reproduce something similar, I'd suggest using a YAML or JSON file
together with the `--file` option.
2019-01-31 21:52:07 +01:00
Franz Liedke
4585f03ee3
Switch to a whitelist for enabling extensions 2019-01-31 21:52:07 +01:00
Franz Liedke
bc9e8f68f1
Move default settings to install step
The various installation "frontends" (such as GUI and console) can now
provide custom overrides, if they want to.
2019-01-31 21:52:06 +01:00
Franz Liedke
f5a21584c2
Collapse namespace imports 2019-01-31 21:52:06 +01:00
Franz Liedke
e0a508a765
Catch pipeline's own exception 2019-01-31 21:52:06 +01:00
Franz Liedke
89e018a4f0
Simplify PrerequisiteInterface
I went with a return type of Collection, because it is easier to call
methods such as isEmpty() directly on those objects.
2019-01-31 21:52:05 +01:00
Franz Liedke
de6001f4cf
Fix the test setup and installer tests
We are still testing the installation logic, but not testing the
actual CLI task. I would love to do that, but IMO we first need to
find a way to do this fully from the outside, by invoking and
talking to the installer through the shell.

Because acceptance tests are easier to do when fully decoupled from
the application. (After all, they are intended to save us from
breaking things when changing code; and we cannot prove that when
we change the tests at the same time.)

It might be easier to start with acceptance tests for the web
installer, though.
2019-01-31 21:52:05 +01:00
Franz Liedke
790d5beee5
Split up the installer logic
This is probably the most complicated way I could find to fix #1587.

Jokes aside, this was done with a few goals in mind:
- Reduce coupling between the installer and the rest of Flarum's
  "Application", which we are building during installation.
- Move the installer logic to several smaller classes, which can then
  be used by the web frontend and the console task, instead of the
  former hacking its way into the latter to be "DRY".
- Separate installer infrastructure (the "pipeline", with the ability
  to revert steps upon failure) from the actual steps being taken.

The problem was conceptual, and would certainly re-occur in a similar
fashion if we wouldn't tackle it at its roots.

It is fixed now, because we no longer use the ExtensionManager for
enabling extensions, but instead duplicate some of its logic. That is
fine because we don't want to do everything it does, e.g. omit
extenders' lifecycle hooks (which depend on the Application instance
being complete).

> for each desired change, make the change easy (warning: this may be
> hard), then make the easy change

- Kent Beck, https://twitter.com/kentbeck/status/250733358307500032

Fixes #1587.
2019-01-31 21:52:04 +01:00
flarum-bot
abf224bb0a Bundled output for commit c7d2e165d7 [skip ci] 2019-01-25 04:46:37 +00:00
Daniël Klabbers
c7d2e165d7 Fixes #1686
- further cleaned up the toggle action
- there's no way to remove the redraws because then the jquery isn't being fired properly
2019-01-25 05:37:45 +01:00
Toby Zerner
0ab9facc4b Make the Request available to the Formatter\Rendering event (#1721)
This is important because extensions may wish to render post content
differently depending on Request factors such as the actor. For example,
an attachments extension might wish to hide attachments from guests.

This solution is a bit of a hack-job for now, but soon when we refactor
the API layer to use tobscure/json-api-server, and also refactor the
Formatter layer, it can be revised.
2019-01-22 23:33:49 +01:00
Daniël Klabbers
9b68bbe44e Merge branch 'master' of github.com:flarum/core 2019-01-16 11:59:04 +01:00
Daniël Klabbers
862404f052 update symfony/console, because illuminate/console needs a higher version 2019-01-16 11:58:42 +01:00
flarum-bot
b9a93f3440 Bundled output for commit c67fb2d4b6 [skip ci] 2019-01-16 09:05:46 +00:00
Daniël Klabbers
c67fb2d4b6 fixes #1686, unable to edit user password 2019-01-16 09:58:22 +01:00
Daniël Klabbers
1b2d4f1e1d set prefixing indices to be done automatically, now that illuminate can take care of that 2019-01-15 20:49:33 +01:00
Daniël Klabbers
54fdc40d87 further revert #96e2824 2019-01-15 20:49:06 +01:00
Daniël Klabbers
390148456c reverts #96e2824 2019-01-15 20:39:38 +01:00
Daniël Klabbers
167059027e Increasing test coverage (#1711)
* added a few more tests, renamed singular to plural to match controller

* increase error reporting

* removed debugging and wait for tests
2019-01-01 21:02:18 +01:00
Franz Liedke
208bad393f
Mail: Add an array of supported drivers
This can be used for e.g. validation, or a dropdown in the frontend.
It can also be extended by extensions, such as flagrow/mail-drivers.

Refs #1169.
2018-12-20 13:36:08 +01:00
Franz Liedke
8a93f8b6b6
Apply fixes from StyleCI (#1714)
[ci skip] [skip ci]
2018-12-20 13:13:58 +01:00
Franz Liedke
9db04a4e19
Register service providers alphabetically
Order should not matter - and this is the only one that can
realistically stay consistent.
2018-12-20 13:13:04 +01:00
Franz Liedke
ac5e26a254
Use a custom service provider for email configuration 2018-12-20 13:10:30 +01:00
Daniël Klabbers
9794a08f39 updated constraint for 5.7 (#1698) 2018-12-20 08:20:52 +10:30
Franz Liedke
ababb8ebef
Don't resolve services when binding listeners
Refs #1578.
2018-12-19 22:47:58 +01:00
Franz Liedke
cb3baf9955
Apply fixes from StyleCI (#1713)
[ci skip] [skip ci]
2018-12-19 22:42:54 +01:00
Franz Liedke
dbe8cba14e
Avoid unnecessary event subscribers
Refs #1578.
2018-12-19 22:27:32 +01:00
Franz Liedke
9fe671c9bb
Fix UpdateServiceProvider
- Shorten registration of routes
- Do not resolve view factory before booting
2018-12-19 22:17:44 +01:00
Franz Liedke
0e5f334a0b
Locale: Don't resolve manager just to configure it
Refs #1578.
2018-12-19 22:07:31 +01:00
Franz Liedke
e4514d8413
Shorten registration of routes 2018-12-19 21:57:59 +01:00
Franz Liedke
1080d25561
Frontends: Populate default routes only when they are resolved 2018-12-19 21:55:58 +01:00
Franz Liedke
ba594de13a
Make site extenders run after extensions
Fixes #1708.
2018-12-19 21:30:29 +01:00
Daniël Klabbers
209d13affd add 7.3 to travis (#1710) 2018-12-19 18:09:36 +01:00
Daniel Klabbers
671fdec8d0 fixes #1695, post comment count is incorrectly calculated based on all posts, including events 2018-12-19 15:07:32 +01:00
Daniel Klabbers
9eca9192ca fixes a notice due to the forum variable not being defined before compacting 2018-12-19 11:40:48 +01:00
Franz Liedke
3468bdf511
Run local extenders before booting service providers
We still need to discuss the priority of local extenders vs. those
from enabled extensions, but let's first fix the actual bug.

Refs #1708.
2018-12-18 11:16:57 +01:00
Franz Liedke
54503d2c29
API: Populate default routes only when they are resolved
Refs #1708.
2018-12-18 10:33:01 +01:00
Franz Liedke
565131e2a7
Allow passing strings (names of invokable classes) to Formatter extender
In preparation for fixing #1703.
2018-12-15 12:05:17 +01:00
Toby Zerner
f0da3cf304
Remove obsolete binding 2018-12-14 11:28:11 +10:30
Franz Liedke
6acc91577d
Apply fixes from StyleCI (#1701)
[ci skip] [skip ci]
2018-12-14 01:48:19 +01:00
Franz Liedke
3e0cd3a21f
Use class constant to get qualified class names 2018-12-14 01:47:54 +01:00
Franz Liedke
5c9fa4c62d
Get rid of docblocks that don't add information 2018-12-13 23:08:49 +01:00
Franz Liedke
4b00f7996b
Early returns 2018-12-13 23:06:59 +01:00
Kirill
b58380e224 Fix incorrect docs link (#1699) 2018-12-13 20:19:13 +01:00
Franz Liedke
b0e996e7ff
Merge pull request #1697 from flarum/fl/1578-speed-up-extenders
Do not resolve services in extenders
2018-12-13 10:33:00 +01:00