1
0
mirror of https://github.com/flarum/core.git synced 2025-07-24 10:11:43 +02:00
Commit Graph

35 Commits

Author SHA1 Message Date
Franz Liedke
4a3fcbfbc2 Fix path to extension stub directory
Refs #743.
2016-01-20 22:01:01 +01:00
Toby Zerner
0952651cf3 Fix migrate command and generated migration namespace 2015-10-19 16:48:16 +10:30
Toby Zerner
23eb4c805b Implement proper update process
If the version in the settings table mismatches the code version, then we return a 503 error for all requests coming through index.php and api.php, while admin.php serves up a form prompting for the database password which will run outstanding migrations.
2015-10-19 15:09:54 +10:30
Toby Zerner
6bf93ae9f7 Major refactor and improvements
- Reorganised all namespaces and class names for consistency and structure. Following PSR bylaws (Abstract prefix, Interface/Trait suffix).
  - Move models into root of Core, because writing `use Flarum\Core\Discussion` is nice. Namespace the rest by type. (Namespacing by entity was too arbitrary.)
  - Moved some non-domain stuff out of Core: Database, Formatter, Settings.
  - Renamed config table and all references to "settings" for consistency.
  - Remove Core class and add url()/isInstalled()/inDebugMode() as instance methods of Foundation\Application.
  - Cleanup, docblocking, etc.

- Improvements to HTTP architecture
  - API and forum/admin Actions are now actually all the same thing (simple PSR-7 Request handlers), renamed to Controllers.
  - Upgrade to tobscure/json-api 0.2 branch.
  - Where possible, moved generic functionality to tobscure/json-api (e.g. pagination links). I'm quite happy with the backend balance now re: #262

- Improvements to other architecture
  - Use Illuminate's Auth\Access\Gate interface/implementation instead of our old Locked trait. We still use events to actually determine the permissions though. Our Policy classes are actually glorified event subscribers.
  - Extract model validation into Core\Validator classes.
  - Make post visibility permission stuff much more efficient and DRY.

- Renamed Flarum\Event classes for consistency. ref #246
  - `Configure` prefix for events dedicated to configuring an object.
  - `Get` prefix for events whose listeners should return something.
  - `Prepare` prefix when a variable is passed by reference so it can be modified.
  - `Scope` prefix when a query builder is passed.

- Miscellaneous improvements/bug-fixes. I'm easily distracted!
  - Increase default height of post composer.
  - Improve post stream redraw flickering in Safari by keying loading post placeholders with their IDs. ref #451
  - Use a PHP JavaScript minification library for minifying TextFormatter's JavaScript, instead of ClosureCompilerService (can't rely on external service!)
  - Use UrlGenerator properly in various places. closes #123
  - Make Api\Client return Response object. closes #128
  - Allow extensions to specify custom icon images.
  - Allow external API/admin URLs to be optionally specified in config.php. If the value or "url" is an array, we look for the corresponding path inside. Otherwise, we append the path to the base URL, using the corresponding value in "paths" if present. closes #244
2015-10-08 14:28:02 +10:30
Toby Zerner
22beaf07f3 Remove importer for the time being 2015-09-22 17:14:01 +09:30
Toby Zerner
c5316f8a9a Fix incorrect version requirement in extension generator 2015-09-22 17:13:41 +09:30
Toby Zerner
5cc745f610 Add migration generator 2015-09-17 12:16:38 +09:30
Toby Zerner
150eef8a32 Tidy up default extension metadata 2015-09-01 10:08:37 +09:30
Toby Zerner
9024cabcb3 Only migrate enabled extensions when upgrading
Also remove the Extension::install() and Extension::uninstall()
methods, because they add nothing that can't be done with migrations.
2015-08-31 14:35:52 +09:30
Franz Liedke
54ec8364d5 Coding standards 2015-08-27 01:40:18 +02:00
Toby Zerner
455b00e234 Add header comment; PSR-2 fixes; remove seeders 2015-08-26 16:56:32 +09:30
Toby Zerner
4419b6d6b1 Migrate extensions in upgrade script 2015-08-18 13:56:49 +09:30
Toby Zerner
91c5cef521 Get generate:extension command working again 2015-08-18 13:56:25 +09:30
Toby Zerner
7bd1cb8513 Improve install command, add custom migrations system
Implemented our own migration repository + migrator (based on Laravel's
stuff) so that we can keep track of which migrations have been run for
core and per-extension. That way we can simple call the migrator to
upgrade core/extensions, and to uninstall extensions.
2015-08-14 12:47:59 +09:30
Franz Liedke
5d8371935e Redo installer 2015-08-12 01:42:39 +02:00
Toby Zerner
f8a02082ec Add admin client JS/LESS to extension stub 2015-08-04 17:18:45 +09:30
Toby Zerner
ed5733ed41 Various fixes to extension generator/stub 2015-07-23 20:24:28 +09:30
Toby Zerner
526b2c48df Group assets by client in extension stub 2015-07-22 10:12:11 +09:30
Toby Zerner
a10da1f92a Update extension generator 2015-07-20 18:08:50 +09:30
Toby Zerner
77d0bfccd7 Rework public API based on events 2015-07-18 22:59:47 +09:30
Franz Liedke
4e0c6958d3 Try to fix some namespace imports 2015-07-16 00:43:49 +02:00
Franz Liedke
25f2e72bc8 Rename import command 2015-07-16 00:38:27 +02:00
Toby Zerner
6fe1c73a49 PSR-2 fixes 2015-07-05 21:46:57 +09:30
Toby Zerner
41c5ed0acb Massive refactor
- Use contextual namespaces within Flarum\Core
- Clean up and docblock everything
- Refactor Activity/Notification blueprint stuff
- Refactor Formatter stuff
- Refactor Search stuff
- Upgrade to JSON-API 1.0
- Removed “addedPosts” and “removedPosts” relationships from discussion
API. This was used for adding/removing event posts after renaming a
discussion etc. Instead we should make an additional request to get all
new posts

Todo:
- Fix Extenders and extensions
- Get rid of repository interfaces
- Fix other bugs I’ve inevitably introduced
2015-07-04 12:24:48 +09:30
Franz Liedke
f65830948c Rename console commands 2015-06-20 20:09:47 +02:00
Franz Liedke
0262f45f57 Merge branch 'master' into psr-7
Conflicts:
	src/Api/Actions/Discussions/IndexAction.php
	src/Api/Actions/SerializeAction.php
	src/Core/Formatter/FormatterManager.php
	src/Extend/ForumAssets.php
	src/Forum/Actions/IndexAction.php
	src/Forum/ForumServiceProvider.php
2015-06-17 00:52:50 +02:00
Toby Zerner
a41d02f030 Add extension generator command. 2015-06-08 14:56:19 +09:30
Franz Liedke
891f9c4032 Merge branch 'master' into psr-7
Conflicts:
	composer.json
	composer.lock
	src/Api/Actions/TokenAction.php
	src/Core/Formatter/FormatterManager.php
	src/Core/Handlers/Events/EmailConfirmationMailer.php
	src/Forum/Actions/ConfirmEmailAction.php
	src/Forum/Actions/IndexAction.php
	src/Forum/Actions/ResetPasswordAction.php
	src/Forum/Actions/SavePasswordAction.php
	src/Forum/routes.php
2015-06-06 13:59:59 +02:00
Franz Liedke
77aecaec9d Get rid of unneeded injected dependency. 2015-06-03 03:19:32 +02:00
Toby Zerner
87f84f0614 Improvements to change/forgot password 2015-05-27 16:25:44 +09:30
Franz Liedke
0ca4e1ab7b Fix coding standards to conform to PSR-2 2015-05-19 01:03:12 +02:00
Franz Liedke
97bab21c1d Copy the config.php file upon installation.
This allows us to know whether Flarum is already installed, so that
we can disable certain service providers when it isn't.

This should fix #67.
2015-05-08 20:44:53 +02:00
Franz Liedke
4b9055ca70 Seed command: Only run seeders that have not been run as part of flarum:install command. 2015-05-08 15:15:09 +02:00
Toby Zerner
4c42be1362 Extract config into database 2015-05-02 08:07:51 +09:30
Toby Zerner
2733b5810d Upgrade to L5 + huge refactor + more. closes #2
New stuff:
- Signup + email confirmation.
- Updated authentication strategy with remember cookies. closes #5
- New search system with some example gambits! This is cool - check out
the source. Fulltext drivers will be implemented as decorators
overriding the EloquentPostRepository’s findByContent method.
- Lay down the foundation for bootstrapping the Ember app.
- Update Web layer’s asset manager to properly publish CSS/JS files.
- Console commands to run installation migrations and seeds.

Refactoring:
- New structure: move models, repositories, commands, and events into
their own namespaces, rather than grouping by entity.
- All events are classes.
- Use L5 middleware and command bus implementations.
- Clearer use of repositories and the Active Record pattern.
Repositories are used only for retrieval of ActiveRecord objects, and
then save/delete operations are called directly on those ActiveRecords.
This way, we don’t over-abstract at the cost of Eloquent magic, but
testing is still easy.
- Refactor of Web layer so that it uses the Actions routing
architecture.
- “Actor” concept instead of depending on Laravel’s Auth.
- General cleanup!
2015-02-24 20:33:18 +10:30